Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/Features/Blockcore.Features.MemoryPool/MempoolOrphans.cs
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,17 @@ public bool ProcessesOrphansMissingInputs(INetworkPeer from, Transaction tx)
// from. pfrom->AskFor(_inv);
}

bool ret = this.AddOrphanTx(from.PeerVersion.Nonce, tx);
bool ret = false;
if (from.PeerVersion != null)
{
ret = this.AddOrphanTx(from.PeerVersion.Nonce, tx);

// DoS prevention: do not allow mapOrphanTransactions to grow unbounded
int nMaxOrphanTx = this.mempoolSettings.MaxOrphanTx;
int nEvicted = this.LimitOrphanTxSize(nMaxOrphanTx);
if (nEvicted > 0)
this.logger.LogDebug("mapOrphan overflow, removed {0} tx", nEvicted);
// DoS prevention: do not allow mapOrphanTransactions to grow unbounded
int nMaxOrphanTx = this.mempoolSettings.MaxOrphanTx;
int nEvicted = this.LimitOrphanTxSize(nMaxOrphanTx);
if (nEvicted > 0)
this.logger.LogDebug("mapOrphan overflow, removed {0} tx", nEvicted);
}

return ret;
}
Expand Down