Minor tweak to finalized check

This commit is contained in:
Bruce Riley 2022-06-06 20:47:05 +00:00 committed by Evan Gray
parent d6f4740136
commit cf8c97082b
1 changed files with 5 additions and 8 deletions

View File

@ -189,21 +189,18 @@ func (e *PollImpl) SubscribeForBlocks(ctx context.Context, sink chan<- *common.N
}
}
var finalized bool
if e.Finalizer != nil {
var err error
finalized, err = e.Finalizer.IsBlockFinalized(ctx, block)
finalized, err := e.Finalizer.IsBlockFinalized(ctx, block)
if err != nil {
errorOccurred = true
e.logger.Error("failed to see if block is finalized", zap.String("eth_network", e.BaseEth.NetworkName),
zap.Uint64("block", currentBlockNumber.Uint64()), zap.Error(err))
break
}
} else {
finalized = true
}
if !finalized {
break
if !finalized {
break
}
}
sink <- block