Skip to content

Commit 4439bf4

Browse files
committed
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.
1 parent 1337c72 commit 4439bf4

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

src/wallet/coincontrol.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class CCoinControl
8989
//! If true, the selection process can add extra unselected inputs from the wallet
9090
//! while requires all selected inputs be used
9191
bool m_allow_other_inputs = true;
92-
//! Includes watch only addresses which are solvable
93-
bool fAllowWatchOnly = false;
9492
//! Override automatic min/max checks on fee, m_feerate must be set if true
9593
bool fOverrideFeeRate = false;
9694
//! Override the wallet's m_pay_tx_fee if set

src/wallet/rpc/spend.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,6 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
10671067
Txid hash{Txid::FromUint256(ParseHashV(request.params[0], "txid"))};
10681068

10691069
CCoinControl coin_control;
1070-
coin_control.fAllowWatchOnly = pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
10711070
// optional parameters
10721071
coin_control.m_signal_bip125_rbf = true;
10731072
std::vector<CTxOut> outputs;

src/wallet/spend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static bool IsSegwit(const Descriptor& desc) {
5454
static bool UseMaxSig(const std::optional<CTxIn>& txin, const CCoinControl* coin_control) {
5555
// Use max sig if watch only inputs were used or if this particular input is an external input
5656
// to ensure a sufficient fee is attained for the requested feerate.
57-
return coin_control && (coin_control->fAllowWatchOnly || (txin && coin_control->IsExternalSelected(txin->prevout)));
57+
return coin_control && txin && coin_control->IsExternalSelected(txin->prevout);
5858
}
5959

6060
/** Get the size of an input (in witness units) once it's signed.
@@ -429,7 +429,7 @@ CoinsResult AvailableCoins(const CWallet& wallet,
429429
// Because CalculateMaximumSignedInputSize infers a solvable descriptor to get the satisfaction size,
430430
// it is safe to assume that this input is solvable if input_bytes is greater than -1.
431431
bool solvable = input_bytes > -1;
432-
bool spendable = ((mine & ISMINE_SPENDABLE) != ISMINE_NO) || (((mine & ISMINE_WATCH_ONLY) != ISMINE_NO) && (coinControl && coinControl->fAllowWatchOnly && solvable));
432+
bool spendable = (mine & ISMINE_SPENDABLE) != ISMINE_NO;
433433

434434
// Filter by spendable outputs only
435435
if (!spendable && params.only_spendable) continue;

0 commit comments

Comments
 (0)