Skip to content

Commit

Permalink
Merge bitcoin#17519: rpc: Remove unused COINBASE_FLAGS
Browse files Browse the repository at this point in the history
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 bitcoin#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
  • Loading branch information
laanwj authored and vijaydasmp committed Aug 30, 2021
1 parent b981c0d commit 29a3f26
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned
++nExtraNonce;
unsigned int nHeight = pindexPrev->nHeight+1; // Height first in coinbase required for block.version=2
CMutableTransaction txCoinbase(*pblock->vtx[0]);
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce)) + COINBASE_FLAGS;
txCoinbase.vin[0].scriptSig = (CScript() << nHeight << CScriptNum(nExtraNonce));
assert(txCoinbase.vin[0].scriptSig.size() <= 100);

pblock->vtx[0] = MakeTransactionRef(std::move(txCoinbase));
Expand Down
7 changes: 2 additions & 5 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,8 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
" }\n"
" ,...\n"
" ],\n"
" \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
" \"flags\" : \"xx\" (string) key name is to be ignored, and value included in scriptSig\n"
" },\n"
" \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in duffs)\n"
" \"coinbaseaux\" : { ... }, (json object) data that should be included in the coinbase's scriptSig content\n"
" \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in satoshis)\n"
" \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
" \"target\" : \"xxxx\", (string) The hash target\n"
" \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
Expand Down Expand Up @@ -591,7 +589,6 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
}

UniValue aux(UniValue::VOBJ);
aux.pushKV("flags", HexStr(COINBASE_FLAGS));

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

Expand Down
3 changes: 0 additions & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ std::atomic_bool g_is_mempool_loaded{false};

static void CheckBlockIndex(const Consensus::Params& consensusParams);

/** Constant stuff for coinbase transactions we create: */
CScript COINBASE_FLAGS;

// Internal stuff
namespace {
CBlockIndex *&pindexBestInvalid = g_chainstate.pindexBestInvalid;
Expand Down
1 change: 0 additions & 1 deletion src/validation.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ struct BlockHasher
size_t operator()(const uint256& hash) const { return hash.GetCheapHash(); }
};

extern CScript COINBASE_FLAGS;
extern CCriticalSection cs_main;
extern CBlockPolicyEstimator feeEstimator;
extern CTxMemPool mempool;
Expand Down

0 comments on commit 29a3f26

Please sign in to comment.