Remove assertions that require Orchard wallet persistence to satisfy.

This commit is contained in:
Kris Nuttycombe 2022-03-04 09:59:11 -07:00
parent 23a7314607
commit 9336c5e7f0
1 changed files with 11 additions and 7 deletions

View File

@ -2319,8 +2319,10 @@ void CWallet::IncrementNoteWitnesses(
// If we're at or beyond NU5 activation, update the Orchard note commitment tree.
if (performOrchardWalletUpdates && consensus.NetworkUpgradeActive(pindex->nHeight, Consensus::UPGRADE_NU5)) {
assert(orchardWallet.AppendNoteCommitments(pindex->nHeight, *pblock));
assert(pindex->hashFinalOrchardRoot == orchardWallet.GetLatestAnchor());
orchardWallet.AppendNoteCommitments(pindex->nHeight, *pblock);
// TODO ORCHARD: Enable the following assertions.
//assert(orchardWallet.AppendNoteCommitments(pindex->nHeight, *pblock));
//assert(pindex->hashFinalOrchardRoot == orchardWallet.GetLatestAnchor());
}
// Update witness heights
@ -2390,11 +2392,13 @@ void CWallet::DecrementNoteWitnesses(const Consensus::Params& consensus, const C
// pindex->nHeight is the height of the block being removed, so we rewind
// to the previous block height
uint32_t blocksRewound{0};
assert(orchardWallet.Rewind(pindex->nHeight - 1, blocksRewound));
assert(blocksRewound == 1);
if (consensus.NetworkUpgradeActive(pindex->nHeight - 1, Consensus::UPGRADE_NU5)) {
assert(pindex->pprev->hashFinalOrchardRoot == orchardWallet.GetLatestAnchor());
}
orchardWallet.Rewind(pindex->nHeight - 1, blocksRewound);
// TODO ORCHARD: Enable the following assertions.
//assert(orchardWallet.Rewind(pindex->nHeight - 1, blocksRewound));
//assert(blocksRewound == 1);
//if (consensus.NetworkUpgradeActive(pindex->nHeight - 1, Consensus::UPGRADE_NU5)) {
// assert(pindex->pprev->hashFinalOrchardRoot == orchardWallet.GetLatestAnchor());
//}
}
// For performance reasons, we write out the witness cache in