mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
validation: report if pruning prevents completion of verification
Now the verifychain RPC returns false if the checks didn't finish because the blocks requested to be queried have been pruned.
This commit is contained in:
@@ -223,8 +223,8 @@ class PruneTest(BitcoinTestFramework):
|
||||
def reorg_back(self):
|
||||
# Verify that a block on the old main chain fork has been pruned away
|
||||
assert_raises_rpc_error(-1, "Block not available (pruned data)", self.nodes[2].getblock, self.forkhash)
|
||||
with self.nodes[2].assert_debug_log(expected_msgs=['block verification stopping at height', '(pruning, no data)']):
|
||||
self.nodes[2].verifychain(checklevel=4, nblocks=0)
|
||||
with self.nodes[2].assert_debug_log(expected_msgs=['block verification stopping at height', '(no data)']):
|
||||
assert not self.nodes[2].verifychain(checklevel=4, nblocks=0)
|
||||
self.log.info(f"Will need to redownload block {self.forkheight}")
|
||||
|
||||
# Verify that we have enough history to reorg back to the fork point
|
||||
|
||||
Reference in New Issue
Block a user