Closes #3110. Ensure user can see error message about absurdly high fees.

This commit is contained in:
Simon
2018-03-27 10:23:24 -07:00
parent 8ed0346284
commit 8b15afd315
2 changed files with 27 additions and 4 deletions

View File

@@ -1357,10 +1357,13 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
dFreeCount += nSize;
}
if (fRejectAbsurdFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000)
return error("AcceptToMemoryPool: absurdly high fees %s, %d > %d",
hash.ToString(),
nFees, ::minRelayTxFee.GetFee(nSize) * 10000);
if (fRejectAbsurdFee && nFees > ::minRelayTxFee.GetFee(nSize) * 10000) {
string errmsg = strprintf("absurdly high fees %s, %d > %d",
hash.ToString(),
nFees, ::minRelayTxFee.GetFee(nSize) * 10000);
LogPrint("mempool", errmsg.c_str());
return state.Error("AcceptToMemoryPool: " + errmsg);
}
// Check against previous transactions
// This is done last to help prevent CPU exhaustion denial-of-service attacks.