| 751 | } |
| 752 | |
| 753 | void 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 | |
| 778 | void ProcessFilterLoadMessage(CNode *pFrom, CDataStream &vRecv) { |
| 779 | CBloomFilter filter; |
no test coverage detected