wallet: mark -walletrbf startup option as deprecated
What changed, and why it matters
This commit simply marks an old wallet startup option called -walletrbf as deprecated. Since a recent release already makes all transactions replaceable by default, the option is now redundant. The change adds a warning when the option is used and updates tests to expect that warning. There is no security vulnerability here.
No security action needed. Users relying on -walletrbf should plan to remove it before the next release, as it will be fully removed.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deprecates the -walletrbf wallet startup option. It updates the help string to include (DEPRECATED), hardcodes m_signal_rbf to DEFAULT_WALLET_RBF unless -walletrbf is explicitly set, and emits a deprecation warning in that case. Functional tests are updated to expect the warning on node restart. No behavior change for users who do not set -walletrbf.
Changed components
src/wallet/init.cppsrc/wallet/wallet.cpptest/functional/wallet_bumpfee.pytest/functional/wallet_backwards_compatibility.pytest/functional/wallet_listtransactions.pytest/functional/test_framework/wallet_util.pyInspect captured patch +20 / −9
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index ccd82e7a..d21da2a5 100644
--- a/src/wallet/init.cpp
+++ b/src/wallet/init.cpp
@@ -74,7 +74,7 @@ void WalletInit::AddWalletOptions(ArgsManager& argsman) const
#if HAVE_SYSTEM
argsman.AddArg("-walletnotify=<cmd>", "Execute command when a wallet transaction changes. %s in cmd is replaced by TxID, %w is replaced by wallet name, %b is replaced by the hash of the block including the transaction (set to 'unconfirmed' if the transaction is not included) and %h is replaced by the block height (-1 if not included). %w is not currently implemented on windows. On systems where %w is supported, it should NOT be quoted because this would break shell escaping used to invoke the command.", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
#endif
- argsman.AddArg("-walletrbf", strprintf("Send transactions with full-RBF opt-in enabled (RPC only, default: %u)", DEFAULT_WALLET_RBF), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
+ argsman.AddArg("-walletrbf", strprintf("(DEPRECATED) Send transactions with full-RBF opt-in enabled (RPC only, default: %u)", DEFAULT_WALLET_RBF), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET);
argsman.AddArg("-unsafesqlitesync", "Set SQLite synchronous=OFF to disable waiting for the database to sync to disk. This is unsafe and can cause data loss and corruption. This option is only used by tests to improve their performance (default: false)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::WALLET_DEBUG_TEST);
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 7cfe6102..ea261bd2 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3102,7 +3102,11 @@ bool CWallet::LoadWalletArgs(std::shared_ptr<CWallet> wallet, const WalletContex
wallet->m_confirm_target = args.GetIntArg("-txconfirmtarget", DEFAULT_TX_CONFIRM_TARGET);
wallet->m_spend_zero_conf_change = args.GetBoolArg("-spendzeroconfchange", DEFAULT_SPEND_ZEROCONF_CHANGE);
- wallet->m_signal_rbf = args.GetBoolArg("-walletrbf", DEFAULT_WALLET_RBF);
+ wallet->m_signal_rbf = DEFAULT_WALLET_RBF;
+ if (args.IsArgSet("-walletrbf")) {
+ warnings.push_back(_("-walletrbf is deprecated and will be fully removed in the next release."));
+ wallet->m_signal_rbf = args.GetBoolArg("-walletrbf").value();
+ }
wallet->m_keypool_size = std::max(args.GetIntArg("-keypool", DEFAULT_KEYPOOL_SIZE), int64_t{1});
wallet->m_notify_tx_changed_script = args.GetArg("-walletnotify", "");
diff --git a/test/functional/test_framework/wallet_util.py b/test/functional/test_framework/wallet_util.py
index 12251530..18095a3b 100755
--- a/test/functional/test_framework/wallet_util.py
+++ b/test/functional/test_framework/wallet_util.py
@@ -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',
diff --git a/test/functional/wallet_backwards_compatibility.py b/test/functional/wallet_backwards_compatibility.py
index f00f2958..b2a74893 100755
--- a/test/functional/wallet_backwards_compatibility.py
+++ b/test/functional/wallet_backwards_compatibility.py
@@ -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)
diff --git a/test/functional/wallet_bumpfee.py b/test/functional/wallet_bumpfee.py
index 961f1a14..992f63ad 100755
--- a/test/functional/wallet_bumpfee.py
+++ b/test/functional/wallet_bumpfee.py
@@ -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()
diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py
index 93e8a45b..d2bdd9b4 100755
--- a/test/functional/wallet_listtransactions.py
+++ b/test/functional/wallet_listtransactions.py
@@ -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."""
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.