mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 18:51:15 +02:00
Merge #13916: qa: wait_for_verack by default
fa5587fe71
qa: wait_for_verack by default (MarcoFalke)
Pull request description:
This removes the need to do so manually every time a connection is added.
Tree-SHA512: a46c92cb4df41e30778b42b9fd3dcbd8d2d82aa7503d1213cb1c1165034f648d8caee01c292e2d87d05b0f71696996eef5be8a753f35ab49e5f66b0e3bf29f21
This commit is contained in:
@ -276,7 +276,7 @@ class TestNode():
|
||||
self.encryptwallet(passphrase)
|
||||
self.wait_until_stopped()
|
||||
|
||||
def add_p2p_connection(self, p2p_conn, *args, **kwargs):
|
||||
def add_p2p_connection(self, p2p_conn, *, wait_for_verack=True, **kwargs):
|
||||
"""Add a p2p connection to the node.
|
||||
|
||||
This method adds the p2p connection to the self.p2ps list and also
|
||||
@ -286,8 +286,10 @@ class TestNode():
|
||||
if 'dstaddr' not in kwargs:
|
||||
kwargs['dstaddr'] = '127.0.0.1'
|
||||
|
||||
p2p_conn.peer_connect(*args, **kwargs)()
|
||||
p2p_conn.peer_connect(**kwargs)()
|
||||
self.p2ps.append(p2p_conn)
|
||||
if wait_for_verack:
|
||||
p2p_conn.wait_for_verack()
|
||||
|
||||
return p2p_conn
|
||||
|
||||
|
Reference in New Issue
Block a user