@@ -97,11 +97,6 @@ void BlockAssembler::resetBlock()
97
97
}
98
98
99
99
std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock (const CScript& scriptPubKeyIn)
100
- {
101
- return CreateNewBlock (::ChainstateActive (), scriptPubKeyIn);
102
- }
103
-
104
- std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock (CChainState& chainstate, const CScript& scriptPubKeyIn)
105
100
{
106
101
int64_t nTimeStart = GetTimeMicros ();
107
102
@@ -119,8 +114,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(CChainState& chai
119
114
pblocktemplate->vTxSigOpsCost .push_back (-1 ); // updated at end
120
115
121
116
LOCK2 (cs_main, m_mempool.cs );
122
- assert (std::addressof (*::ChainActive ().Tip ()) == std::addressof (*chainstate.m_chain .Tip ()));
123
- CBlockIndex* pindexPrev = chainstate.m_chain .Tip ();
117
+ CBlockIndex* pindexPrev = ::ChainActive ().Tip ();
124
118
assert (pindexPrev != nullptr );
125
119
nHeight = pindexPrev->nHeight + 1 ;
126
120
@@ -179,8 +173,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(CChainState& chai
179
173
pblocktemplate->vTxSigOpsCost [0 ] = WITNESS_SCALE_FACTOR * GetLegacySigOpCount (*pblock->vtx [0 ]);
180
174
181
175
BlockValidationState state;
182
- assert (std::addressof (::ChainstateActive ()) == std::addressof (chainstate));
183
- if (!TestBlockValidity (state, chainparams, chainstate, *pblock, pindexPrev, false , false )) {
176
+ if (!TestBlockValidity (state, chainparams, ::ChainstateActive (), *pblock, pindexPrev, false , false )) {
184
177
throw std::runtime_error (strprintf (" %s: TestBlockValidity failed: %s" , __func__, state.ToString ()));
185
178
}
186
179
int64_t nTime2 = GetTimeMicros ();
0 commit comments