Skip to content

Commit faca18d

Browse files
author
MarcoFalke
committed
feebumper: Use PreconditionChecks to determine bump eligibility
1 parent 718f05c commit faca18d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/wallet/feebumper.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ static feebumper::Result PreconditionChecks(const CWallet* wallet, const CWallet
8989

9090
namespace feebumper {
9191

92-
bool TransactionCanBeBumped(CWallet* wallet, const uint256& txid)
92+
bool TransactionCanBeBumped(const CWallet* wallet, const uint256& txid)
9393
{
9494
LOCK2(cs_main, wallet->cs_wallet);
9595
const CWalletTx* wtx = wallet->GetWalletTx(txid);
96-
return wtx && SignalsOptInRBF(*wtx->tx) && !wtx->mapValue.count("replaced_by_txid");
96+
if (wtx == nullptr) return false;
97+
98+
std::vector<std::string> errors_dummy;
99+
feebumper::Result res = PreconditionChecks(wallet, *wtx, errors_dummy);
100+
return res == feebumper::Result::OK;
97101
}
98102

99103
Result CreateTransaction(const CWallet* wallet, const uint256& txid, const CCoinControl& coin_control, CAmount total_fee, std::vector<std::string>& errors,

src/wallet/feebumper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum class Result
2626
};
2727

2828
//! Return whether transaction can be bumped.
29-
bool TransactionCanBeBumped(CWallet* wallet, const uint256& txid);
29+
bool TransactionCanBeBumped(const CWallet* wallet, const uint256& txid);
3030

3131
//! Create bumpfee transaction.
3232
Result CreateTransaction(const CWallet* wallet,

0 commit comments

Comments
 (0)