Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 984 Lines • ▼ Show 20 Lines | void PeerLogicValidation::BlockConnected( | ||||
LOCK(g_cs_orphans); | LOCK(g_cs_orphans); | ||||
std::vector<uint256> vOrphanErase; | std::vector<uint256> vOrphanErase; | ||||
for (const CTransactionRef &ptx : pblock->vtx) { | for (const CTransactionRef &ptx : pblock->vtx) { | ||||
const CTransaction &tx = *ptx; | const CTransaction &tx = *ptx; | ||||
// Which orphan pool entries must we evict? | // Which orphan pool entries must we evict? | ||||
for (size_t j = 0; j < tx.vin.size(); j++) { | for (const auto &txin : tx.vin) { | ||||
auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout); | auto itByPrev = mapOrphanTransactionsByPrev.find(txin.prevout); | ||||
if (itByPrev == mapOrphanTransactionsByPrev.end()) { | if (itByPrev == mapOrphanTransactionsByPrev.end()) { | ||||
continue; | continue; | ||||
} | } | ||||
for (auto mi = itByPrev->second.begin(); | for (auto mi = itByPrev->second.begin(); | ||||
mi != itByPrev->second.end(); ++mi) { | mi != itByPrev->second.end(); ++mi) { | ||||
const CTransaction &orphanTx = *(*mi)->second.tx; | const CTransaction &orphanTx = *(*mi)->second.tx; | ||||
const uint256 &orphanHash = orphanTx.GetHash(); | const uint256 &orphanHash = orphanTx.GetHash(); | ||||
▲ Show 20 Lines • Show All 1,183 Lines • ▼ Show 20 Lines | else if (strCommand == NetMsgType::INV) { | ||||
// mode if whitelistrelay is true | // mode if whitelistrelay is true | ||||
if (pfrom->fWhitelisted && | if (pfrom->fWhitelisted && | ||||
gArgs.GetBoolArg("-whitelistrelay", DEFAULT_WHITELISTRELAY)) { | gArgs.GetBoolArg("-whitelistrelay", DEFAULT_WHITELISTRELAY)) { | ||||
fBlocksOnly = false; | fBlocksOnly = false; | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
for (CInv &inv : vInv) { | for (auto &inv : vInv) { | ||||
if (interruptMsgProc) { | if (interruptMsgProc) { | ||||
return true; | return true; | ||||
} | } | ||||
bool fAlreadyHave = AlreadyHave(inv); | bool fAlreadyHave = AlreadyHave(inv); | ||||
LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), | LogPrint(BCLog::NET, "got inv: %s %s peer=%d\n", inv.ToString(), | ||||
fAlreadyHave ? "have" : "new", pfrom->GetId()); | fAlreadyHave ? "have" : "new", pfrom->GetId()); | ||||
▲ Show 20 Lines • Show All 2,153 Lines • Show Last 20 Lines |