mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-27 22:42:34 +01:00
validation: call RecalculateBestHeader in InvalidChainFound
This means that it is being called in two situations: 1.) As part of the invalidateblock rpc 2.) When we receive a block for which we have a valid header in our block index, but the block turns out to be invalid
This commit is contained in:
@@ -41,6 +41,8 @@ class InvalidateTest(BitcoinTestFramework):
|
||||
self.nodes[0].invalidateblock(badhash)
|
||||
assert_equal(self.nodes[0].getblockcount(), 4)
|
||||
assert_equal(self.nodes[0].getbestblockhash(), besthash_n0)
|
||||
# Should report consistent blockchain info
|
||||
assert_equal(self.nodes[0].getblockchaininfo()["headers"], self.nodes[0].getblockchaininfo()["blocks"])
|
||||
|
||||
self.log.info("Make sure we won't reorg to a lower work chain:")
|
||||
self.connect_nodes(1, 2)
|
||||
|
||||
Reference in New Issue
Block a user