wallet: refactor to read -walletrbf only once instead of twice
What changed, and why it matters
This is a tiny code cleanup in Bitcoin Core's wallet setup. It changes how the deprecated '-walletrbf' setting is read so the value is fetched once and reused, rather than checked for existence and then fetched separately. There is no security issue here.
No action needed. This is a benign refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch refactors CWallet::LoadWalletArgs to call args.GetBoolArg(“-walletrbf”) a single time using an optional
Changed components
src/wallet/wallet.cppCWallet::LoadWalletArgsInspect captured patch +2 / −2
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 77d0a395..0fbe8cc0 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -3104,9 +3104,9 @@ 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 = DEFAULT_WALLET_RBF;
- if (args.IsArgSet("-walletrbf")) {
+ if (auto value{args.GetBoolArg("-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_signal_rbf = *value;
}
wallet->m_keypool_size = std::max(args.GetIntArg("-keypool", DEFAULT_KEYPOOL_SIZE), int64_t{1});
Why this scored 15/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.