mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-11 15:48:05 +00:00
[tests] Check connectivity before sending in assumevalid.py
assumevalid.py would try to send over a closed P2P connection in a loop,
hitting the following failure many times:
TestFramework.mininode (ERROR): Cannot send message. No connection to node!
The test still passes, but this is a lot of noise in the test log.
Just check that the connection is open before trying to send.
Github-Pull: #11345
Rebased-From: e9e9391083
This commit is contained in:
parent
f1ced0d776
commit
f9cf7b589f
@ -68,6 +68,8 @@ class AssumeValidTest(BitcoinTestFramework):
|
||||
def send_blocks_until_disconnected(self, node):
|
||||
"""Keep sending blocks to the node until we're disconnected."""
|
||||
for i in range(len(self.blocks)):
|
||||
if not node.connection:
|
||||
break
|
||||
try:
|
||||
node.send_message(msg_block(self.blocks[i]))
|
||||
except IOError as e:
|
||||
|
Loading…
Reference in New Issue
Block a user