bitcoin/bitcoin — pull request #1729 by gavinandresen (2012-08-27 14:51:49+00:00)
Title: Alert fix

These commits:

1) prevents a possible DoS (make nodes waste CPU time checking alert signatures) attack
2) implement's theymos' suggestion of a non-overrideable alert message, to be used only in case the alert key is compromised.

Both thoroughly tested by me in a testnet-in-a-box environment:

Verified that nodes are disconnected/banned if they send too many invalid alerts.
Verified that the alert system still works properly when sent valid alerts.
Verified that nId=max alerts are ignored unless they match hard-coded values.
Verified that nId=max alerts work properly if they do match.