Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 712 Lines • ▼ Show 20 Lines | bool AddOrphanTx(const CTransactionRef &tx, NodeId peer) | ||||
} | } | ||||
// Ignore big transactions, to avoid a send-big-orphans memory exhaustion | // Ignore big transactions, to avoid a send-big-orphans memory exhaustion | ||||
// attack. If a peer has a legitimate large transaction with a missing | // attack. If a peer has a legitimate large transaction with a missing | ||||
// parent then we assume it will rebroadcast it later, after the parent | // parent then we assume it will rebroadcast it later, after the parent | ||||
// transaction(s) have been mined or received. | // transaction(s) have been mined or received. | ||||
// 100 orphans, each of which is at most 99,999 bytes big is at most 10 | // 100 orphans, each of which is at most 99,999 bytes big is at most 10 | ||||
// megabytes of orphans and somewhat more byprev index (in the worst case): | // megabytes of orphans and somewhat more byprev index (in the worst case): | ||||
unsigned int sz = GetTransactionSize(*tx); | unsigned int sz = tx->GetTotalSize(); | ||||
if (sz >= MAX_STANDARD_TX_SIZE) { | if (sz >= MAX_STANDARD_TX_SIZE) { | ||||
LogPrint(BCLog::MEMPOOL, | LogPrint(BCLog::MEMPOOL, | ||||
"ignoring large orphan tx (size: %u, hash: %s)\n", sz, | "ignoring large orphan tx (size: %u, hash: %s)\n", sz, | ||||
txid.ToString()); | txid.ToString()); | ||||
return false; | return false; | ||||
} | } | ||||
auto ret = mapOrphanTransactions.emplace( | auto ret = mapOrphanTransactions.emplace( | ||||
▲ Show 20 Lines • Show All 3,109 Lines • Show Last 20 Lines |