diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-05 12:11:54 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-09-05 12:11:10 +0200 |
commit | fae0b21e6c7a27f08ea8f8b49198c734f923b5da (patch) | |
tree | 4d94135215f530b7713cb56f133ea18ef831a0c3 /test/functional/test_framework/p2p.py | |
parent | 260445bee8f003d5dd863d16e1eb2240bb130549 (diff) | |
download | bitcoin-fae0b21e6c7a27f08ea8f8b49198c734f923b5da.tar.xz |
test: Combine sync_send_with_ping and sync_with_ping
Diffstat (limited to 'test/functional/test_framework/p2p.py')
-rwxr-xr-x | test/functional/test_framework/p2p.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py index d9c7f9f390..ceb4bbd7de 100755 --- a/test/functional/test_framework/p2p.py +++ b/test/functional/test_framework/p2p.py @@ -558,16 +558,12 @@ class P2PInterface(P2PConnection): self.send_message(message) self.sync_with_ping(timeout=timeout) - def sync_send_with_ping(self, timeout=60): - """Ensure SendMessages is called on this connection""" - # Calling sync_with_ping twice requires that the node calls + def sync_with_ping(self, timeout=60): + """Ensure ProcessMessages and SendMessages is called on this connection""" + # Sending two pings back-to-back, requires that the node calls # `ProcessMessage` twice, and thus ensures `SendMessages` must have # been called at least once - self.sync_with_ping() - self.sync_with_ping() - - def sync_with_ping(self, timeout=60): - """Ensure ProcessMessages is called on this connection""" + self.send_message(msg_ping(nonce=0)) self.send_message(msg_ping(nonce=self.ping_counter)) def test_function(): |