Auto merge of #3111 - bitcartel:3110_high_fee_error_reporting, r=bitcartel

Closes #3110.  Ensure user can see error message about absurdly high fees.
This commit is contained in:
Homu
2018-03-27 10:33:52 -07:00
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.