aboutsummaryrefslogtreecommitdiff
path: root/test/functional/replace-by-fee.py
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@chaincode.com>2017-10-20 16:10:08 -0400
committerSuhas Daftuar <sdaftuar@chaincode.com>2017-10-20 16:10:12 -0400
commitc96b2e4f096780c75e3fa8acba496d71322583a1 (patch)
tree344ef5b972f5caba3a5568668ed88d9d6e1c0715 /test/functional/replace-by-fee.py
parentff92fbf24739a022eb677daab03c87c5e6971094 (diff)
qa: Fix replace-by-fee race condition failures
Diffstat (limited to 'test/functional/replace-by-fee.py')
-rwxr-xr-xtest/functional/replace-by-fee.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/functional/replace-by-fee.py b/test/functional/replace-by-fee.py
index 269d57775c..17667b0bcc 100755
--- a/test/functional/replace-by-fee.py
+++ b/test/functional/replace-by-fee.py
@@ -72,6 +72,10 @@ class ReplaceByFeeTest(BitcoinTestFramework):
["-mempoolreplacement=0"]]
def run_test(self):
+ # Leave IBD and ensure nodes are synced
+ self.nodes[0].generate(1)
+ self.sync_all()
+
make_utxo(self.nodes[0], 1*COIN)
self.log.info("Running test simple doublespend...")
@@ -110,13 +114,18 @@ class ReplaceByFeeTest(BitcoinTestFramework):
"""Simple doublespend"""
tx0_outpoint = make_utxo(self.nodes[0], int(1.1*COIN))
+ # make_utxo may have generated a bunch of blocks, so we need to sync
+ # before we can spend the coins generated, or else the resulting
+ # transactions might not be accepted by our peers.
+ self.sync_all()
+
tx1a = CTransaction()
tx1a.vin = [CTxIn(tx0_outpoint, nSequence=0)]
tx1a.vout = [CTxOut(1*COIN, CScript([b'a']))]
tx1a_hex = txToHex(tx1a)
tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)
- self.sync_all([self.nodes])
+ self.sync_all()
# Should fail because we haven't changed the fee
tx1b = CTransaction()