Ping regularly in p2p-segwit.py to keep connection alive

This pings regularly while building a big block in p2p-segwit.py, to prevent timeout

Github-Pull: #8803
Rebased-From: 0637b02fce04c800acc6747687c91c9b22f642e5
This commit is contained in:
Johnson Lau 2016-09-24 16:26:26 +08:00 committed by MarcoFalke
parent a916677ace
commit 375437c26b

View File

@ -1389,6 +1389,9 @@ class SegWitTest(BitcoinTestFramework):
block = self.build_next_block()
used_sighash_single_out_of_bounds = False
for i in range(NUM_TESTS):
# Ping regularly to keep the connection alive
if (not i % 100):
self.test_node.sync_with_ping()
# Choose random number of inputs to use.
num_inputs = random.randint(1, 10)
# Create a slight bias for producing more utxos