mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-03 04:01:43 +02:00
scripted-diff: use self.sync_* methods
-BEGIN VERIFY SCRIPT- sed -i -e 's/sync_blocks(self.nodes)/self.sync_blocks()/g' $(git grep -l 'sync_blocks(self.nodes)' ./test/functional/*.py) sed -i -e 's/sync_mempools(self.nodes)/self.sync_mempools()/g' $(git grep -l 'sync_mempools(self.nodes)' ./test/functional/*.py) sed -i -e 's/ sync_blocks(/ self.sync_blocks(/g' $(git grep -l sync_blocks ./test/functional/*.py) sed -i -e 's/ sync_mempools(/ self.sync_mempools(/g' $(git grep -l sync_mempools ./test/functional/*.py) -END VERIFY SCRIPT-
This commit is contained in:
@ -60,7 +60,7 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||
self.log.info("Mine enough blocks to reach the NODE_NETWORK_LIMITED range.")
|
||||
connect_nodes_bi(self.nodes, 0, 1)
|
||||
blocks = self.nodes[1].generatetoaddress(292, self.nodes[1].get_deterministic_priv_key().address)
|
||||
sync_blocks([self.nodes[0], self.nodes[1]])
|
||||
self.sync_blocks([self.nodes[0], self.nodes[1]])
|
||||
|
||||
self.log.info("Make sure we can max retrieve block at tip-288.")
|
||||
node.send_getdata_for_block(blocks[1]) # last block in valid range
|
||||
@ -86,7 +86,7 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||
# because node 2 is in IBD and node 0 is a NODE_NETWORK_LIMITED peer, sync must not be possible
|
||||
connect_nodes_bi(self.nodes, 0, 2)
|
||||
try:
|
||||
sync_blocks([self.nodes[0], self.nodes[2]], timeout=5)
|
||||
self.sync_blocks([self.nodes[0], self.nodes[2]], timeout=5)
|
||||
except:
|
||||
pass
|
||||
# node2 must remain at height 0
|
||||
@ -96,7 +96,7 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||
connect_nodes_bi(self.nodes, 1, 2)
|
||||
|
||||
# sync must be possible
|
||||
sync_blocks(self.nodes)
|
||||
self.sync_blocks()
|
||||
|
||||
# disconnect all peers
|
||||
self.disconnect_all()
|
||||
@ -108,7 +108,7 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||
connect_nodes_bi(self.nodes, 0, 1)
|
||||
|
||||
# sync must be possible, node 1 is no longer in IBD and should therefore connect to node 0 (NODE_NETWORK_LIMITED)
|
||||
sync_blocks([self.nodes[0], self.nodes[1]])
|
||||
self.sync_blocks([self.nodes[0], self.nodes[1]])
|
||||
|
||||
if __name__ == '__main__':
|
||||
NodeNetworkLimitedTest().main()
|
||||
|
Reference in New Issue
Block a user