wallet, spend: Remove fWatchOnly from CCoinControl

Descriptor wallets do not have a concept of watchonly within a wallet,
so remove the watchonly option from coin control.
This commit is contained in:
Ava Chow
2025-05-15 15:51:34 -07:00
parent 1337c72198
commit 4439bf4b41
3 changed files with 2 additions and 5 deletions

View File

@@ -89,8 +89,6 @@ public:
//! If true, the selection process can add extra unselected inputs from the wallet
//! while requires all selected inputs be used
bool m_allow_other_inputs = true;
//! Includes watch only addresses which are solvable
bool fAllowWatchOnly = false;
//! Override automatic min/max checks on fee, m_feerate must be set if true
bool fOverrideFeeRate = false;
//! Override the wallet's m_pay_tx_fee if set

View File

@@ -1067,7 +1067,6 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
Txid hash{Txid::FromUint256(ParseHashV(request.params[0], "txid"))};
CCoinControl coin_control;
coin_control.fAllowWatchOnly = pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
// optional parameters
coin_control.m_signal_bip125_rbf = true;
std::vector<CTxOut> outputs;

View File

@@ -54,7 +54,7 @@ static bool IsSegwit(const Descriptor& desc) {
static bool UseMaxSig(const std::optional<CTxIn>& txin, const CCoinControl* coin_control) {
// Use max sig if watch only inputs were used or if this particular input is an external input
// to ensure a sufficient fee is attained for the requested feerate.
return coin_control && (coin_control->fAllowWatchOnly || (txin && coin_control->IsExternalSelected(txin->prevout)));
return coin_control && txin && coin_control->IsExternalSelected(txin->prevout);
}
/** Get the size of an input (in witness units) once it's signed.
@@ -429,7 +429,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
// Because CalculateMaximumSignedInputSize infers a solvable descriptor to get the satisfaction size,
// it is safe to assume that this input is solvable if input_bytes is greater than -1.
bool solvable = input_bytes > -1;
bool spendable = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (((mine & ISMINE_WATCH_ONLY) != ISMINE_NO) && (coinControl && coinControl->fAllowWatchOnly && solvable));
bool spendable = (mine & ISMINE_SPENDABLE) != ISMINE_NO;
// Filter by spendable outputs only
if (!spendable && params.only_spendable) continue;