Stop calculating sigops in coinbase scriptsigs since 20 Nov 2015.
authorCryptoManiac <balthazar@yandex.ru>
Sun, 13 Sep 2015 23:32:23 +0000 (02:32 +0300)
committerCryptoManiac <balthazar@yandex.ru>
Sun, 13 Sep 2015 23:32:23 +0000 (02:32 +0300)
src/main.cpp
src/timestamps.h

index e5fba9c..fbfa746 100644 (file)
@@ -430,9 +430,14 @@ unsigned int
 CTransaction::GetLegacySigOpCount() const
 {
     unsigned int nSigOps = 0;
-    BOOST_FOREACH(const CTxIn& txin, vin)
+    if (!IsCoinBase() || nTime < COINBASE_SIGOPS_SWITCH_TIME)
     {
-        nSigOps += txin.scriptSig.GetSigOpCount(false);
+        // Coinbase scriptsigs are never executed, so there is 
+        //    no sense in calculation of sigops.
+        BOOST_FOREACH(const CTxIn& txin, vin)
+        {
+            nSigOps += txin.scriptSig.GetSigOpCount(false);
+        }
     }
     BOOST_FOREACH(const CTxOut& txout, vout)
     {
index c66b025..0a912d4 100644 (file)
@@ -1,7 +1,8 @@
 #ifndef BITCOIN_TIMESTAMPS_H
 #define BITCOIN_TIMESTAMPS_H
 
-static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Sat, 20 Jul 2013 00:00:00 GMT
-static const unsigned int CHAINCHECKS_SWITCH_TIME = 1379635200; // Fri, 20 Sep 2013 00:00:00 GMT
+static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Saturday, 20-Jul-2013 00:00:00 UTC
+static const unsigned int CHAINCHECKS_SWITCH_TIME = 1379635200; // Friday, 20-Sep-2013 00:00:00 UTC
+static const unsigned int COINBASE_SIGOPS_SWITCH_TIME = 1447977600; // Friday, 20-Nov-15 00:00:00 UTC
 
 #endif