diff --git a/cmd/soroban-rpc/internal/daemon/daemon.go b/cmd/soroban-rpc/internal/daemon/daemon.go index c2c224de..b09a948d 100644 --- a/cmd/soroban-rpc/internal/daemon/daemon.go +++ b/cmd/soroban-rpc/internal/daemon/daemon.go @@ -224,14 +224,14 @@ func MustNew(cfg *config.Config) *Daemon { } return nil }) + if err != nil { + logger.WithError(err).Fatal("could not obtain txmeta cache from the database") + } if currentSeq != 0 { logger.WithFields(supportlog.F{ "seq": currentSeq, }).Info("finished initializing in-memory store") } - if err != nil { - logger.WithError(err).Fatal("could not obtain txmeta cache from the database") - } onIngestionRetry := func(err error, dur time.Duration) { logger.WithError(err).Error("could not run ingestion. Retrying") diff --git a/cmd/soroban-rpc/internal/db/ledger.go b/cmd/soroban-rpc/internal/db/ledger.go index 1b4b0aa2..e0bf7fd1 100644 --- a/cmd/soroban-rpc/internal/db/ledger.go +++ b/cmd/soroban-rpc/internal/db/ledger.go @@ -49,7 +49,7 @@ func (r ledgerReader) StreamAllLedgers(ctx context.Context, f StreamLedgerFn) er return err } } - return nil + return q.Err() } // GetLedger fetches a single ledger from the db.