Skip to content

Commit a739d20

Browse files
committed
Merge #17519: rpc: Remove unused COINBASE_FLAGS
e9a27cf refactor: Remove unused COINBASE_FLAGS (Neha Narula) Pull request description: Commit d449772 stopped setting COINBASE_FLAGS, and it looks like it hasn't been used since P2SH. Following up on #17489, remove COINBASE_FLAGS which is unused. I verified that removing this did not change the contents of the coinbase's scriptSig. ACKs for top commit: laanwj: ACK e9a27cf MarcoFalke: ACK e9a27cf 💻 Tree-SHA512: f9dac124ce7e3edcae974137764bb5039387b1b123b86af44486e398aa4a8d91a9ecf640e207b364ae303acbbaee7cca300d303ea3d6869ba9cae2bf555a6334
2 parents 69a6f1a + e9a27cf commit a739d20

File tree

4 files changed

+2
-9
lines changed

4 files changed

+2
-9
lines changed

src/miner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned
435435
++nExtraNonce;
436436
unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
437437
CMutableTransaction txCoinbase(*pblock->vtx[0]);
438-
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;
438+
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce));
439439
assert(txCoinbase.vin[0].scriptSig.size() <= 100);
440440

441441
pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase));

src/rpc/mining.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
375375
" }\n"
376376
" ,...\n"
377377
" ],\n"
378-
" \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
379-
" \"flags\" : \"xx\" (string) key name is to be ignored, and value included in scriptSig\n"
380-
" },\n"
378+
" \"coinbaseaux\" : { ... }, (json object) data that should be included in the coinbase's scriptSig content\n"
381379
" \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)\n"
382380
" \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
383381
" \"target\" : \"xxxx\", (string) The hash target\n"
@@ -607,7 +605,6 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
607605
}
608606

609607
UniValue aux(UniValue::VOBJ);
610-
aux.pushKV("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end()));
611608

612609
arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits);
613610

src/validation.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
129129
CBlockPolicyEstimator feeEstimator;
130130
CTxMemPool mempool(&feeEstimator);
131131

132-
/** Constant stuff for coinbase transactions we create: */
133-
CScript COINBASE_FLAGS;
134-
135132
// Internal stuff
136133
namespace {
137134
CBlockIndex* pindexBestInvalid = nullptr;

src/validation.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ struct BlockHasher
137137
size_t operator()(const uint256& hash) const { return ReadLE64(hash.begin()); }
138138
};
139139

140-
extern CScript COINBASE_FLAGS;
141140
extern CCriticalSection cs_main;
142141
extern CBlockPolicyEstimator feeEstimator;
143142
extern CTxMemPool mempool;

0 commit comments

Comments
 (0)