changeset 23711:f90bce4879d8

Merge pull request #15 from bitcartel/BUIP013 BUIP013 allows the developer discretion on the solution since option voting did not have a majority. For now, I will disable alerts but am intending to re-enable them with BU keys at some later date, and will consider forwarding alerts coming from other clients to those clients.
author gandrewstone <g.andrew.stone@gmail.com>
date Fri, 04 Mar 2016 20:48:51 -0500
parents 5998ab270bf7 6c06569190bc
children 347f871de0ac
files
diffstat 3 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/init.cpp	Fri Mar 04 14:16:06 2016 -0500
+++ b/src/init.cpp	Fri Mar 04 20:48:51 2016 -0500
@@ -1,5 +1,6 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
 // Copyright (c) 2009-2015 The Bitcoin Core developers
+// Copyright (c) 2016 Bitcoin Unlimited developers
 // Distributed under the MIT software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
@@ -316,7 +317,10 @@
     string strUsage = HelpMessageGroup(_("Options:"));
     strUsage += HelpMessageOpt("-?", _("This help message"));
     strUsage += HelpMessageOpt("-version", _("Print version and exit"));
+    // BUIP013 disables network alerts
+#if 0
     strUsage += HelpMessageOpt("-alerts", strprintf(_("Receive and display P2P network alerts (default: %u)"), DEFAULT_ALERTS));
+#endif
     strUsage += HelpMessageOpt("-alertnotify=<cmd>", _("Execute command when a relevant alert is received or we see a really long fork (%s in cmd is replaced by message)"));
     strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
     if (showDebug)
@@ -1037,7 +1041,10 @@
     fAcceptDatacarrier = GetBoolArg("-datacarrier", DEFAULT_ACCEPT_DATACARRIER);
     nMaxDatacarrierBytes = GetArg("-datacarriersize", nMaxDatacarrierBytes);
 
+	// BUIP013 disables network alerts
+#if 0
     fAlerts = GetBoolArg("-alerts", DEFAULT_ALERTS);
+#endif
 
     // Option to startup with mocktime set (used for regression testing):
     SetMockTime(GetArg("-mocktime", 0)); // SetMockTime(0) is a no-op
--- a/src/main.cpp	Fri Mar 04 14:16:06 2016 -0500
+++ b/src/main.cpp	Fri Mar 04 20:48:51 2016 -0500
@@ -1,5 +1,6 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
 // Copyright (c) 2009-2015 The Bitcoin Core developers
+// Copyright (c) 2016 Bitcoin Unlimited developers
 // Distributed under the MIT software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
@@ -5452,6 +5453,8 @@
     }
 
 
+	// BUIP013 disables network alerts.  fAlerts is always false so conditional code will never run.
+#if 0
     else if (fAlerts && strCommand == NetMsgType::ALERT)
     {
         CAlert alert;
@@ -5481,7 +5484,7 @@
             }
         }
     }
-
+#endif
 
     else if (strCommand == NetMsgType::FILTERLOAD)
     {
--- a/src/main.h	Fri Mar 04 14:16:06 2016 -0500
+++ b/src/main.h	Fri Mar 04 20:48:51 2016 -0500
@@ -1,5 +1,6 @@
 // Copyright (c) 2009-2010 Satoshi Nakamoto
 // Copyright (c) 2009-2015 The Bitcoin Core developers
+// Copyright (c) 2016 Bitcoin Unlimited Developers
 // Distributed under the MIT software license, see the accompanying
 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 
@@ -41,8 +42,8 @@
 
 struct CNodeStateStats;
 
-/** Default for accepting alerts from the P2P network. */
-static const bool DEFAULT_ALERTS = true;
+/** Default for accepting alerts from the P2P network. BUIP013 disables network alerts. */
+static const bool DEFAULT_ALERTS = false;
 /** Default for DEFAULT_WHITELISTRELAY. */
 static const bool DEFAULT_WHITELISTRELAY = true;
 /** Default for DEFAULT_WHITELISTFORCERELAY. */