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

Function ProcessFilterAddMessage

src/p2p/chainmessage.cpp:795–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795void ProcessFilterAddMessage(CNode *pFrom, CDataStream &vRecv) {
796 vector<uint8_t> vData;
797 vRecv >> vData;
798
799 // Nodes must NEVER send a data item > 520 bytes (the max size for a script data object,
800 // and thus, the maximum size any matched object can have) in a filteradd message
801 if (vData.size() > 520) // MAX_SCRIPT_ELEMENT_SIZE)
802 {
803 LogPrint(BCLog::INFO, "Misbehaving: send a data item > 520 bytes, Misbehavior add 100");
804 Misbehaving(pFrom->GetId(), 100);
805 } else {
806 LOCK(pFrom->cs_filter);
807 if (pFrom->pFilter)
808 pFrom->pFilter->insert(vData);
809 else {
810 LogPrint(BCLog::INFO, "Misbehaving: filter error, Misbehavior add 100");
811 Misbehaving(pFrom->GetId(), 100);
812 }
813 }
814}
815
816bool ProcessBlockConfirmMessage(CNode *pFrom, CDataStream &vRecv) {
817

Callers 1

ProcessMessageFunction · 0.85

Calls 4

MisbehavingFunction · 0.85
GetIdMethod · 0.80
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected