Skip to content

Commit ffff3fe

Browse files
author
MarcoFalke
committed
test: Replace self.nodes[0].p2p with conn
1 parent faccdc8 commit ffff3fe

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

test/functional/p2p_feefilter.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ def run_test(self):
5858
node1 = self.nodes[1]
5959
node0 = self.nodes[0]
6060

61-
self.nodes[0].add_p2p_connection(TestP2PConn())
61+
conn = self.nodes[0].add_p2p_connection(TestP2PConn())
6262

6363
# Test that invs are received by test connection for all txs at
6464
# feerate of .2 sat/byte
6565
node1.settxfee(Decimal("0.00000200"))
6666
txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
67-
assert allInvsMatch(txids, self.nodes[0].p2p)
68-
self.nodes[0].p2p.clear_invs()
67+
assert allInvsMatch(txids, conn)
68+
conn.clear_invs()
6969

7070
# Set a filter of .15 sat/byte on test connection
71-
self.nodes[0].p2p.send_and_ping(msg_feefilter(150))
71+
conn.send_and_ping(msg_feefilter(150))
7272

7373
# Test that txs are still being received by test connection (paying .15 sat/byte)
7474
node1.settxfee(Decimal("0.00000150"))
7575
txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
76-
assert allInvsMatch(txids, self.nodes[0].p2p)
77-
self.nodes[0].p2p.clear_invs()
76+
assert allInvsMatch(txids, conn)
77+
conn.clear_invs()
7878

7979
# Change tx fee rate to .1 sat/byte and test they are no longer received
8080
# by the test connection
@@ -91,14 +91,14 @@ def run_test(self):
9191
# as well.
9292
node0.settxfee(Decimal("0.00020000"))
9393
txids = [node0.sendtoaddress(node0.getnewaddress(), 1)]
94-
assert allInvsMatch(txids, self.nodes[0].p2p)
95-
self.nodes[0].p2p.clear_invs()
94+
assert allInvsMatch(txids, conn)
95+
conn.clear_invs()
9696

9797
# Remove fee filter and check that txs are received again
98-
self.nodes[0].p2p.send_and_ping(msg_feefilter(0))
98+
conn.send_and_ping(msg_feefilter(0))
9999
txids = [node1.sendtoaddress(node1.getnewaddress(), 1) for x in range(3)]
100-
assert allInvsMatch(txids, self.nodes[0].p2p)
101-
self.nodes[0].p2p.clear_invs()
100+
assert allInvsMatch(txids, conn)
101+
conn.clear_invs()
102102

103103

104104
if __name__ == '__main__':

0 commit comments

Comments
 (0)