Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,148 Lines • ▼ Show 20 Lines | else if (strCommand == NetMsgType::TX) { | ||||
for (uint256 hash : vEraseQueue) { | for (uint256 hash : vEraseQueue) { | ||||
EraseOrphanTx(hash); | EraseOrphanTx(hash); | ||||
} | } | ||||
} else if (fMissingInputs) { | } else if (fMissingInputs) { | ||||
// It may be the case that the orphans parents have all been | // It may be the case that the orphans parents have all been | ||||
// rejected. | // rejected. | ||||
bool fRejectedParents = false; | bool fRejectedParents = false; | ||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
if (recentRejects->contains(txin.prevout.hash)) { | if (recentRejects->contains(txin.prevout.GetTxId())) { | ||||
fRejectedParents = true; | fRejectedParents = true; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if (!fRejectedParents) { | if (!fRejectedParents) { | ||||
uint32_t nFetchFlags = GetFetchFlags( | uint32_t nFetchFlags = GetFetchFlags( | ||||
pfrom, chainActive.Tip(), chainparams.GetConsensus()); | pfrom, chainActive.Tip(), chainparams.GetConsensus()); | ||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
CInv _inv(MSG_TX | nFetchFlags, txin.prevout.hash); | CInv _inv(MSG_TX | nFetchFlags, txin.prevout.GetTxId()); | ||||
pfrom->AddInventoryKnown(_inv); | pfrom->AddInventoryKnown(_inv); | ||||
if (!AlreadyHave(_inv)) { | if (!AlreadyHave(_inv)) { | ||||
pfrom->AskFor(_inv); | pfrom->AskFor(_inv); | ||||
} | } | ||||
} | } | ||||
AddOrphanTx(ptx, pfrom->GetId()); | AddOrphanTx(ptx, pfrom->GetId()); | ||||
// DoS prevention: do not allow mapOrphanTransactions to grow | // DoS prevention: do not allow mapOrphanTransactions to grow | ||||
▲ Show 20 Lines • Show All 1,662 Lines • Show Last 20 Lines |