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 a snapshot was loaded, and a block was submitted which forked from the chain before the snapshot block and after the last downloaded background chain block. This block would not be marked assumed-valid because it would not be an ancestor of the snapshot, and it would have nTx set, nChainTx unset, and prev->nChainTx set with a fake value, so the assert would fail. After the fix, prev->nChainTx is unset instead of being set to a fake value, so the assert succeeds. This test was originally posted by maflcko in https://github.com/bitcoin/bitcoin/issues/29261#issuecomment-1918947945 Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>pull/29370/head
parent
ef29c8b662
commit
0391458d76
Loading…
Reference in new issue