Skip to content

Commit 965a124

Browse files
committed
[tests] Fix abandonconflict.py intermittency
1 parent 35da2ae commit 965a124

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/functional/abandonconflict.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
which are not included in a block and are not currently in the mempool. It has
1111
no effect on transactions which are already conflicted or abandoned.
1212
"""
13-
1413
from test_framework.test_framework import BitcoinTestFramework
1514
from test_framework.util import *
16-
import urllib.parse
1715

1816
class AbandonConflictTest(BitcoinTestFramework):
1917
def __init__(self):
@@ -37,8 +35,8 @@ def run_test(self):
3735
assert(balance - newbalance < Decimal("0.001")) #no more than fees lost
3836
balance = newbalance
3937

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)
4240

4341
# Identify the 10btc outputs
4442
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):
7876
stop_node(self.nodes[0],0)
7977
self.nodes[0]=start_node(0, self.options.tmpdir, ["-minrelaytxfee=0.0001"])
8078

81-
# Verify txs no longer in mempool
79+
# Verify txs no longer in either node's mempool
8280
assert_equal(len(self.nodes[0].getrawmempool()), 0)
81+
assert_equal(len(self.nodes[1].getrawmempool()), 0)
8382

8483
# Not in mempool txs from self should only reduce balance
8584
# inputs are still spent, but change not received

0 commit comments

Comments
 (0)