Skip to content

Commit

Permalink
Use the correct prev view number when pushing a block
Browse files Browse the repository at this point in the history
Currently, we're using the wrong previous view number when pushing the first
block after a macro block (because it should be the macro block's own view
number and we're using the next view number which is always 0), this
causes problems when reverting blocks (because there we're using the
right view number).

This fixes #423.
  • Loading branch information
jeffesquivels committed Nov 22, 2021
1 parent ef87dee commit 32b92d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion blockchain/src/blockchain/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ impl Blockchain {
if let Err(e) = this.check_and_commit(
&this.state,
&chain_info.head,
prev_info.head.next_view_number(),
prev_info.head.view_number(),
&mut txn,
) {
txn.abort();
Expand Down

0 comments on commit 32b92d2

Please sign in to comment.