From: Antoine Riard Date: Fri, 17 Jan 2020 19:21:02 +0000 (-0500) Subject: Fix full_stack_target mishandling of block disconnection X-Git-Tag: v0.0.12~156^2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=865267ac68d0ba72ed2d15bd6683447e8885d57e;p=rust-lightning Fix full_stack_target mishandling of block disconnection --- diff --git a/fuzz/src/full_stack.rs b/fuzz/src/full_stack.rs index 7e6135b5c..e6496125a 100644 --- a/fuzz/src/full_stack.rs +++ b/fuzz/src/full_stack.rs @@ -196,10 +196,10 @@ impl<'a> MoneyLossDetector<'a> { fn disconnect_block(&mut self) { if self.height > 0 && (self.max_height < 6 || self.height >= self.max_height - 6) { - self.height -= 1; let header = BlockHeader { version: 0x20000000, prev_blockhash: self.header_hashes[self.height], merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 }; self.manager.block_disconnected(&header, self.height as u32); self.monitor.block_disconnected(&header, self.height as u32); + self.height -= 1; let removal_height = self.height; self.txids_confirmed.retain(|_, height| { removal_height != *height