Right before the kill, an extra getblockcount()
-call returns start_height + 2
, same value for getindexinfo().best_block_height
.
After the kill, we jump back exactly 2 blocks to start_height
. I guess this is due to the clean shutdown in restart_node()
on line 319 in the preceding test code above having fully committed that state to disk.
IIUC, could add a comment to that affect:
0 # Indexes reset to the point we last committed them to disk - during the clean shutdown in the restart_node()- call above.
1 assert_equal(index_node.getindexinfo()['coinstatsindex']['best_block_height'], start_height)
And/or rename start_height
to committed_height
.
I tested with/without the C++ change and got the expected result, failure was:
0test_framework.test_node.FailedToStartError: [node 1] bitcoind exited with status 1 during initialization. Error: best block of coinstatsindex not found. Please rebuild the index.
Which is the same error as in #33208.
(Staying at Python review, I don’t have in-depth understanding of indexes/reorgs yet).