Avoid relaying expired transactions which causes other nodes to ban us

This commit is contained in:
Jonathan "Duke" Leto
2022-08-31 11:09:18 -07:00
parent 1748f0f2a3
commit 26fd16cb52

View File

@@ -3121,6 +3121,13 @@ std::vector<uint256> 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) {