mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 18:53:21 +01:00
test: fancier Python for getblockfrompeer
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
@@ -40,12 +40,8 @@ class GetBlockFromPeerTest(BitcoinTestFramework):
|
|||||||
self.sync_blocks()
|
self.sync_blocks()
|
||||||
|
|
||||||
self.log.info("Node 0 should only have the header for node 1's block 3")
|
self.log.info("Node 0 should only have the header for node 1's block 3")
|
||||||
for x in self.nodes[0].getchaintips():
|
x = next(filter(lambda x: x['hash'] == short_tip, self.nodes[0].getchaintips()))
|
||||||
if x['hash'] == short_tip:
|
|
||||||
assert_equal(x['status'], "headers-only")
|
assert_equal(x['status'], "headers-only")
|
||||||
break
|
|
||||||
else:
|
|
||||||
raise AssertionError("short tip not synced")
|
|
||||||
assert_raises_rpc_error(-1, "Block not found on disk", self.nodes[0].getblock, short_tip)
|
assert_raises_rpc_error(-1, "Block not found on disk", self.nodes[0].getblock, short_tip)
|
||||||
|
|
||||||
self.log.info("Fetch block from node 1")
|
self.log.info("Fetch block from node 1")
|
||||||
|
|||||||
Reference in New Issue
Block a user