test: fix intermittent failure in p2p_sendtxrcncl.py

Using disconnect_p2ps instead of peer_disconnect makes
the node wait for the disconnect to complete. As a result,
we can reuse p2p_idx=0 in the add_outbound_p2p_connection calls.
This commit is contained in:
Martin Zumsande
2022-11-03 11:46:07 -04:00
parent 5274f32437
commit 74d975318a
2 changed files with 19 additions and 15 deletions

View File

@@ -625,6 +625,10 @@ class TestNode():
This method adds the p2p connection to the self.p2ps list and returns
the connection to the caller.
p2p_idx must be different for simultaneously connected peers. When reusing it for the next peer
after disconnecting the previous one, it is necessary to wait for the disconnect to finish to avoid
a race condition.
"""
def addconnection_callback(address, port):