These commits:
- prevents a possible DoS (make nodes waste CPU time checking alert signatures) attack (thanks to Sergio Lerner for finding/reporting)
- 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.