Skip to content

Commit

Permalink
[validation] ignore absurdfee arg in ATMP
Browse files Browse the repository at this point in the history
  • Loading branch information
glozow committed Aug 15, 2020
1 parent c763343 commit 2409462
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/rpc/rawtransaction.cpp
Expand Up @@ -932,9 +932,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_0.pushKV("fee", fee);
result.push_back(std::move(result_0));
Expand Down
3 changes: 1 addition & 2 deletions src/validation.cpp
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

0 comments on commit 2409462

Please sign in to comment.