@@ -47,7 +47,8 @@ static feebumper::Result PreconditionChecks(const CWallet& wallet, const CWallet
47
47
48
48
// check that original tx consists entirely of our inputs
49
49
// if not, we can't bump the fee, because the wallet has no way of knowing the value of the other inputs (thus the fee)
50
- if (!wallet.IsAllFromMe (*wtx.tx , ISMINE_SPENDABLE)) {
50
+ isminefilter filter = wallet.GetLegacyScriptPubKeyMan () && wallet.IsWalletFlagSet (WALLET_FLAG_DISABLE_PRIVATE_KEYS) ? ISMINE_WATCH_ONLY : ISMINE_SPENDABLE;
51
+ if (!wallet.IsAllFromMe (*wtx.tx , filter)) {
51
52
errors.push_back (" Transaction contains inputs that don't belong to this wallet" );
52
53
return feebumper::Result::WALLET_ERROR;
53
54
}
@@ -78,7 +79,8 @@ static feebumper::Result CheckFeeRate(const CWallet& wallet, const CWalletTx& wt
78
79
CFeeRate incrementalRelayFee = std::max (wallet.chain ().relayIncrementalFee (), CFeeRate (WALLET_INCREMENTAL_RELAY_FEE));
79
80
80
81
// Given old total fee and transaction size, calculate the old feeRate
81
- CAmount old_fee = wtx.GetDebit (ISMINE_SPENDABLE) - wtx.tx ->GetValueOut ();
82
+ isminefilter filter = wallet.GetLegacyScriptPubKeyMan () && wallet.IsWalletFlagSet (WALLET_FLAG_DISABLE_PRIVATE_KEYS) ? ISMINE_WATCH_ONLY : ISMINE_SPENDABLE;
83
+ CAmount old_fee = wtx.GetDebit (filter) - wtx.tx ->GetValueOut ();
82
84
const int64_t txSize = GetVirtualTransactionSize (*(wtx.tx ));
83
85
CFeeRate nOldFeeRate (old_fee, txSize);
84
86
// Min total fee is old fee + relay fee
@@ -195,7 +197,8 @@ Result CreateTotalBumpTransaction(const CWallet* wallet, const uint256& txid, co
195
197
}
196
198
197
199
// calculate the old fee and fee-rate
198
- old_fee = wtx.GetDebit (ISMINE_SPENDABLE) - wtx.tx ->GetValueOut ();
200
+ isminefilter filter = wallet->GetLegacyScriptPubKeyMan () && wallet->IsWalletFlagSet (WALLET_FLAG_DISABLE_PRIVATE_KEYS) ? ISMINE_WATCH_ONLY : ISMINE_SPENDABLE;
201
+ old_fee = wtx.GetDebit (filter) - wtx.tx ->GetValueOut ();
199
202
CFeeRate nOldFeeRate (old_fee, txSize);
200
203
// The wallet uses a conservative WALLET_INCREMENTAL_RELAY_FEE value to
201
204
// future proof against changes to network wide policy for incremental relay
@@ -308,7 +311,8 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo
308
311
}
309
312
}
310
313
311
- old_fee = wtx.GetDebit (ISMINE_SPENDABLE) - wtx.tx ->GetValueOut ();
314
+ isminefilter filter = wallet.GetLegacyScriptPubKeyMan () && wallet.IsWalletFlagSet (WALLET_FLAG_DISABLE_PRIVATE_KEYS) ? ISMINE_WATCH_ONLY : ISMINE_SPENDABLE;
315
+ old_fee = wtx.GetDebit (filter) - wtx.tx ->GetValueOut ();
312
316
313
317
if (coin_control.m_feerate ) {
314
318
// The user provided a feeRate argument.
0 commit comments