Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validation/util: add GetTransactionFee #20025

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[validation] ignore absurdfee arg in ATMP
  • Loading branch information
glozow committed Sep 24, 2020
commit b635b5d51d1b518000cdc73620dbcd439104abf8
6 changes: 3 additions & 3 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,9 +936,9 @@ static UniValue testmempoolaccept(const JSONRPCRequest& request)
nullptr /* plTxnReplaced */, false /* bypass_limits */, max_raw_tx_fee, /* test_accept */ true, &fee);
}

// TODO: move ATMP absurdFee check to here
if (state.GetRejectReason().find("absurdly-high-fee") != std::string::npos) {
result_0.pushKV("allowed", test_accept_res);
// Check that fee does not exceed maxfee
if (test_accept_res && max_raw_tx_fee && fee > max_raw_tx_fee) {
result_0.pushKV("allowed", false);
result_0.pushKV("reject-reason", "max-fee-exceeded");
result.push_back(std::move(result_0));
return result;
Expand Down
3 changes: 1 addition & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,7 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
if (!bypass_limits && !CheckFeeRate(nSize, nModifiedFees, state)) return false;

if (nAbsurdFee && nFees > nAbsurdFee)
return state.Invalid(TxValidationResult::TX_NOT_STANDARD,
"absurdly-high-fee", strprintf("%d > %d", nFees, nAbsurdFee));
LogPrintf("Ignoring Absurdfee\n");

const CTxMemPool::setEntries setIterConflicting = m_pool.GetIterSet(setConflicts);
// Calculate in-mempool ancestors, up to a limit.
Expand Down