]> git.bitcoin.ninja Git - rust-lightning/commit
Use current height when generating claims on block_disconnected
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Fri, 21 Apr 2023 22:54:03 +0000 (15:54 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Sat, 22 Apr 2023 18:16:28 +0000 (11:16 -0700)
commit69d0bfacd916a42381059cf703fb0554608233d9
tree97f05ab765cf1faa0346d5ef4dbcb4478264b8d0
parent02ae5cb9a7b66d17c23d9cdc10d7cfa659ea4450
Use current height when generating claims on block_disconnected

The `height` argument passed to `OnchainTxHandler::block_disconnected`
represents the height being disconnected, and not the current height.
Due to the incorrect assumption, we'd generate a claim with a locktime
in the future.

Ultimately, we shouldn't be generating claims within
`block_disconnected`. Rather, we should retry the claim at a later block
height, since the bitcoin blockchain does not ever roll back without
connecting a new block. Addressing this is left for future work.
lightning/src/chain/onchaintx.rs