Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added onBestBlock event #587

Merged
merged 4 commits into from
Jun 7, 2018
Merged

Added onBestBlock event #587

merged 4 commits into from
Jun 7, 2018

Conversation

adauto82
Copy link
Contributor

@adauto82 adauto82 commented Jun 6, 2018

Added a new type of event that only emits IMPORTED_BEST blocks instead of any block.

@@ -540,10 +540,13 @@ private void processBest(final Block block) {
EventDispatchThread.invokeLater(() -> transactionPool.processBest(block));
}

private void onBlock(Block block, BlockResult result) {
private void onBlock(Block block, BlockResult result, boolean isBest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to not repeat the same signature of the listeners, what if we call this method something like invokeListeners?

Copy link
Contributor

@diega diega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me. Would be possible to squash the commits before merge?

@rskops
Copy link
Collaborator

rskops commented Jun 7, 2018

SonarQube analysis reported 1 issue

  1. MAJOR EthereumListenerAdapter.java#L47: Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation. rule

@aeidelman aeidelman merged commit 981491b into master Jun 7, 2018
@aeidelman aeidelman deleted the add_best_block_event branch June 7, 2018 17:33
@aeidelman aeidelman added this to the Bamboo v0.4.4 milestone Jun 8, 2018
josedahlquist pushed a commit that referenced this pull request Jun 14, 2018
* Added onBestBlock event

* Changed flag for same checks in another method

* Move inside the if the onBlock

* Separate onBlock from onBestBlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants