Revert "miner: Remove old CreateNewBlock w/o chainstate param"

This reverts commit 2afcf24408.
This commit is contained in:
Carl Dong
2021-03-16 19:31:17 -04:00
parent ed49203daa
commit 0c1b2bc549
2 changed files with 6 additions and 0 deletions

View File

@@ -96,6 +96,11 @@ void BlockAssembler::resetBlock()
nFees = 0;
}
std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn)
{
return CreateNewBlock(::ChainstateActive(), scriptPubKeyIn);
}
std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(CChainState& chainstate, const CScript& scriptPubKeyIn)
{
int64_t nTimeStart = GetTimeMicros();

View File

@@ -158,6 +158,7 @@ public:
explicit BlockAssembler(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);
std::unique_ptr<CBlockTemplate> CreateNewBlock(CChainState& chainstate, const CScript& scriptPubKeyIn);
inline static std::optional<int64_t> m_last_block_num_txs{};