From 18f06896953d96390d925060d6756a50ab3cd94b Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 12 Jun 2023 07:55:45 -0700 Subject: [PATCH] Avoid ztx validation during IBD if height is less than latest checkpoint --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 18769e520..a54d03ada 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1363,6 +1363,11 @@ bool ContextualCheckTransaction(int32_t slowflag,const CBlock *block, CBlockInde REJECT_INVALID, "bad-txns-invalid-script-data-for-coinbase-time-lock"); } + // Avoid ztx validation during IBD if height is less than latest checkpoint + if (fCheckpointsEnabled && (nHeight < Checkpoints::GetTotalBlocksEstimate(Params().Checkpoints())) ) { + return true; + } + if (!tx.vShieldedSpend.empty() || !tx.vShieldedOutput.empty()) {