Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_tx_download.py
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | def test_inv_block(self): | ||||
# Since node 1 is connected outbound to an honest peer (node 0), it | # Since node 1 is connected outbound to an honest peer (node 0), it | ||||
# should get the tx within a timeout. (Assuming that node 0 | # should get the tx within a timeout. (Assuming that node 0 | ||||
# announced the tx within the timeout) | # announced the tx within the timeout) | ||||
# The timeout is the sum of | # The timeout is the sum of | ||||
# * the worst case until the tx is first requested from an inbound | # * the worst case until the tx is first requested from an inbound | ||||
# peer, plus | # peer, plus | ||||
# * the first time it is re-requested from the outbound peer, plus | # * the first time it is re-requested from the outbound peer, plus | ||||
# * 2 seconds to avoid races | # * 2 seconds to avoid races | ||||
assert self.nodes[1].getpeerinfo()[0]['inbound'] is False | |||||
timeout = 2 + (MAX_GETDATA_RANDOM_DELAY + INBOUND_PEER_TX_DELAY) + ( | timeout = 2 + (MAX_GETDATA_RANDOM_DELAY + INBOUND_PEER_TX_DELAY) + ( | ||||
GETDATA_TX_INTERVAL + MAX_GETDATA_RANDOM_DELAY) | GETDATA_TX_INTERVAL + MAX_GETDATA_RANDOM_DELAY) | ||||
self.log.info( | self.log.info( | ||||
"Tx should be received at node 1 after {} seconds".format(timeout)) | "Tx should be received at node 1 after {} seconds".format(timeout)) | ||||
self.sync_mempools(timeout=timeout) | self.sync_mempools(timeout=timeout) | ||||
def test_in_flight_max(self): | def test_in_flight_max(self): | ||||
self.log.info("Test that we don't request more than {} transactions from any peer, every {} minutes".format( | self.log.info("Test that we don't request more than {} transactions from any peer, every {} minutes".format( | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |