aboutsummaryrefslogtreecommitdiff
path: root/src/miner.h
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2021-03-17 16:32:24 -0400
committerCarl Dong <contact@carldong.me>2021-03-24 15:40:56 -0400
commit7b8e976cd5ac78a22f1be2b2fed8562c693af5d9 (patch)
tree7cc8c7b03ef9b139d8dc5bc258cd848fc9dfc5a1 /src/miner.h
parente62067e7bcad5a559899afff2e4a8e8b7e9f4301 (diff)
miner: Add chainstate member to BlockAssembler
Diffstat (limited to 'src/miner.h')
-rw-r--r--src/miner.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/miner.h b/src/miner.h
index c1ef49dea9..c400c90f6c 100644
--- a/src/miner.h
+++ b/src/miner.h
@@ -146,6 +146,7 @@ private:
int64_t nLockTimeCutoff;
const CChainParams& chainparams;
const CTxMemPool& m_mempool;
+ CChainState& m_chainstate;
public:
struct Options {
@@ -154,8 +155,8 @@ public:
CFeeRate blockMinFeeRate;
};
- explicit BlockAssembler(const CTxMemPool& mempool, const CChainParams& params);
- explicit BlockAssembler(const CTxMemPool& mempool, const CChainParams& params, const Options& options);
+ explicit BlockAssembler(CChainState& chainstate, const CTxMemPool& mempool, const CChainParams& params);
+ explicit BlockAssembler(CChainState& chainstate, const CTxMemPool& mempool, const CChainParams& params, const Options& options);
/** Construct a new block template with coinbase to scriptPubKeyIn */
std::unique_ptr<CBlockTemplate> CreateNewBlock(const CScript& scriptPubKeyIn);
@@ -201,6 +202,7 @@ private:
void IncrementExtraNonce(CBlock* pblock, const CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev);
+// TODO just accept a CBlockIndex*
/** Update an old GenerateCoinbaseCommitment from CreateNewBlock after the block txs have changed */
void RegenerateCommitments(CBlock& block, BlockManager& blockman);