diff --git a/src/Features/Blockcore.Features.MemoryPool/MempoolOrphans.cs b/src/Features/Blockcore.Features.MemoryPool/MempoolOrphans.cs index e759558de..b83184514 100644 --- a/src/Features/Blockcore.Features.MemoryPool/MempoolOrphans.cs +++ b/src/Features/Blockcore.Features.MemoryPool/MempoolOrphans.cs @@ -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; }