Skip to content

Commit

Permalink
Merge #20022: test: use explicit p2p objects where available
Browse files Browse the repository at this point in the history
0fcaf73 test: use explicit p2p objects where available (Oliver Gugger)

Pull request description:

  This is a follow-up patch to #19804 as suggested by MarcoFalke (bitcoin/bitcoin#19804 (comment)).

  To make the intent of the tests easier to understand, we reference the
  p2p connection objects by their explicit names instead of the p2ps array.

ACKs for top commit:
  theStack:
    ACK 0fcaf73

Tree-SHA512: 37db22185077beeadfa7245bb768b87d6b7a2cfb906c3c859ab92ec3d657122db7301777f0838e13dfc748f37303850144fb7553e6cb6c66903e304d6e10e659
  • Loading branch information
MarcoFalke committed Sep 26, 2020
2 parents 78f912c + 0fcaf73 commit 8aa3a4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/functional/p2p_getdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def run_test(self):
good_getdata = msg_getdata()
good_getdata.inv.append(CInv(t=2, h=best_block))
p2p_block_store.send_and_ping(good_getdata)
p2p_block_store.wait_until(lambda: self.nodes[0].p2ps[0].blocks[best_block] == 1)
p2p_block_store.wait_until(lambda: p2p_block_store.blocks[best_block] == 1)


if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion test/functional/wallet_resendwallettransactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def run_test(self):
two_min = 2 * 60
node.setmocktime(now + twelve_hrs - two_min)
time.sleep(2) # ensure enough time has passed for rebroadcast attempt to occur
assert_equal(int(txid, 16) in node.p2ps[1].get_invs(), False)
assert_equal(int(txid, 16) in peer_second.get_invs(), False)

self.log.info("Bump time & check that transaction is rebroadcast")
# Transaction should be rebroadcast approximately 24 hours in the future,
Expand Down

0 comments on commit 8aa3a4a

Please sign in to comment.