aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-08-25 23:19:07 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-08-26 00:04:05 +0200
commit6516b36731bb8e65ef8dc0dae1e7addb7877c340 (patch)
treebc1f603789aaa2ecb8751f9682d9a8a941c452f3 /test
parentf6eb85d17c6f8ed1fe043168e90d4830ab4745c3 (diff)
parent870bd4c73ddf494dc23c658bf0fb672ee0109158 (diff)
downloadbitcoin-6516b36731bb8e65ef8dc0dae1e7addb7877c340.tar.xz
Merge #12676: Show "bip125-replaceable" flag, when retrieving mempool entries
870bd4c73ddf494dc23c658bf0fb672ee0109158 Update functional RBF test to check replaceable flag (dexX7) 820d31f95fb6b886b38dab5d378825bea7edd49e Add "bip125-replaceable" flag to mempool RPCs (dexX7) Pull request description: This pull request adds a flag "bip125-replaceable" to the mempool RPCs getrawmempool, getmempoolentry, getmempoolancestors and getmempooldescendants, which indicates whether an unconfirmed transaction might be replaced. Initially the flag was added to the raw transaction RPCs, but thanks to @conscott, it was moved to the mempool RPCs, which actually have access to the mempool. ~~This pull request adds a flag "bip125-replaceable" to the RPCs "getrawtransaction" and "decoderawtransaction", which indicates, whether a transaction signals BIP 125 replaceability.~~ There was some discussion in #7817, whether showing replaceability in the UI could lead to the false assumption that transactions that don't signal BIP 125 are truely non-replaceable, but given that this PR tackles the raw transaction interface, which is a rather low level tool, I believe having this extra piece of information isn't bad. Tree-SHA512: 1f5511957af2c20a9a6c79d80a335c3be37a2402dbf829c40cceaa01a24868eab81a9c1cdb0b3d77198fa3bb82799e3540a5c0ce7f35bbac80d73f7133ff7cbc
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_rbf.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py
index 6105da810c..7e84ba43b5 100755
--- a/test/functional/feature_rbf.py
+++ b/test/functional/feature_rbf.py
@@ -429,6 +429,9 @@ class ReplaceByFeeTest(BitcoinTestFramework):
tx1a_hex = txToHex(tx1a)
tx1a_txid = self.nodes[0].sendrawtransaction(tx1a_hex, True)
+ # This transaction isn't shown as replaceable
+ assert_equal(self.nodes[0].getmempoolentry(tx1a_txid)['bip125-replaceable'], False)
+
# Shouldn't be able to double-spend
tx1b = CTransaction()
tx1b.vin = [CTxIn(tx0_outpoint, nSequence=0)]
@@ -469,7 +472,10 @@ class ReplaceByFeeTest(BitcoinTestFramework):
tx3a.vout = [CTxOut(int(0.9*COIN), CScript([b'c'])), CTxOut(int(0.9*COIN), CScript([b'd']))]
tx3a_hex = txToHex(tx3a)
- self.nodes[0].sendrawtransaction(tx3a_hex, True)
+ tx3a_txid = self.nodes[0].sendrawtransaction(tx3a_hex, True)
+
+ # This transaction is shown as replaceable
+ assert_equal(self.nodes[0].getmempoolentry(tx3a_txid)['bip125-replaceable'], True)
tx3b = CTransaction()
tx3b.vin = [CTxIn(COutPoint(tx1a_txid, 0), nSequence=0)]