Skip to content
This repository has been archived by the owner on Jun 17, 2020. It is now read-only.

Slightly simplify some BlockParser logic #162

Merged
merged 2 commits into from Aug 21, 2018

Conversation

chirhonul
Copy link
Member

Also add TODO about concern in validating block header vs just
block height.

@ripcurlx
Copy link
Member

utACK

Copy link
Member

@ManfredKarrer ManfredKarrer left a comment

Choose a reason for hiding this comment

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

Can you add the check for the blockHash as well?

return !bsqStateService.getBlockAtHeight(rawBlock.getHeight()).isPresent();
private boolean isBlockAlreadyAdded(RawBlock rawBlock) {
// TODO(chirhonul): shouldn't we verify that we know about the blockHash, not just that the
// block heights are the same? how do we handle chainsplits otherwise?
Copy link
Member

Choose a reason for hiding this comment

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

Yes, true.

Copy link
Member Author

Choose a reason for hiding this comment

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

That seems beyond the scope of the current PR (which is a refactor with no functional changes), which is why I added it as a TODO here. I'd be happy to address it in a follow-up PR.

Copy link
Member

Choose a reason for hiding this comment

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

Ok.

@chirhonul
Copy link
Member Author

chirhonul commented Aug 21, 2018

Thanks for the review!

@ManfredKarrer: I'd prefer to change the functionality of isBlockAlreadyAdded() to make it more robust in a follow-up PR (see comment inline). Please take another look and see if you agree that we can merge this (once current release is out) as-is.

Edit: I forgot to mention that I believe that the failing CI build is unrelated to this change.. the error is:

[ ... ]
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':compileClasspath'.
> Could not find network.bisq:bisq-p2p:-SNAPSHOT.
[ ... ]
BUILD FAILED in 19s
1 actionable task: 1 executed
The command "eval ./gradlew assemble " failed. Retrying, 2 of 3.

I would rerun the Travis job, but I seem to lack the permissions to do so.

@chirhonul
Copy link
Member Author

I've made the changes mentioned as a TODO in a branch based on this changeset:

I will open the second PR when this one has been merged.

@ManfredKarrer
Copy link
Member

utACK

@ManfredKarrer ManfredKarrer merged commit 34bc6f6 into bisq-network:master Aug 21, 2018
@chirhonul chirhonul deleted the 1808-block-parse-tweaks branch August 27, 2018 11:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants