mirror of https://github.com/bitcoin/bitcoin
Add a test for a CheckBlockIndex crash that would happen before previous "assumeutxo: Get rid of faked nTx and nChainTx values" commit. The crash was an assert failure in the (pindex->nChainTx == pindex->nTx + prev_chain_tx) check that would previously happen if the snapshot block was submitted after loading the snapshot and downloading a few blocks after the snapshot. In that case ReceivedBlockTransactions() previously would overwrite the nChainTx value of the submitted snapshot block with a fake value based on the previous block, so the (pindex->nChainTx == pindex->nTx + prev_chain_tx) check would later fail on the first block after the snapshot. This test was originally posted by Martin Zumsande <mzumsande@gmail.com> in https://github.com/bitcoin/bitcoin/pull/29370#issuecomment-1974096225 Co-authored-by: Martin Zumsande <mzumsande@gmail.com>pull/29370/head
parent
0391458d76
commit
ef174e9ed2
Loading…
Reference in new issue