wallet: mark -walletrbf startup option as deprecated

All transactions are by default replaceable since v28, the wallet need not have
a configuration option to opt into RBF signalling because it seems redundant
now. Emit a warning if this option is used.
This commit is contained in:
rkrux
2026-05-20 16:50:28 +05:30
parent c4a7613e6a
commit 97f7cc0233
6 changed files with 20 additions and 9 deletions

View File

@@ -24,6 +24,8 @@ from test_framework.script_util import (
script_to_p2sh_script,
)
WALLETRBF_DEPRECATION_WARNING = "Warning: -walletrbf is deprecated and will be fully removed in the next release."
Key = namedtuple('Key', ['privkey',
'pubkey',
'p2pkh_script',

View File

@@ -28,6 +28,7 @@ from test_framework.util import (
assert_greater_than,
assert_raises_rpc_error,
)
from test_framework.wallet_util import WALLETRBF_DEPRECATION_WARNING
LAST_KEYPOOL_INDEX = 9 # Index of the last derived address with the keypool size of 10
@@ -349,9 +350,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
# Restore the wallet to master
load_res = node_master.restorewallet(wallet_name, backup_path)
# There should be no warnings
assert "warnings" not in load_res
assert_equal(load_res["warnings"], [WALLETRBF_DEPRECATION_WARNING[9:]])
wallet = node_master.get_wallet_rpc(wallet_name)
info = wallet.getaddressinfo(address)

View File

@@ -32,6 +32,7 @@ from test_framework.util import (
find_vout_for_address,
)
from test_framework.wallet import MiniWallet
from test_framework.wallet_util import WALLETRBF_DEPRECATION_WARNING
WALLET_PASSPHRASE = "test"
@@ -116,6 +117,8 @@ class BumpFeeTest(BitcoinTestFramework):
test_feerate_checks_replaced_outputs(self, rbf_node, peer_node)
test_bumpfee_with_feerate_ignores_walletincrementalrelayfee(self, rbf_node, peer_node)
self.restart_node(1, [], expected_stderr=WALLETRBF_DEPRECATION_WARNING)
def test_invalid_parameters(self, rbf_node, peer_node, dest_address):
self.log.info('Test invalid parameters')
rbfid = spend_one_input(rbf_node, dest_address)
@@ -460,7 +463,7 @@ def test_bumpfee_with_abandoned_descendant_succeeds(self, rbf_node, rbf_node_add
assert bumped_result['txid'] in rbf_node.getrawmempool()
assert parent_id not in rbf_node.getrawmempool()
# Cleanup
self.restart_node(1, self.extra_args[1])
self.restart_node(1, self.extra_args[1], expected_stderr=WALLETRBF_DEPRECATION_WARNING)
rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
self.connect_nodes(1, 0)
self.clear_mempool()
@@ -535,11 +538,11 @@ def test_maxtxfee_fails(self, rbf_node, dest_address):
# size of bumped transaction (p2wpkh, 1 input, 2 outputs): 141 vbytes
# expected bump fee of 141 vbytes * 0.00200000 BTC / 1000 vbytes = 0.00002820 BTC
# which exceeds maxtxfee and is expected to raise
self.restart_node(1, ['-maxtxfee=0.000025'] + self.extra_args[1])
self.restart_node(1, ['-maxtxfee=0.000025'] + self.extra_args[1], expected_stderr=WALLETRBF_DEPRECATION_WARNING)
rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
rbfid = spend_one_input(rbf_node, dest_address)
assert_raises_rpc_error(-4, "Unable to create transaction. Fee exceeds maximum configured by user (e.g. -maxtxfee, maxfeerate)", rbf_node.bumpfee, rbfid)
self.restart_node(1, self.extra_args[1])
self.restart_node(1, self.extra_args[1], expected_stderr=WALLETRBF_DEPRECATION_WARNING)
rbf_node.walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
self.connect_nodes(1, 0)
self.clear_mempool()

View File

@@ -23,7 +23,7 @@ from test_framework.util import (
assert_raises_rpc_error,
find_vout_for_address,
)
from test_framework.wallet_util import get_generate_key
from test_framework.wallet_util import get_generate_key, WALLETRBF_DEPRECATION_WARNING
class ListTransactionsTest(BitcoinTestFramework):
@@ -104,6 +104,9 @@ class ListTransactionsTest(BitcoinTestFramework):
self.test_op_return()
self.test_from_me_status_change()
for index, _ in enumerate(self.nodes):
self.stop_node(index, expected_stderr=WALLETRBF_DEPRECATION_WARNING)
def run_rbf_opt_in_test(self):
"""Test the opt-in-rbf flag for sent and received transactions."""