Skip to content

Commit

Permalink
Merge #11597: [trivial] Fix error messages in CFeeBumper
Browse files Browse the repository at this point in the history
a02c5e4 [trivial] Fix error messages in CFeeBumper (Karl-Johan Alm)

Pull request description:

  …pool fee rate.

Tree-SHA512: c179853b2a19fdb767e46b29068f3e1ce6db75fda4356746472c93c5b51f0aa495a988c4da1e14762993d57229e525594a2e9d0e089f931c1c67fec7807bda54
  • Loading branch information
MarcoFalke committed Nov 7, 2017
2 parents ef8a634 + a02c5e4 commit 6f01dcf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/wallet/feebumper.cpp
Expand Up @@ -196,7 +196,13 @@ CFeeBumper::CFeeBumper(const CWallet *pWallet, const uint256 txidIn, const CCoin
// moment earlier. In this case, we report an error to the user, who may use totalFee to make an adjustment.
CFeeRate minMempoolFeeRate = mempool.GetMinFee(gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000);
if (nNewFeeRate.GetFeePerK() < minMempoolFeeRate.GetFeePerK()) {
vErrors.push_back(strprintf("New fee rate (%s) is less than the minimum fee rate (%s) to get into the mempool. totalFee value should to be at least %s or settxfee value should be at least %s to add transaction.", FormatMoney(nNewFeeRate.GetFeePerK()), FormatMoney(minMempoolFeeRate.GetFeePerK()), FormatMoney(minMempoolFeeRate.GetFee(maxNewTxSize)), FormatMoney(minMempoolFeeRate.GetFeePerK())));
vErrors.push_back(strprintf(
"New fee rate (%s) is lower than the minimum fee rate (%s) to get into the mempool -- "
"the totalFee value should be at least %s or the settxfee value should be at least %s to add transaction",
FormatMoney(nNewFeeRate.GetFeePerK()),
FormatMoney(minMempoolFeeRate.GetFeePerK()),
FormatMoney(minMempoolFeeRate.GetFee(maxNewTxSize)),
FormatMoney(minMempoolFeeRate.GetFeePerK())));
currentResult = BumpFeeResult::WALLET_ERROR;
return;
}
Expand Down Expand Up @@ -267,15 +273,15 @@ bool CFeeBumper::commit(CWallet *pWallet)
CValidationState state;
if (!pWallet->CommitTransaction(wtxBumped, reservekey, g_connman.get(), state)) {
// NOTE: CommitTransaction never returns false, so this should never happen.
vErrors.push_back(strprintf("Error: The transaction was rejected! Reason given: %s", state.GetRejectReason()));
vErrors.push_back(strprintf("The transaction was rejected: %s", state.GetRejectReason()));
return false;
}

bumpedTxid = wtxBumped.GetHash();
if (state.IsInvalid()) {
// This can happen if the mempool rejected the transaction. Report
// what happened in the "errors" response.
vErrors.push_back(strprintf("Error: The transaction was rejected: %s", FormatStateMessage(state)));
vErrors.push_back(strprintf("The transaction was rejected: %s", FormatStateMessage(state)));
}

// mark the original tx as bumped
Expand All @@ -284,7 +290,7 @@ bool CFeeBumper::commit(CWallet *pWallet)
// along with an exception. It would be good to return information about
// wtxBumped to the caller even if marking the original transaction
// replaced does not succeed for some reason.
vErrors.push_back("Error: Created new bumpfee transaction but could not mark the original transaction as replaced.");
vErrors.push_back("Created new bumpfee transaction but could not mark the original transaction as replaced");
}
return true;
}
Expand Down

0 comments on commit 6f01dcf

Please sign in to comment.