28 std::vector<CInputCoin> vCoins;
32 for (
auto& input : tx.
vin) {
33 const auto mi = pWallet->
mapWallet.find(input.prevout.hash);
34 assert(mi != pWallet->
mapWallet.end() && input.prevout.n < mi->second.tx->vout.size());
35 vCoins.emplace_back(
CInputCoin(&(mi->second), input.prevout.n));
47 vErrors.push_back(
"Transaction has descendants in the wallet");
55 if (it_mp !=
mempool.
mapTx.end() && it_mp->GetCountWithDescendants() > 1) {
56 vErrors.push_back(
"Transaction has descendants in the mempool");
63 vErrors.push_back(
"Transaction has been mined, or is conflicted with a mined transaction");
80 vErrors.push_back(
"Invalid or non-wallet transaction id");
92 vErrors.push_back(
"Transaction is not BIP 125 replaceable");
97 if (wtx.
mapValue.count(
"replaced_by_txid")) {
106 vErrors.push_back(
"Transaction contains inputs that don't belong to this wallet");
114 for (
size_t i = 0; i < wtx.
tx->vout.size(); ++i) {
117 vErrors.push_back(
"Transaction has multiple change outputs");
125 vErrors.push_back(
"Transaction does not have a change output");
133 if (maxNewTxSize < 0) {
134 vErrors.push_back(
"Transaction contains inputs that cannot be signed");
146 CFeeRate walletIncrementalRelayFee =
CFeeRate(WALLET_INCREMENTAL_RELAY_FEE);
153 if (totalFee < minTotalFee) {
154 vErrors.push_back(
strprintf(
"Insufficient totalFee, must be at least %s (oldFee %s + incrementalFee %s)",
160 if (totalFee < requiredFee) {
161 vErrors.push_back(
strprintf(
"Insufficient totalFee (cannot be less than required fee %s)",
167 nNewFeeRate =
CFeeRate(totalFee, maxNewTxSize);
185 vErrors.push_back(
strprintf(
"Specified or calculated fee %s is too high (cannot be higher than maxTxFee %s)",
209 if (poutput->
nValue < nDelta) {
210 vErrors.push_back(
"Change output is too small to bump the fee");
216 poutput->
nValue -= nDelta;
225 for (
auto& input :
mtx.
vin) {
226 if (input.nSequence < 0xfffffffe) input.nSequence = 0xfffffffe;
245 vErrors.push_back(
"Invalid or non-wallet transaction id");
256 CWalletTx wtxBumped(pWallet, MakeTransactionRef(std::move(
mtx)));
285 vErrors.push_back(
"Error: Created new bumpfee transaction but could not mark the original transaction as replaced.");
int64_t GetVirtualTransactionSize(int64_t nWeight, int64_t nSigOpCost)
Compute the virtual transaction size (weight reinterpreted as bytes).
CAmount GetFeePerK() const
Return the fee in liu for a size of 1000 bytes.
CFeeRate GetMinFee(size_t sizelimit) const
The minimum fee to get into the mempool, which may itself not be enough for larger-sized transactions...
bool SignTransaction(CMutableTransaction &tx)
int GetDepthInMainChain(const CBlockIndex *&pindexRet) const
Return depth of transaction in blockchain: <0 : conflicts with a transaction this deep in the blockch...
bool IsAllFromMe(const CTransaction &tx, const isminefilter &filter) const
Returns whether all of the inputs match the filter.
BumpFeeResult currentResult
char fFromMe
From me flag is set to 1 for transactions that were created by the wallet on this fabcoin node...
int64_t CalculateMaximumSignedTxSize(const CTransaction &tx, const CWallet *pWallet)
CCriticalSection cs_wallet
const uint256 & GetHash() const
CAmount maxTxFee
Absolute maximum transaction fee (in liu) used by wallet and mempool (rejects high fee in sendrawtran...
std::string strFromAccount
bool IsChange(const CTxOut &txout) const
bool DummySignTx(CMutableTransaction &txNew, const ContainerType &coins) const
std::vector< std::string > vErrors
std::hash for asio::adress
assert(len-trim+(2 *lenIndices)<=WIDTH)
bool MarkReplaced(const uint256 &originalHash, const uint256 &newHash)
Mark a transaction as replaced by another transaction (e.g., BIP 125).
CAmount GetDebit(const isminefilter &filter) const
filter decides which addresses will count towards the debit
const std::vector< CTxIn > vin
bool HasWalletSpend(const uint256 &txid) const
Check if a given transaction has any of its outputs spent by another transaction in the wallet...
mapValue_t mapValue
Key/value map with information about the transaction.
std::string ToString() const
static CAmount GetRequiredFee(unsigned int nTxBytes)
Return the minimum required fee taking into account the floating relay fee and user set minimum trans...
indexed_transaction_set mapTx
int64_t CAmount
Amount in lius (Can be negative)
#define AssertLockHeld(cs)
CBlockPolicyEstimator feeEstimator
bool signTransaction(CWallet *pWallet)
bool signalRbf
Signal BIP-125 replace by fee.
An output of a transaction.
std::vector< CTxOut > vout
unsigned int fTimeReceivedIsTxTime
std::string FormatMoney(const CAmount &n)
Money parsing/formatting utilities.
CAmount GetDustThreshold(const CTxOut &txout, const CFeeRate &dustRelayFeeIn)
A transaction with a bunch of additional info that only the owner cares about.
std::string GetRejectReason() const
#define LogPrint(category,...)
CAmount GetFee(size_t nBytes) const
Return the fee in liu for the given size in bytes.
Capture information about block/transaction validation.
static CAmount GetMinimumFee(unsigned int nTxBytes, const CCoinControl &coin_control, const CTxMemPool &pool, const CBlockPolicyEstimator &estimator, FeeCalculation *feeCalc)
Estimate the minimum fee considering user set parameters and the required fee.
std::string FormatStateMessage(const CValidationState &state)
Convert CValidationState to a human-readable message for logging.
A key allocated from the key pool.
std::string GetArg(const std::string &strArg, const std::string &strDefault)
Return string argument or default value.
bool SignalsOptInRBF(const CTransaction &tx)
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Fee rate in liu per kilobyte: CAmount / kB.
std::unique_ptr< CConnman > g_connman
std::map< uint256, CWalletTx > mapWallet
A mutable version of CTransaction.
The basic transaction that is broadcasted on the network and contained in blocks. ...
CFeeRate incrementalRelayFee
CFeeBumper(const CWallet *pWalletIn, const uint256 txidIn, const CCoinControl &coin_control, CAmount totalFee)
bool preconditionChecks(const CWallet *pWallet, const CWalletTx &wtx)
bool commit(CWallet *pWalletNonConst)
std::vector< std::pair< std::string, std::string > > vOrderForm
bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, CConnman *connman, CValidationState &state)
Call after CreateTransaction unless you want to abort.