diff --git a/src/wallet/feebumper.cpp b/src/wallet/feebumper.cpp index dc575256a3..db0fb84363 100644 --- a/src/wallet/feebumper.cpp +++ b/src/wallet/feebumper.cpp @@ -78,21 +78,21 @@ static feebumper::Result CheckFeeRate(const CWallet& wallet, const CWalletTx& wt FormatMoney(minMempoolFeeRate.GetFeePerK()))); return feebumper::Result::WALLET_ERROR; } - - CAmount new_total_fee = newFeerate.GetFee(maxTxSize); + const CAsset& feeAsset = wtx.tx->GetFeeAsset(::policyAsset); + CAmount new_total_fee = newFeerate.GetFee(maxTxSize, feeAsset); CFeeRate incrementalRelayFee = std::max(wallet.chain().relayIncrementalFee(), CFeeRate(WALLET_INCREMENTAL_RELAY_FEE)); // Given old total fee and transaction size, calculate the old feeRate isminefilter filter = wallet.GetLegacyScriptPubKeyMan() && wallet.IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS) ? ISMINE_WATCH_ONLY : ISMINE_SPENDABLE; - CAmount old_fee = CachedTxGetDebit(wallet, wtx, filter)[::policyAsset] - wtx.tx->GetValueOutMap()[::policyAsset]; + CAmount old_fee = CachedTxGetDebit(wallet, wtx, filter)[feeAsset] - wtx.tx->GetValueOutMap()[feeAsset]; if (g_con_elementsmode) { - old_fee = GetFeeMap(*wtx.tx)[::policyAsset]; + old_fee = GetFeeMap(*wtx.tx)[feeAsset]; } const int64_t txSize = GetVirtualTransactionSize(*(wtx.tx)); CFeeRate nOldFeeRate(old_fee, txSize); // Min total fee is old fee + relay fee - CAmount minTotalFee = nOldFeeRate.GetFee(maxTxSize) + incrementalRelayFee.GetFee(maxTxSize); + CAmount minTotalFee = nOldFeeRate.GetFee(maxTxSize, feeAsset) + incrementalRelayFee.GetFee(maxTxSize, feeAsset); if (new_total_fee < minTotalFee) { errors.push_back(strprintf(Untranslated("Insufficient total fee %s, must be at least %s (oldFee %s + incrementalFee %s)"),