Merge remote-tracking branch 'upstream/master' into hotfix-v2.1.2-2-golden

This commit is contained in:
Kris Nuttycombe 2020-05-14 14:02:55 -06:00
commit bc617bce74
1 changed files with 3 additions and 1 deletions

View File

@ -518,12 +518,14 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const MinerAddre
nonce >>= 16;
pblock->nNonce = ArithToUint256(nonce);
uint32_t prevConsensusBranchId = CurrentEpochBranchId(pindexPrev->nHeight, chainparams.GetConsensus());
// Fill in header
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
if (IsActivationHeight(nHeight, chainparams.GetConsensus(), Consensus::UPGRADE_HEARTWOOD)) {
pblock->hashLightClientRoot.SetNull();
} else if (chainparams.GetConsensus().NetworkUpgradeActive(nHeight, Consensus::UPGRADE_HEARTWOOD)) {
pblock->hashLightClientRoot = view.GetHistoryRoot(consensusBranchId);
pblock->hashLightClientRoot = view.GetHistoryRoot(prevConsensusBranchId);
} else {
pblock->hashLightClientRoot = sapling_tree.root();
}