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

Function ProcessAlertMessage

src/p2p/chainmessage.cpp:753–776  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751}
752
753void ProcessAlertMessage(CNode *pFrom, CDataStream &vRecv) {
754 CAlert alert;
755 vRecv >> alert;
756
757 uint256 alertHash = alert.GetHash();
758 if (pFrom->setKnown.count(alertHash) == 0) {
759 if (alert.ProcessAlert()) {
760 // Relay
761 pFrom->setKnown.insert(alertHash);
762 {
763 LOCK(cs_vNodes);
764 for (auto pNode : vNodes) alert.RelayTo(pNode);
765 }
766 } else {
767 // Small DoS penalty so peers that send us lots of
768 // duplicate/expired/invalid-signature/whatever alerts
769 // eventually get banned.
770 // This isn't a Misbehaving(100) (immediate ban) because the
771 // peer might be an older or different implementation with
772 // a different signature key, etc.
773 Misbehaving(pFrom->GetId(), 10);
774 }
775 }
776}
777
778void ProcessFilterLoadMessage(CNode *pFrom, CDataStream &vRecv) {
779 CBloomFilter filter;

Callers 1

ProcessMessageFunction · 0.85

Calls 7

MisbehavingFunction · 0.85
ProcessAlertMethod · 0.80
RelayToMethod · 0.80
GetIdMethod · 0.80
GetHashMethod · 0.45
countMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected