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:
1 parent
1337c72198
commit
4439bf4b41
3 files changed
+2
-5
No files matched your search
@@ -89,8 +89,6 @@ public:
|
|||||||
//! If true, the selection process can add extra unselected inputs from the wallet
|
//! If true, the selection process can add extra unselected inputs from the wallet
|
||||||
//! while requires all selected inputs be used
|
//! while requires all selected inputs be used
|
||||||
bool m_allow_other_inputs = true;
|
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
|
//! Override automatic min/max checks on fee, m_feerate must be set if true
|
||||||
bool fOverrideFeeRate = false;
|
bool fOverrideFeeRate = false;
|
||||||
//! Override the wallet's m_pay_tx_fee if set
|
//! Override the wallet's m_pay_tx_fee if set
|
||||||
|
|||||||
@@ -1067,7 +1067,6 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
|
|||||||
Txid hash{Txid::FromUint256(ParseHashV(request.params[0], "txid"))};
|
Txid hash{Txid::FromUint256(ParseHashV(request.params[0], "txid"))};
|
||||||
|
|
||||||
CCoinControl coin_control;
|
CCoinControl coin_control;
|
||||||
coin_control.fAllowWatchOnly = pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
|
|
||||||
// optional parameters
|
// optional parameters
|
||||||
coin_control.m_signal_bip125_rbf = true;
|
coin_control.m_signal_bip125_rbf = true;
|
||||||
std::vector<CTxOut> outputs;
|
std::vector<CTxOut> outputs;
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ static bool IsSegwit(const Descriptor& desc) {
|
|||||||
static bool UseMaxSig(const std::optional<CTxIn>& txin, const CCoinControl* coin_control) {
|
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
|
// 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.
|
// 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.
|
/** 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,
|
// 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.
|
// it is safe to assume that this input is solvable if input_bytes is greater than -1.
|
||||||
bool solvable = input_bytes > -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
|
// Filter by spendable outputs only
|
||||||
if (!spendable && params.only_spendable) continue;
|
if (!spendable && params.only_spendable) continue;
|
||||||
|
|||||||
Reference in new issue
Block a user