Skip to content

Commit

Permalink
Merge branch 'master' into fix/block-acquisition
Browse files Browse the repository at this point in the history
[goreleaser]
  • Loading branch information
trajan0x committed Jul 8, 2024
2 parents bd22f55 + 31b5f8f commit a15576b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
11 changes: 7 additions & 4 deletions services/cctp-relayer/relayer/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package relayer

import (
"context"
"errors"
"fmt"
"sync"
"time"
Expand Down Expand Up @@ -304,11 +305,13 @@ func (c *CCTPRelayer) Run(parentCtx context.Context) error {
})

g.Go(func() error {
err := c.txSubmitter.Start(ctx)
if err != nil {
err = fmt.Errorf("could not start tx submitter: %w", err)
if !c.txSubmitter.Started() {
err := c.txSubmitter.Start(ctx)
if err != nil && !errors.Is(err, submitter.ErrSubmitterAlreadyStarted) {
return fmt.Errorf("could not start tx submitter: %w", err)
}
}
return err
return nil
})

g.Go(func() error {
Expand Down
10 changes: 7 additions & 3 deletions services/rfq/relayer/service/relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package service

import (
"context"
"errors"
"fmt"
"math/big"
"sync"
Expand Down Expand Up @@ -237,9 +238,12 @@ func (r *Relayer) Start(ctx context.Context) (err error) {
})

g.Go(func() error {
err := r.submitter.Start(ctx)
if err != nil {
return fmt.Errorf("could not start submitter: %w", err)
if !r.submitter.Started() {
err := r.submitter.Start(ctx)
if err != nil && !errors.Is(err, submitter.ErrSubmitterAlreadyStarted) {
return fmt.Errorf("could not start submitter: %w", err)
}
return nil
}
return nil
})
Expand Down

0 comments on commit a15576b

Please sign in to comment.