validation: Pass in chainstate to TestBlockValidity

[META] This commit should be followed up by removing the comments and
       assertions meant only to show that the change is correct.
This commit is contained in:
Carl Dong
2020-09-30 17:02:51 -04:00
parent 0e17c833cd
commit 9c300cc8b3
4 changed files with 11 additions and 9 deletions

View File

@@ -176,7 +176,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock(const CScript& sc
pblocktemplate->vTxSigOpsCost[0] = WITNESS_SCALE_FACTOR * GetLegacySigOpCount(*pblock->vtx[0]);
BlockValidationState state;
if (!TestBlockValidity(state, chainparams, *pblock, pindexPrev, false, false)) {
if (!TestBlockValidity(state, chainparams, ::ChainstateActive(), *pblock, pindexPrev, false, false)) {
throw std::runtime_error(strprintf("%s: TestBlockValidity failed: %s", __func__, state.ToString()));
}
int64_t nTime2 = GetTimeMicros();