From 0c1b2bc549aec77b247f0103652d883227841ac5 Mon Sep 17 00:00:00 2001 From: Carl Dong Date: Tue, 16 Mar 2021 19:31:17 -0400 Subject: [PATCH] Revert "miner: Remove old CreateNewBlock w/o chainstate param" This reverts commit 2afcf24408b4453e4418ebfb326b141f6ea8647c. --- src/miner.cpp | 5 +++++ src/miner.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index fe7a54c052..14443c432d 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -96,6 +96,11 @@ void BlockAssembler::resetBlock() nFees = 0; } +std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& scriptPubKeyIn) +{ + return CreateNewBlock(::ChainstateActive(), scriptPubKeyIn); +} + std::unique_ptr BlockAssembler::CreateNewBlock(CChainState& chainstate, const CScript& scriptPubKeyIn) { int64_t nTimeStart = GetTimeMicros(); diff --git a/src/miner.h b/src/miner.h index 023635814c..06af570130 100644 --- a/src/miner.h +++ b/src/miner.h @@ -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 CreateNewBlock(const CScript& scriptPubKeyIn); std::unique_ptr CreateNewBlock(CChainState& chainstate, const CScript& scriptPubKeyIn); inline static std::optional m_last_block_num_txs{};