-
Notifications
You must be signed in to change notification settings - Fork 12
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
Set and get blocks tip without filtering #548
Conversation
consensus-engine/src/lib.rs
Outdated
@@ -99,6 +97,7 @@ impl<O: Overlay> Carnot<O> { | |||
let mut new_state = self.clone(); | |||
if new_state.block_is_safe(block.clone()) { | |||
new_state.safe_blocks.insert(block.id, block.clone()); | |||
new_state.tip = block.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if block.view > new_state.tip.view
...
44353c0
to
0c16e70
Compare
safe_blocks: [(genesis_block.id, genesis_block.clone())].into(), | ||
tip: genesis_block, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: The tip could be just the safe_blocks
index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would actually be much nicer. I'll focus now on a testnet instance, do you mind taking this over?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! I'll do it!
Store the tip in a variable and return it when asked.