Do not apply sapling network rules to block height 0 or 1 in ScanForWalletTransactions

This commit is contained in:
Duke
2024-03-21 11:17:58 -04:00
parent f5f851158a
commit 558f662a33

View File

@@ -2790,7 +2790,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
// This should never fail: we should always be able to get the tree
// state on the path to the tip of our chain
if (pindex->pprev) {
const bool sapling = true;
const bool sapling = pindex->GetHeight() >= 2 ? true : false;
if (sapling) { // NetworkUpgradeActive(pindex->pprev->GetHeight(), Params().GetConsensus(), Consensus::UPGRADE_SAPLING)) {
assert(pcoinsTip->GetSaplingAnchorAt(pindex->pprev->hashFinalSaplingRoot, saplingTree));
}