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.
This commit is contained in:
Larry Ruane 2024-07-08 18:17:03 -06:00 committed by Larry Ruane
parent 6e3816b583
commit f24e0298a9
1 changed files with 2 additions and 2 deletions

View File

@ -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)