mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-13 17:18:00 +02:00
Fix the from-disk subtest to use a separate node so it builds on a clean genesis block, rather than the leftover chain from the in-memory subtest. Change from a two-way to a three-way block race. The UB in the old LoadChainTip (mutating nSequenceId, a sort key, while the block is in setBlockIndexCandidates) corrupts the internal tree structure, resulting in a failed erase that leaves stale blocks in the set alongside the tip. With only two competing blocks, this is caught by libstdc++ but not by libc++. A three-way split triggers the bug on both implementations. To trigger CheckBlockIndex (where the crashing assertion is), replace the restart loop with sending a new block after a single restart.
6.1 KiB
Executable File
6.1 KiB
Executable File