10
10
which are not included in a block and are not currently in the mempool. It has
11
11
no effect on transactions which are already conflicted or abandoned.
12
12
"""
13
-
14
13
from test_framework .test_framework import BitcoinTestFramework
15
14
from test_framework .util import *
16
- import urllib .parse
17
15
18
16
class AbandonConflictTest (BitcoinTestFramework ):
19
17
def __init__ (self ):
@@ -37,8 +35,8 @@ def run_test(self):
37
35
assert (balance - newbalance < Decimal ("0.001" )) #no more than fees lost
38
36
balance = newbalance
39
37
40
- url = urllib . parse . urlparse ( self . nodes [ 1 ]. url )
41
- self .nodes [0 ]. disconnectnode ( url . hostname + ":" + str ( p2p_port ( 1 )) )
38
+ # Disconnect nodes so node0's transactions don't get into node1's mempool
39
+ disconnect_nodes ( self .nodes [0 ], 1 )
42
40
43
41
# Identify the 10btc outputs
44
42
nA = next (i for i , vout in enumerate (self .nodes [0 ].getrawtransaction (txA , 1 )["vout" ]) if vout ["value" ] == Decimal ("10" ))
@@ -78,8 +76,9 @@ def run_test(self):
78
76
stop_node (self .nodes [0 ],0 )
79
77
self .nodes [0 ]= start_node (0 , self .options .tmpdir , ["-minrelaytxfee=0.0001" ])
80
78
81
- # Verify txs no longer in mempool
79
+ # Verify txs no longer in either node's mempool
82
80
assert_equal (len (self .nodes [0 ].getrawmempool ()), 0 )
81
+ assert_equal (len (self .nodes [1 ].getrawmempool ()), 0 )
83
82
84
83
# Not in mempool txs from self should only reduce balance
85
84
# inputs are still spent, but change not received
0 commit comments