Skip to content

Commit

Permalink
wait for zebrad or zcashd to reach sapling activation height
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Larry Ruane authored and LarryRuane committed Jul 10, 2024
1 parent 6e3816b commit f24e029
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f24e029

Please sign in to comment.