From a145cda56d6afc4fe7c42ebcc2f4a8721e384ac5 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Thu, 10 Mar 2022 10:54:27 -0500 Subject: [PATCH 1/2] Fix dev mode by addressing off by one error. --- fetcher/fetcher.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetcher/fetcher.go b/fetcher/fetcher.go index b7da57690..c6d2694e8 100644 --- a/fetcher/fetcher.go +++ b/fetcher/fetcher.go @@ -147,7 +147,7 @@ func (bot *fetcherImpl) followLoop(ctx context.Context) error { aclient := bot.Algod() for { for retries := 0; retries < 3; retries++ { - _, err = aclient.StatusAfterBlock(bot.nextRound).Do(ctx) + _, err = aclient.StatusAfterBlock(bot.nextRound - 1).Do(ctx) if err != nil { // If context has expired. if ctx.Err() != nil { From 2d2d7a395f7b64412086a0e3cda708d82065fe90 Mon Sep 17 00:00:00 2001 From: Will Winder Date: Thu, 10 Mar 2022 11:48:04 -0500 Subject: [PATCH 2/2] Add a comment to explain the decrement. --- fetcher/fetcher.go | 1 + 1 file changed, 1 insertion(+) diff --git a/fetcher/fetcher.go b/fetcher/fetcher.go index c6d2694e8..d1e2c7a0d 100644 --- a/fetcher/fetcher.go +++ b/fetcher/fetcher.go @@ -147,6 +147,7 @@ func (bot *fetcherImpl) followLoop(ctx context.Context) error { aclient := bot.Algod() for { for retries := 0; retries < 3; retries++ { + // nextRound - 1 because the endpoint waits until "StatusAfterBlock" _, err = aclient.StatusAfterBlock(bot.nextRound - 1).Do(ctx) if err != nil { // If context has expired.