fix: invalid indexer flow

Co-authored-by: Gaze <dev@gaze.network>
This commit is contained in:
Gaze
2024-04-17 18:26:07 +07:00
parent f3363313fb
commit a2598e4ef8

View File

@@ -50,10 +50,10 @@ func (i *BitcoinIndexer) Run(ctx context.Context) (err error) {
// set to -1 to start from genesis block
i.currentBlock, err = i.Processor.CurrentBlock(ctx)
if err != nil {
if errors.Is(err, errs.NotFound) {
i.currentBlock.Height = -1
if !errors.Is(err, errs.NotFound) {
return errors.Wrap(err, "can't init state, failed to get indexer current block")
}
return errors.Wrap(err, "can't init state, failed to get indexer current block")
i.currentBlock.Height = -1
}
// TODO: