rpc: add optional blockhash to waitfornewblock

This commit is contained in:
Sjors Provoost
2024-11-21 13:35:19 +01:00
parent bfeacc18b3
commit 0786b7509a
3 changed files with 22 additions and 4 deletions

View File

@@ -579,7 +579,8 @@ class BlockchainTest(BitcoinTestFramework):
node.reconsiderblock(rollback_hash)
# The chain has probably already been restored by the time reconsiderblock returns,
# but poll anyway.
self.wait_until(lambda: node.waitfornewblock(timeout=100)['hash'] == current_hash)
self.wait_until(lambda: node.waitfornewblock(current_tip=rollback_header['previousblockhash'])['hash'] == current_hash)
assert_raises_rpc_error(-1, "Negative timeout", node.waitfornewblock, -1)
def _test_waitforblockheight(self):