MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / ProcessGetDataMessage

Function ProcessGetDataMessage

src/p2p/chainmessage.cpp:677–695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

675}
676
677bool ProcessGetDataMessage(CNode *pFrom, CDataStream &vRecv) {
678 vector<CInv> vInv;
679 vRecv >> vInv;
680 if (vInv.size() > MAX_INV_SZ) {
681 Misbehaving(pFrom->GetId(), 20);
682 return ERRORMSG("message getdata size() = %u from peer %s", vInv.size(), pFrom->addr.ToString());
683 }
684
685 if ((vInv.size() != 1))
686 LogPrint(BCLog::NET, "received getdata (%u invsz) from peer %s\n", vInv.size(), pFrom->addr.ToString());
687
688 if ((vInv.size() > 0) || (vInv.size() == 1))
689 LogPrint(BCLog::NET, "received getdata for: %s from peer %s\n", vInv[0].ToString(), pFrom->addr.ToString());
690
691 pFrom->vRecvGetData.insert(pFrom->vRecvGetData.end(), vInv.begin(), vInv.end());
692 ProcessGetData(pFrom);
693
694 return true;
695}
696
697void ProcessBlockMessage(CNode *pFrom, CDataStream &vRecv) {
698 CBlock block;

Callers 1

ProcessMessageFunction · 0.85

Calls 8

MisbehavingFunction · 0.85
ProcessGetDataFunction · 0.85
GetIdMethod · 0.80
sizeMethod · 0.45
ToStringMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected