mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-04 06:12:07 +01:00
Store fewer orphan tx by default, add -maxorphantx option
There is no reason to store thousands of orphan transactions; normally an orphan's parents will either be broadcast or mined reasonably quickly. This pull drops the maximum number of orphans from 10,000 down to 100, and adds a command-line option (-maxorphantx) that is just like -maxorphanblocks to override the default.
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
af252082ef
commit
ea3c1b0806
@@ -3819,7 +3819,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
AddOrphanTx(tx, pfrom->GetId());
|
||||
|
||||
// DoS prevention: do not allow mapOrphanTransactions to grow unbounded
|
||||
unsigned int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS);
|
||||
unsigned int nMaxOrphanTx = (unsigned int)std::max((int64_t)0, GetArg("-maxorphantx", DEFAULT_MAX_ORPHAN_TRANSACTIONS));
|
||||
unsigned int nEvicted = LimitOrphanTxSize(nMaxOrphanTx);
|
||||
if (nEvicted > 0)
|
||||
LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user