From 55703fdb95cf6300325341abb04d669e024797c0 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 6 Sep 2022 10:03:47 -0400 Subject: [PATCH] Do not ban nodes which relay expired transactions --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b8e64dc27..4e466ba45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1304,10 +1304,12 @@ bool ContextualCheckTransaction(int32_t slowflag,const CBlock *block, CBlockInde // Check that all transactions are unexpired if (IsExpiredTx(tx, nHeight)) { // Don't increase banscore if the transaction only just expired - int expiredDosLevel = IsExpiredTx(tx, nHeight - 1) ? (dosLevel > 10 ? dosLevel : 10) : 0; + //int expiredDosLevel = IsExpiredTx(tx, nHeight - 1) ? (dosLevel > 10 ? dosLevel : 10) : 0; //string strHex = EncodeHexTx(tx); - //fprintf(stderr, "transaction exipred.%s\n",strHex.c_str()); - return state.DoS(expiredDosLevel, error("ContextualCheckTransaction(): transaction %s is expired, expiry block %i vs current block %i\n",tx.GetHash().ToString(),tx.nExpiryHeight,nHeight), REJECT_INVALID, "tx-overwinter-expired"); + //fprintf(stderr, "transaction expired.%s\n",strHex.c_str()); + + // Do not ban nodes which relay expired tx's, it's a bug not an attack + return state.DoS(0, error("ContextualCheckTransaction(): transaction %s is expired, expiry block %i vs current block %i\n",tx.GetHash().ToString(),tx.nExpiryHeight,nHeight), REJECT_INVALID, "tx-overwinter-expired"); } }