From 558f662a3356e971056305ed43756849d5f22a87 Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 21 Mar 2024 11:17:58 -0400 Subject: [PATCH] Do not apply sapling network rules to block height 0 or 1 in ScanForWalletTransactions --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 37b31ec85..18e38cb0c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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)); }