Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 3,396 Lines • ▼ Show 20 Lines | while (it != peer.m_getdata_requests.end()) { | ||||
| // The send buffer provides backpressure. If there's no space in | // The send buffer provides backpressure. If there's no space in | ||||
| // the buffer, pause processing until the next call. | // the buffer, pause processing until the next call. | ||||
| if (pfrom.fPauseSend) { | if (pfrom.fPauseSend) { | ||||
| break; | break; | ||||
| } | } | ||||
| const CInv &inv = *it; | const CInv &inv = *it; | ||||
| if (it->IsMsgStakeContender()) { | |||||
| // Ignore requests for stake contenders. This type is only used for | |||||
| // polling. | |||||
| ++it; | |||||
| continue; | |||||
| } | |||||
| if (it->IsMsgProof()) { | if (it->IsMsgProof()) { | ||||
| if (!m_avalanche) { | if (!m_avalanche) { | ||||
| vNotFound.push_back(inv); | vNotFound.push_back(inv); | ||||
| ++it; | ++it; | ||||
| continue; | continue; | ||||
| } | } | ||||
| const avalanche::ProofId proofid(inv.hash); | const avalanche::ProofId proofid(inv.hash); | ||||
| auto proof = FindProofForGetData(peer, proofid, now); | auto proof = FindProofForGetData(peer, proofid, now); | ||||
| ▲ Show 20 Lines • Show All 1,782 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::INV) { | ||||
| fAlreadyHave ? "have" : "new", pfrom.GetId()); | fAlreadyHave ? "have" : "new", pfrom.GetId()); | ||||
| }; | }; | ||||
| for (CInv &inv : vInv) { | for (CInv &inv : vInv) { | ||||
| if (interruptMsgProc) { | if (interruptMsgProc) { | ||||
| return; | return; | ||||
| } | } | ||||
| if (inv.IsMsgStakeContender()) { | |||||
| // Ignore invs with stake contenders. This type is only used for | |||||
| // polling. | |||||
| continue; | |||||
| } | |||||
| if (inv.IsMsgBlk()) { | if (inv.IsMsgBlk()) { | ||||
| LOCK(cs_main); | LOCK(cs_main); | ||||
| const bool fAlreadyHave = AlreadyHaveBlock(BlockHash(inv.hash)); | const bool fAlreadyHave = AlreadyHaveBlock(BlockHash(inv.hash)); | ||||
| logInv(inv, fAlreadyHave); | logInv(inv, fAlreadyHave); | ||||
| BlockHash hash{inv.hash}; | BlockHash hash{inv.hash}; | ||||
| UpdateBlockAvailability(pfrom.GetId(), hash); | UpdateBlockAvailability(pfrom.GetId(), hash); | ||||
| if (!fAlreadyHave && !m_chainman.m_blockman.LoadingBlocks() && | if (!fAlreadyHave && !m_chainman.m_blockman.LoadingBlocks() && | ||||
| ▲ Show 20 Lines • Show All 3,592 Lines • Show Last 20 Lines | |||||