Only check for a valid Sapling anchor after Sapling activation.
Before Sapling activates, hashFinalSaplingRoot is 0x0, which is not a valid anchor. After Sapling activates, the empty root value of 0x3e49... is a valid anchor.
This commit is contained in:
@@ -1986,7 +1986,9 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
|
||||
// state on the path to the tip of our chain
|
||||
assert(pcoinsTip->GetSproutAnchorAt(pindex->hashSproutAnchor, sproutTree));
|
||||
if (pindex->pprev) {
|
||||
assert(pcoinsTip->GetSaplingAnchorAt(pindex->pprev->hashFinalSaplingRoot, saplingTree));
|
||||
if (NetworkUpgradeActive(pindex->pprev->nHeight, Params().GetConsensus(), Consensus::UPGRADE_SAPLING)) {
|
||||
assert(pcoinsTip->GetSaplingAnchorAt(pindex->pprev->hashFinalSaplingRoot, saplingTree));
|
||||
}
|
||||
}
|
||||
// Increment note witness caches
|
||||
IncrementNoteWitnesses(pindex, &block, sproutTree, saplingTree);
|
||||
|
||||
Reference in New Issue
Block a user