Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 2,979 Lines • ▼ Show 20 Lines | if (msg_type == NetMsgType::VERACK) { | ||||
m_connman.PushMessage(&pfrom, | m_connman.PushMessage(&pfrom, | ||||
msgMaker.Make(NetMsgType::SENDCMPCT, | msgMaker.Make(NetMsgType::SENDCMPCT, | ||||
fAnnounceUsingCMPCTBLOCK, | fAnnounceUsingCMPCTBLOCK, | ||||
nCMPCTBLOCKVersion)); | nCMPCTBLOCKVersion)); | ||||
} | } | ||||
if (g_avalanche && | if (g_avalanche && | ||||
gArgs.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED)) { | gArgs.GetBoolArg("-enableavalanche", AVALANCHE_DEFAULT_ENABLED)) { | ||||
for (const avalanche::Peer &peer : g_avalanche->getPeers()) { | |||||
pfrom.PushProofInventory(peer.proof.getId()); | |||||
} | |||||
if ((pfrom.nServices & NODE_AVALANCHE) && | if ((pfrom.nServices & NODE_AVALANCHE) && | ||||
g_avalanche->sendHello(&pfrom)) { | g_avalanche->sendHello(&pfrom)) { | ||||
LogPrint(BCLog::NET, "Send avahello to peer %d\n", | LogPrint(BCLog::NET, "Send avahello to peer %d\n", | ||||
pfrom.GetId()); | pfrom.GetId()); | ||||
} | } | ||||
for (const avalanche::Peer &peer : g_avalanche->getPeers()) { | |||||
pfrom.PushProofInventory(peer.proof.getId()); | |||||
} | |||||
} | } | ||||
pfrom.fSuccessfullyConnected = true; | pfrom.fSuccessfullyConnected = true; | ||||
return; | return; | ||||
} | } | ||||
if (!pfrom.fSuccessfullyConnected) { | if (!pfrom.fSuccessfullyConnected) { | ||||
// Must have a verack message before anything else | // Must have a verack message before anything else | ||||
▲ Show 20 Lines • Show All 2,367 Lines • ▼ Show 20 Lines | if (pingSend) { | ||||
// Add proofs to inventory | // Add proofs to inventory | ||||
if (pto->m_proof_relay != nullptr) { | if (pto->m_proof_relay != nullptr) { | ||||
LOCK(pto->m_proof_relay->cs_proof_inventory); | LOCK(pto->m_proof_relay->cs_proof_inventory); | ||||
auto it = pto->m_proof_relay->setInventoryProofToSend.begin(); | auto it = pto->m_proof_relay->setInventoryProofToSend.begin(); | ||||
while (it != | while (it != | ||||
pto->m_proof_relay->setInventoryProofToSend.end()) { | pto->m_proof_relay->setInventoryProofToSend.end()) { | ||||
addInvAndMaybeFlush(MSG_AVA_PROOF, *it); | addInvAndMaybeFlush(MSG_AVA_PROOF, *it); | ||||
pto->AddKnownProof(*it); | |||||
deadalnix: I don't follow why this is needed. I don't think it is. | |||||
it = pto->m_proof_relay->setInventoryProofToSend.erase(it); | it = pto->m_proof_relay->setInventoryProofToSend.erase(it); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (!vInv.empty()) { | if (!vInv.empty()) { | ||||
m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv)); | m_connman.PushMessage(pto, msgMaker.Make(NetMsgType::INV, vInv)); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 264 Lines • Show Last 20 Lines |
I don't follow why this is needed. I don't think it is.