Skip to content

Commit

Permalink
Fix 'client already started' error on finding common ancestor
Browse files Browse the repository at this point in the history
  • Loading branch information
cffls committed Nov 7, 2024
1 parent 136bb86 commit 1ff9c05
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion zk/datastream/client/stream_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ func (c *StreamClient) GetL2BlockByNumber(blockNum uint64) (fullBLock *types.Ful
if fullBLock, err = c.getL2BlockByNumber(blockNum); err == nil {
break
}
if !errors.Is(err, ErrSocket) {

if errors.Is(err, types.ErrAlreadyStarted) {
// if the client is already started, we can stop the client and try again
c.Stop()
} else if !errors.Is(err, ErrSocket) {
return nil, fmt.Errorf("getL2BlockByNumber: %w", err)
}

Expand Down

0 comments on commit 1ff9c05

Please sign in to comment.