Don't increase banscore if the transaction only just expired.

Author: Jack Grigg <str4d@z.cash>
This commit is contained in:
Daira Hopwood
2018-04-04 01:28:57 +01:00
parent a0ea82301a
commit 473a113241
2 changed files with 17 additions and 2 deletions

View File

@@ -897,7 +897,9 @@ bool ContextualCheckTransaction(const CTransaction& tx, CValidationState &state,
// Check that all transactions are unexpired
if (IsExpiredTx(tx, nHeight)) {
return state.DoS(0, error("ContextualCheckTransaction(): transaction is expired"), REJECT_INVALID, "tx-overwinter-expired");
// Don't increase banscore if the transaction only just expired
int expiredDosLevel = IsExpiredTx(tx, nHeight - 1) ? dosLevel : 0;
return state.DoS(expiredDosLevel, error("ContextualCheckTransaction(): transaction is expired"), REJECT_INVALID, "tx-overwinter-expired");
}
}