From: Luke Dashjr Date: Sat, 3 Mar 2012 18:59:19 +0000 (-0500) Subject: Merge branch '0.4.x' into 0.5.0.x X-Git-Tag: v0.4.0-unstable~129^2~1^2~18^2~10^2~19^2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=7013cc3d9710c0a03f6587c854e4e50c358ea70c Merge branch '0.4.x' into 0.5.0.x --- 7013cc3d9710c0a03f6587c854e4e50c358ea70c diff --cc src/main.cpp index e94c872,652d4c1..7478054 --- a/src/main.cpp +++ b/src/main.cpp @@@ -2224,8 -2223,12 +2264,13 @@@ bool static ProcessMessage(CNode* pfrom { printf("storing orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str()); AddOrphanTx(vMsg); + + // DoS prevention: do not allow mapOrphanTransactions to grow unbounded + int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS); + if (nEvicted > 0) + printf("mapOrphan overflow, removed %d tx\n", nEvicted); } + if (tx.nDoS) pfrom->Misbehaving(tx.nDoS); }