diff --git a/src/consensus/consensus.h b/src/consensus/consensus.h --- a/src/consensus/consensus.h +++ b/src/consensus/consensus.h @@ -28,6 +28,8 @@ * blocks (network rule). */ static const int COINBASE_MATURITY = 100; +/** Coinbase scripts have their own script size limit. */ +static const int MAX_COINBASE_SCRIPTSIG_SIZE = 100; /** Activation time for P2SH (April 1st 2012) */ static const int64_t P2SH_ACTIVATION_TIME = 1333234914; diff --git a/src/miner.cpp b/src/miner.cpp --- a/src/miner.cpp +++ b/src/miner.cpp @@ -33,8 +33,6 @@ #include #include -static const int MAX_COINBASE_SCRIPTSIG_SIZE = 100; - ////////////////////////////////////////////////////////////////////////////// // // BitcoinMiner diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -484,7 +484,8 @@ return false; } - if (tx.vin[0].scriptSig.size() < 2 || tx.vin[0].scriptSig.size() > 100) { + if (tx.vin[0].scriptSig.size() < 2 || + tx.vin[0].scriptSig.size() > MAX_COINBASE_SCRIPTSIG_SIZE) { return state.DoS(100, false, REJECT_INVALID, "bad-cb-length"); }