From: CryptoManiac Date: Sun, 13 Sep 2015 23:32:23 +0000 (+0300) Subject: Stop calculating sigops in coinbase scriptsigs since 20 Nov 2015. X-Git-Tag: nvc-v0.5.4~46 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=8118d1168e4e3f87f8d19c58ec3cce36eccdb92b Stop calculating sigops in coinbase scriptsigs since 20 Nov 2015. --- diff --git a/src/main.cpp b/src/main.cpp index e5fba9c..fbfa746 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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) { diff --git a/src/timestamps.h b/src/timestamps.h index c66b025..0a912d4 100644 --- a/src/timestamps.h +++ b/src/timestamps.h @@ -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