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) {