diff --git a/rpcclient/rpcclient.go b/rpcclient/rpcclient.go index efb36ec..a7a9c30 100644 --- a/rpcclient/rpcclient.go +++ b/rpcclient/rpcclient.go @@ -123,7 +123,10 @@ func retry(ctx context.Context, delay time.Duration, fn func() error) error { for { select { case <-ctx.Done(): - return err + if err != nil { + return err + } + return ctx.Err() case <-ticker.C: err = fn() if err == nil {