@@ -58,23 +58,23 @@ def run_test(self):
58
58
node1 = self .nodes [1 ]
59
59
node0 = self .nodes [0 ]
60
60
61
- self .nodes [0 ].add_p2p_connection (TestP2PConn ())
61
+ conn = self .nodes [0 ].add_p2p_connection (TestP2PConn ())
62
62
63
63
# Test that invs are received by test connection for all txs at
64
64
# feerate of .2 sat/byte
65
65
node1 .settxfee (Decimal ("0.00000200" ))
66
66
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 ()
69
69
70
70
# 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 ))
72
72
73
73
# Test that txs are still being received by test connection (paying .15 sat/byte)
74
74
node1 .settxfee (Decimal ("0.00000150" ))
75
75
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 ()
78
78
79
79
# Change tx fee rate to .1 sat/byte and test they are no longer received
80
80
# by the test connection
@@ -91,14 +91,14 @@ def run_test(self):
91
91
# as well.
92
92
node0 .settxfee (Decimal ("0.00020000" ))
93
93
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 ()
96
96
97
97
# 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 ))
99
99
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 ()
102
102
103
103
104
104
if __name__ == '__main__' :
0 commit comments