Skip to content

Commit 0b272c3

Browse files
committed
QA: feature_rbf: Check opt-in RBF with TRUC signal
1 parent 3dbae62 commit 0b272c3

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

test/functional/feature_rbf.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ def set_test_params(self):
3434
"-limitancestorsize=101",
3535
"-limitdescendantcount=200",
3636
"-limitdescendantsize=101",
37+
"-mempooltruc=accept",
38+
"-paytxfee=0.00001", # this test confuses the fee estimator into nearly 1 BTC fees
3739
],
3840
# second node has default mempool parameters, besides mempoolfullrbf being disabled
3941
[
@@ -99,8 +101,10 @@ def test_service_flag():
99101

100102
self.log.info("Running test opt-in...")
101103
self.test_opt_in(fullrbf=False)
104+
self.test_opt_in(fullrbf=False, use_truc=True)
102105
self.nodes[0], self.nodes[-1] = self.nodes[-1], self.nodes[0]
103106
self.test_opt_in(fullrbf=True)
107+
self.test_opt_in(fullrbf=True, use_truc=True)
104108
self.nodes[0], self.nodes[-1] = self.nodes[-1], self.nodes[0]
105109

106110
self.log.info("Running test RPC...")
@@ -513,7 +517,7 @@ def test_too_many_replacements_with_default_mempool_params(self):
513517
self.generate(normal_node, 1)
514518
self.wallet.rescan_utxos()
515519

516-
def test_opt_in(self, fullrbf):
520+
def test_opt_in(self, fullrbf, use_truc=False):
517521
"""Replacing should only work if orig tx opted in"""
518522
tx0_outpoint = self.make_utxo(self.nodes[0], int(1.1 * COIN))
519523

@@ -572,15 +576,24 @@ def test_opt_in(self, fullrbf):
572576
# opt-in on one of the inputs
573577
# Transaction should be replaceable on either input
574578

579+
self.generate(self.nodes[0], 1) # clean mempool so parent txs don't trigger BIP125
580+
if use_truc:
581+
kwargs = {'sequence': SEQUENCE_FINAL, 'version': 3}
582+
else:
583+
kwargs = {'sequence': [SEQUENCE_FINAL, 0xfffffffd]}
584+
575585
tx3a_txid = self.wallet.send_self_transfer_multi(
576586
from_node=self.nodes[0],
577587
utxos_to_spend=[tx1a_utxo, tx2a_utxo],
578-
sequence=[SEQUENCE_FINAL, 0xfffffffd],
579588
fee_per_output=int(0.1 * COIN),
589+
**kwargs
580590
)["txid"]
581591

582592
# This transaction is shown as replaceable
583-
assert_equal(self.nodes[0].getmempoolentry(tx3a_txid)['bip125-replaceable'], True)
593+
if use_truc:
594+
assert_equal(self.nodes[0].getmempoolentry(tx3a_txid)['bip125-replaceable'], False)
595+
else:
596+
assert_equal(self.nodes[0].getmempoolentry(tx3a_txid)['bip125-replaceable'], True)
584597

585598
self.wallet.send_self_transfer(
586599
from_node=self.nodes[0],

0 commit comments

Comments
 (0)