Skip to content

Commit fa5587f

Browse files
author
MarcoFalke
committed
qa: wait_for_verack by default
1 parent 1cd5f2c commit fa5587f

21 files changed

+11
-56
lines changed

test/functional/example_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,9 @@ def custom_method(self):
130130
def run_test(self):
131131
"""Main test logic"""
132132

133-
# Create P2P connections to two of the nodes
133+
# Create P2P connections will wait for a verack to make sure the connection is fully up
134134
self.nodes[0].add_p2p_connection(BaseNode())
135135

136-
# wait_for_verack ensures that the P2P connection is fully up.
137-
self.nodes[0].p2p.wait_for_verack()
138-
139136
# Generating a block on one of the nodes will get us out of IBD
140137
blocks = [int(self.nodes[0].generate(nblocks=1)[0], 16)]
141138
self.sync_all([self.nodes[0:1]])
@@ -187,7 +184,6 @@ def run_test(self):
187184
self.nodes[0].disconnect_p2ps()
188185

189186
self.nodes[2].add_p2p_connection(BaseNode())
190-
self.nodes[2].p2p.wait_for_verack()
191187

192188
self.log.info("Wait for node2 reach current tip. Test that it has propagated all the blocks to us")
193189

test/functional/feature_assumevalid.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ def assert_blockchain_height(self, node, height):
9595
break
9696

9797
def run_test(self):
98-
99-
# Connect to node0
10098
p2p0 = self.nodes[0].add_p2p_connection(BaseNode())
101-
self.nodes[0].p2p.wait_for_verack()
10299

103100
# Build the blockchain
104101
self.tip = int(self.nodes[0].getbestblockhash(), 16)
@@ -168,10 +165,6 @@ def run_test(self):
168165
p2p1 = self.nodes[1].add_p2p_connection(BaseNode())
169166
p2p2 = self.nodes[2].add_p2p_connection(BaseNode())
170167

171-
p2p0.wait_for_verack()
172-
p2p1.wait_for_verack()
173-
p2p2.wait_for_verack()
174-
175168
# send header lists to all three nodes
176169
p2p0.send_header_for_blocks(self.blocks[0:2000])
177170
p2p0.send_header_for_blocks(self.blocks[2000:])

test/functional/feature_cltv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def set_test_params(self):
6767

6868
def run_test(self):
6969
self.nodes[0].add_p2p_connection(P2PInterface())
70-
self.nodes[0].p2p.wait_for_verack()
7170

7271
self.log.info("Mining %d blocks", CLTV_HEIGHT - 2)
7372
self.coinbase_blocks = self.nodes[0].generate(CLTV_HEIGHT - 2)

test/functional/feature_csv_activation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ def sync_blocks(self, blocks, success=True, reject_code=None, reject_reason=None
183183

184184
def run_test(self):
185185
self.nodes[0].add_p2p_connection(P2PDataStore())
186-
self.nodes[0].p2p.wait_for_verack()
187186

188187
self.log.info("Generate blocks in the past for coinbase outputs.")
189188
long_past_time = int(time.time()) - 600 * 1000 # enough to build up to 1000 blocks 10 minutes apart without worrying about getting into the future

test/functional/feature_dersig.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ def set_test_params(self):
5757
def run_test(self):
5858
self.nodes[0].add_p2p_connection(P2PInterface())
5959

60-
# wait_for_verack ensures that the P2P connection is fully up.
61-
self.nodes[0].p2p.wait_for_verack()
62-
6360
self.log.info("Mining %d blocks", DERSIG_HEIGHT - 2)
6461
self.coinbase_blocks = self.nodes[0].generate(DERSIG_HEIGHT - 2)
6562
self.nodeaddress = self.nodes[0].getnewaddress()

test/functional/feature_maxuploadtarget.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ def run_test(self):
5757
for _ in range(3):
5858
p2p_conns.append(self.nodes[0].add_p2p_connection(TestP2PConn()))
5959

60-
for p2pc in p2p_conns:
61-
p2pc.wait_for_verack()
62-
63-
# Test logic begins here
64-
6560
# Now mine a big block
6661
mine_large_block(self.nodes[0], self.utxo_cache)
6762

@@ -147,7 +142,6 @@ def run_test(self):
147142

148143
# Reconnect to self.nodes[0]
149144
self.nodes[0].add_p2p_connection(TestP2PConn())
150-
self.nodes[0].p2p.wait_for_verack()
151145

152146
#retrieve 20 blocks which should be enough to break the 1MB limit
153147
getdata_request.inv = [CInv(2, big_new_block)]

test/functional/feature_versionbits_warning.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,8 @@ def versionbits_in_alert_file(self):
6262
return VB_PATTERN.search(alert_text) is not None
6363

6464
def run_test(self):
65-
# Handy alias
6665
node = self.nodes[0]
6766
node.add_p2p_connection(P2PInterface())
68-
node.p2p.wait_for_verack()
6967

7068
# Mine one period worth of blocks
7169
node.generate(VB_PERIOD)

test/functional/p2p_compactblocks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -790,11 +790,9 @@ def announce_cmpct_block(node, peer):
790790
def run_test(self):
791791
# Setup the p2p connections
792792
self.test_node = self.nodes[0].add_p2p_connection(TestP2PConn())
793-
self.segwit_node = self.nodes[1].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK|NODE_WITNESS)
793+
self.segwit_node = self.nodes[1].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK | NODE_WITNESS)
794794
self.old_node = self.nodes[1].add_p2p_connection(TestP2PConn(), services=NODE_NETWORK)
795795

796-
self.test_node.wait_for_verack()
797-
798796
# We will need UTXOs to construct transactions in later tests.
799797
self.make_utxos()
800798

test/functional/p2p_feefilter.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ def run_test(self):
4747
node1.generate(1)
4848
sync_blocks(self.nodes)
4949

50-
# Setup the p2p connections
5150
self.nodes[0].add_p2p_connection(TestP2PConn())
52-
self.nodes[0].p2p.wait_for_verack()
5351

5452
# Test that invs are received for all txs at feerate of 20 sat/byte
5553
node1.settxfee(Decimal("0.00020000"))

test/functional/p2p_fingerprint.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def last_header_equals(self, expected_hash, node):
7575
# last month but that have over a month's worth of work are also withheld.
7676
def run_test(self):
7777
node0 = self.nodes[0].add_p2p_connection(P2PInterface())
78-
node0.wait_for_verack()
7978

8079
# Set node time to 60 days ago
8180
self.nodes[0].setmocktime(int(time.time()) - 60 * 24 * 60 * 60)

0 commit comments

Comments
 (0)