From 26fd16cb523abddfc2ee38f7b1766ddef20d9434 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 31 Aug 2022 11:09:18 -0700 Subject: [PATCH] Avoid relaying expired transactions which causes other nodes to ban us --- src/wallet/wallet.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 8c6e82586..1db729e2f 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3121,6 +3121,13 @@ std::vector CWallet::ResendWalletTransactionsBefore(int64_t nTime) if (wtx.nTimeReceived > nTime) continue; + // Do not relay expired transactions, to avoid other nodes banning us + if (wtx.nExpiryHeight > 0 && wtx.nExpiryHeight < chainActive.LastTip->GetHeight()) { + fprintf(stderr,"%s: ignoring expired tx %s\n", wtx.GetHash().ToString().c_str() ); + // TODO: should we call EraseFromWallet(wtx) right here? + continue; + } + if ( (wtx.nLockTime >= LOCKTIME_THRESHOLD && wtx.nLockTime < now-HUSH_MAXMEMPOOLTIME) ) { if(fDebug) {