Skip to content

Commit

Permalink
remember to commit the batch when successfully processing a header...
Browse files Browse the repository at this point in the history
  • Loading branch information
antiochp committed Jul 2, 2019
1 parent ac074c4 commit 0c62f53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ impl Chain {
let batch = self.store.batch()?;
let mut ctx = self.new_ctx(opts, batch, &mut txhashset)?;
pipe::process_block_header(bh, &mut ctx)?;
ctx.batch.commit()?;
Ok(())
}

Expand All @@ -367,10 +368,8 @@ impl Chain {
let mut txhashset = self.txhashset.write();
let batch = self.store.batch()?;
let mut ctx = self.new_ctx(opts, batch, &mut txhashset)?;

pipe::sync_block_headers(headers, &mut ctx)?;
ctx.batch.commit()?;

Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion chain/src/txhashset/txhashset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ impl<'a> Extension<'a> {
/// Rewinds the MMRs to the provided block, rewinding to the last output pos
/// and last kernel pos of that block.
pub fn rewind(&mut self, header: &BlockHeader) -> Result<(), Error> {
debug!("Rewind to header {} at {}", header.hash(), header.height,);
debug!("Rewind extension to {} at {}", header.hash(), header.height,);

// We need to build bitmaps of added and removed output positions
// so we can correctly rewind all operations applied to the output MMR
Expand Down

0 comments on commit 0c62f53

Please sign in to comment.