rust-lightning/lightning
Jeffrey Czyz 873014875c
Correctly update the last block hash on disconnect
When a block is disconnected, the hash of the disconnected block was
used to update the last connected block. However, this amounts to a
no-op because these hashes should be equal. Successive disconnections
would update the hash but leave it one block off.

Normally, this not a problem because the last block_disconnected should
be followed by block_connected since the former is triggered by a chain
re-org. However, this assumes the user calls the API correctly and that
no failure occurs that would prevent block_connected from being called
(e.g., if fetching the connected block fails).

Instead, update the last block hash with the disconnected block's
previous block hash.
2021-03-05 15:45:13 -08:00
..
src Correctly update the last block hash on disconnect 2021-03-05 15:45:13 -08:00
Cargo.toml Update rust-bitcoin 2021-02-26 15:15:18 -05:00