Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,200 Lines • ▼ Show 20 Lines | while (!done && !orphan_work_set.empty()) { | ||||
/*via_compact_block*/ false); | /*via_compact_block*/ false); | ||||
LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s\n", | LogPrint(BCLog::MEMPOOL, " invalid orphan tx %s\n", | ||||
orphanTxId.ToString()); | orphanTxId.ToString()); | ||||
} | } | ||||
// Has inputs but not accepted to mempool | // Has inputs but not accepted to mempool | ||||
// Probably non-standard or insufficient fee | // Probably non-standard or insufficient fee | ||||
LogPrint(BCLog::MEMPOOL, " removed orphan tx %s\n", | LogPrint(BCLog::MEMPOOL, " removed orphan tx %s\n", | ||||
orphanTxId.ToString()); | orphanTxId.ToString()); | ||||
if (!orphan_state.CorruptionPossible()) { | |||||
// Do not use rejection cache for witness | |||||
// transactions or witness-stripped transactions, as | |||||
// they can have been malleated. See | |||||
// https://github.com/bitcoin/bitcoin/issues/8279 | |||||
// for details. | |||||
assert(recentRejects); | assert(recentRejects); | ||||
recentRejects->insert(orphanTxId); | recentRejects->insert(orphanTxId); | ||||
} | |||||
EraseOrphanTx(orphanTxId); | EraseOrphanTx(orphanTxId); | ||||
done = true; | done = true; | ||||
} | } | ||||
g_mempool.check(pcoinsTip.get()); | g_mempool.check(pcoinsTip.get()); | ||||
} | } | ||||
} | } | ||||
static bool ProcessMessage(const Config &config, CNode *pfrom, | static bool ProcessMessage(const Config &config, CNode *pfrom, | ||||
▲ Show 20 Lines • Show All 816 Lines • ▼ Show 20 Lines | if (strCommand == NetMsgType::TX) { | ||||
LogPrint(BCLog::MEMPOOL, | LogPrint(BCLog::MEMPOOL, | ||||
"not keeping orphan with rejected parents %s\n", | "not keeping orphan with rejected parents %s\n", | ||||
tx.GetId().ToString()); | tx.GetId().ToString()); | ||||
// We will continue to reject this tx since it has rejected | // We will continue to reject this tx since it has rejected | ||||
// parents so avoid re-requesting it from other peers. | // parents so avoid re-requesting it from other peers. | ||||
recentRejects->insert(tx.GetId()); | recentRejects->insert(tx.GetId()); | ||||
} | } | ||||
} else { | } else { | ||||
if (!state.CorruptionPossible()) { | |||||
// Do not use rejection cache for witness transactions or | |||||
// witness-stripped transactions, as they can have been | |||||
// malleated. See https://github.com/bitcoin/bitcoin/issues/8279 | |||||
// for details. | |||||
assert(recentRejects); | assert(recentRejects); | ||||
recentRejects->insert(tx.GetId()); | recentRejects->insert(tx.GetId()); | ||||
if (RecursiveDynamicUsage(*ptx) < 100000) { | if (RecursiveDynamicUsage(*ptx) < 100000) { | ||||
AddToCompactExtraTransactions(ptx); | AddToCompactExtraTransactions(ptx); | ||||
} | } | ||||
} | |||||
if (pfrom->HasPermission(PF_FORCERELAY)) { | if (pfrom->HasPermission(PF_FORCERELAY)) { | ||||
// Always relay transactions received from whitelisted peers, | // Always relay transactions received from whitelisted peers, | ||||
// even if they were already in the mempool or rejected from it | // even if they were already in the mempool or rejected from it | ||||
// due to policy, allowing the node to function as a gateway for | // due to policy, allowing the node to function as a gateway for | ||||
// nodes hidden behind it. | // nodes hidden behind it. | ||||
// | // | ||||
// Never relay transactions that might result in being | // Never relay transactions that might result in being | ||||
▲ Show 20 Lines • Show All 2,023 Lines • Show Last 20 Lines |