bitcoin/bitcoin — pull request #5169 by laanwj (2014-10-29 15:11:02+00:00)
Title: Don't relay alerts to peers before version negotiation

Fixes #1436.

Sending alert messages before the negotiation breaks protocol, causing them to be ignored as well as the sending peer to receive a Misbehaving score. This also erroneously prevents the alert from being sent again after version negotiation as it will be already in CNode::setKnown.