Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 4,453 Lines • ▼ Show 20 Lines | |||||
if (msg_type == NetMsgType::GETCFCHECKPT) { | if (msg_type == NetMsgType::GETCFCHECKPT) { | ||||
ProcessGetCFCheckPt(pfrom, vRecv, m_chainparams, m_connman); | ProcessGetCFCheckPt(pfrom, vRecv, m_chainparams, m_connman); | ||||
return; | return; | ||||
} | } | ||||
if (msg_type == NetMsgType::NOTFOUND) { | if (msg_type == NetMsgType::NOTFOUND) { | ||||
std::vector<CInv> vInv; | std::vector<CInv> vInv; | ||||
vRecv >> vInv; | vRecv >> vInv; | ||||
if (vInv.size() <= TX_REQUEST_PARAMS.max_peer_announcements + | // A peer might send up to 1 notfound per getdata request, but no more | ||||
if (vInv.size() <= PROOF_REQUEST_PARAMS.max_peer_announcements + | |||||
TX_REQUEST_PARAMS.max_peer_announcements + | |||||
MAX_BLOCKS_IN_TRANSIT_PER_PEER) { | MAX_BLOCKS_IN_TRANSIT_PER_PEER) { | ||||
LOCK(::cs_main); | |||||
for (CInv &inv : vInv) { | for (CInv &inv : vInv) { | ||||
if (inv.IsMsgTx()) { | if (inv.IsMsgTx()) { | ||||
// If we receive a NOTFOUND message for a tx we requested, | // If we receive a NOTFOUND message for a tx we requested, | ||||
// mark the announcement for it as completed in | // mark the announcement for it as completed in | ||||
// InvRequestTracker. | // InvRequestTracker. | ||||
LOCK(::cs_main); | |||||
m_txrequest.ReceivedResponse(pfrom.GetId(), TxId(inv.hash)); | m_txrequest.ReceivedResponse(pfrom.GetId(), TxId(inv.hash)); | ||||
continue; | |||||
} | |||||
if (inv.IsMsgProof()) { | |||||
LOCK(cs_proofrequest); | |||||
m_proofrequest.ReceivedResponse( | |||||
pfrom.GetId(), avalanche::ProofId(inv.hash)); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
// Ignore unknown commands for extensibility | // Ignore unknown commands for extensibility | ||||
LogPrint(BCLog::NET, "Unknown command \"%s\" from peer=%d\n", | LogPrint(BCLog::NET, "Unknown command \"%s\" from peer=%d\n", | ||||
▲ Show 20 Lines • Show All 1,165 Lines • Show Last 20 Lines |