mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 01:42:58 +01:00
rpc: call RecalculateBestHeader as part of reconsiderblock
Co-authored-by: Fabian Jahr <fjahr@protonmail.com>
This commit is contained in:
parent
a51e91783a
commit
9275e9689a
@ -1648,6 +1648,7 @@ void ReconsiderBlock(ChainstateManager& chainman, uint256 block_hash) {
|
||||
}
|
||||
|
||||
chainman.ActiveChainstate().ResetBlockFailureFlags(pblockindex);
|
||||
chainman.RecalculateBestHeader();
|
||||
}
|
||||
|
||||
BlockValidationState state;
|
||||
|
@ -83,6 +83,8 @@ class InvalidateTest(BitcoinTestFramework):
|
||||
self.nodes[1].reconsiderblock(blocks[-4])
|
||||
# Should be back at the tip by now
|
||||
assert_equal(self.nodes[1].getbestblockhash(), blocks[-1])
|
||||
# Should report consistent blockchain info
|
||||
assert_equal(self.nodes[1].getblockchaininfo()["headers"], self.nodes[1].getblockchaininfo()["blocks"])
|
||||
|
||||
self.log.info("Verify that invalidating an unknown block throws an error")
|
||||
assert_raises_rpc_error(-5, "Block not found", self.nodes[1].invalidateblock, "00" * 32)
|
||||
|
Loading…
Reference in New Issue
Block a user