feebumper: Use PreconditionChecks to determine bump eligibility
This commit is contained in:
parent
718f05cab5
commit
faca18dcf4
2 changed files with 7 additions and 3 deletions
|
@ -89,11 +89,15 @@ static feebumper::Result PreconditionChecks(const CWallet* wallet, const CWallet
|
||||||
|
|
||||||
namespace feebumper {
|
namespace feebumper {
|
||||||
|
|
||||||
bool TransactionCanBeBumped(CWallet* wallet, const uint256& txid)
|
bool TransactionCanBeBumped(const CWallet* wallet, const uint256& txid)
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, wallet->cs_wallet);
|
LOCK2(cs_main, wallet->cs_wallet);
|
||||||
const CWalletTx* wtx = wallet->GetWalletTx(txid);
|
const CWalletTx* wtx = wallet->GetWalletTx(txid);
|
||||||
return wtx && SignalsOptInRBF(*wtx->tx) && !wtx->mapValue.count("replaced_by_txid");
|
if (wtx == nullptr) return false;
|
||||||
|
|
||||||
|
std::vector<std::string> errors_dummy;
|
||||||
|
feebumper::Result res = PreconditionChecks(wallet, *wtx, errors_dummy);
|
||||||
|
return res == feebumper::Result::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
Result CreateTransaction(const CWallet* wallet, const uint256& txid, const CCoinControl& coin_control, CAmount total_fee, std::vector<std::string>& errors,
|
Result CreateTransaction(const CWallet* wallet, const uint256& txid, const CCoinControl& coin_control, CAmount total_fee, std::vector<std::string>& errors,
|
||||||
|
|
|
@ -26,7 +26,7 @@ enum class Result
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Return whether transaction can be bumped.
|
//! Return whether transaction can be bumped.
|
||||||
bool TransactionCanBeBumped(CWallet* wallet, const uint256& txid);
|
bool TransactionCanBeBumped(const CWallet* wallet, const uint256& txid);
|
||||||
|
|
||||||
//! Create bumpfee transaction.
|
//! Create bumpfee transaction.
|
||||||
Result CreateTransaction(const CWallet* wallet,
|
Result CreateTransaction(const CWallet* wallet,
|
||||||
|
|
Loading…
Reference in a new issue