Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,548 Lines • ▼ Show 20 Lines | else if (strCommand == NetMsgType::TX) { | ||||
bool fMissingInputs = false; | bool fMissingInputs = false; | ||||
CValidationState state; | CValidationState state; | ||||
const TxId txid(inv.hash); | const TxId txid(inv.hash); | ||||
pfrom->setAskFor.erase(txid); | pfrom->setAskFor.erase(txid); | ||||
mapAlreadyAskedFor.erase(txid); | mapAlreadyAskedFor.erase(txid); | ||||
if (!AlreadyHave(inv) && | if (!AlreadyHave(inv) && | ||||
AcceptToMemoryPool(config, g_mempool, state, ptx, true, | AcceptToMemoryPool(config, g_mempool, state, ptx, &fMissingInputs, | ||||
&fMissingInputs)) { | false /* bypass_limits */, | ||||
Amount::zero() /* nAbsurdFee */)) { | |||||
g_mempool.check(pcoinsTip.get()); | g_mempool.check(pcoinsTip.get()); | ||||
RelayTransaction(tx, connman); | RelayTransaction(tx, connman); | ||||
for (size_t i = 0; i < tx.vout.size(); i++) { | for (size_t i = 0; i < tx.vout.size(); i++) { | ||||
vWorkQueue.emplace_back(txid, i); | vWorkQueue.emplace_back(txid, i); | ||||
} | } | ||||
pfrom->nLastTXTime = GetTime(); | pfrom->nLastTXTime = GetTime(); | ||||
Show All 28 Lines | else if (strCommand == NetMsgType::TX) { | ||||
auto it = rejectCountPerNode.find(fromPeer); | auto it = rejectCountPerNode.find(fromPeer); | ||||
if (it != rejectCountPerNode.end() && | if (it != rejectCountPerNode.end() && | ||||
it->second > MAX_NON_STANDARD_ORPHAN_PER_NODE) { | it->second > MAX_NON_STANDARD_ORPHAN_PER_NODE) { | ||||
continue; | continue; | ||||
} | } | ||||
if (AcceptToMemoryPool(config, g_mempool, stateDummy, | if (AcceptToMemoryPool(config, g_mempool, stateDummy, | ||||
porphanTx, true, &fMissingInputs2)) { | porphanTx, &fMissingInputs2, | ||||
false /* bypass_limits */, | |||||
Amount::zero() /* nAbsurdFee */)) { | |||||
LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", | LogPrint(BCLog::MEMPOOL, " accepted orphan tx %s\n", | ||||
orphanId.ToString()); | orphanId.ToString()); | ||||
RelayTransaction(orphanTx, connman); | RelayTransaction(orphanTx, connman); | ||||
for (size_t i = 0; i < orphanTx.vout.size(); i++) { | for (size_t i = 0; i < orphanTx.vout.size(); i++) { | ||||
vWorkQueue.emplace_back(orphanId, i); | vWorkQueue.emplace_back(orphanId, i); | ||||
} | } | ||||
vEraseQueue.push_back(orphanId); | vEraseQueue.push_back(orphanId); | ||||
} else if (!fMissingInputs2) { | } else if (!fMissingInputs2) { | ||||
▲ Show 20 Lines • Show All 1,836 Lines • Show Last 20 Lines |