Don't relay alerts to peers before version negotiation
authorfsb4000 <fsb4000@yandex.ru>
Sun, 16 Nov 2014 01:11:55 +0000 (07:11 +0600)
committerfsb4000 <fsb4000@yandex.ru>
Sun, 16 Nov 2014 01:11:55 +0000 (07:11 +0600)
Перенёс коммит из bitcoin/bitcoin

https://github.com/bitcoin/bitcoin/commit/20a5f610d344dfc1dc0c6e5e9e4b0211370aa563
который решает https://github.com/bitcoin/bitcoin/issues/1436

src/alert.cpp

index a1dc27a..9172ad8 100644 (file)
@@ -130,6 +130,9 @@ bool CAlert::RelayTo(CNode* pnode) const
 {
     if (!IsInEffect())
         return false;
+    // don't relay to nodes which haven't sent their version message
+    if (pnode->nVersion == 0)
+        return false;
     // returns true if wasn't already contained in the set
     if (pnode->setKnown.insert(GetHash()).second)
     {