Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_leak_tx.py
Show All 35 Lines | def run_test(self): | ||||
self.log.info("Running test up to {} times.".format(MAX_REPEATS)) | self.log.info("Running test up to {} times.".format(MAX_REPEATS)) | ||||
for i in range(MAX_REPEATS): | for i in range(MAX_REPEATS): | ||||
self.log.info('Run repeat {}'.format(i + 1)) | self.log.info('Run repeat {}'.format(i + 1)) | ||||
txid = gen_node.sendtoaddress(gen_node.getnewaddress(), 0.01) | txid = gen_node.sendtoaddress(gen_node.getnewaddress(), 0.01) | ||||
want_tx = msg_getdata() | want_tx = msg_getdata() | ||||
want_tx.inv.append(CInv(t=1, h=int(txid, 16))) | want_tx.inv.append(CInv(t=1, h=int(txid, 16))) | ||||
inbound_peer.last_message.pop('notfound', None) | inbound_peer.last_message.pop('notfound', None) | ||||
inbound_peer.send_message(want_tx) | inbound_peer.send_and_ping(want_tx) | ||||
inbound_peer.sync_with_ping() | |||||
if inbound_peer.last_message.get('notfound'): | if inbound_peer.last_message.get('notfound'): | ||||
self.log.debug( | self.log.debug( | ||||
'tx {} was not yet announced to us.'.format(txid)) | 'tx {} was not yet announced to us.'.format(txid)) | ||||
self.log.debug( | self.log.debug( | ||||
"node has responded with a notfound message. End test.") | "node has responded with a notfound message. End test.") | ||||
assert_equal( | assert_equal( | ||||
inbound_peer.last_message['notfound'].vec[0].hash, int(txid, 16)) | inbound_peer.last_message['notfound'].vec[0].hash, int(txid, 16)) | ||||
Show All 11 Lines |