From f24e0298a9c46da2f4bb49328c8b52df2595f06b Mon Sep 17 00:00:00 2001 From: Larry Ruane Date: Mon, 8 Jul 2024 18:17:03 -0600 Subject: [PATCH] wait for zebrad or zcashd to reach sapling activation height This has been broken for a long time. If, when starting up, lightwalletd discovers that the backend node (zebrad or zcashd) has not yet synced to the Sapling activation height (419200 for mainnet, 280000 for testnet), it should wait until that happens, then sync along with the backend node. But instead, lightwalletd gets stuck indefinitely. The only way to escape the hang is to stop and restart lightwalletd. This commit fixes the problem; the block ingestor retries every 2 minutes (which was always the intention), rather than trying once and then giving up. --- common/common.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/common.go b/common/common.go index de2857a6..50f38b2b 100644 --- a/common/common.go +++ b/common/common.go @@ -464,8 +464,8 @@ func BlockIngestor(c *BlockCache, rep int) { c.Sync() Log.Info("Waiting for zcashd height to reach Sapling activation height ", "(", c.GetFirstHeight(), ")...") - Time.Sleep(20 * time.Second) - return + Time.Sleep(120 * time.Second) + continue } Log.Info("REORG: dropping block ", height-1, " ", displayHash(c.GetLatestHash())) c.Reorg(height - 1)