Skip to content

Commit

Permalink
fix: add ctx to reorg detector start function
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed Aug 28, 2024
1 parent 97addb4 commit 755252c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func start(cliCtx *cli.Context) error {
log.Fatal(err)
}

if err = detector.Start(); err != nil {
if err = detector.Start(cliCtx.Context); err != nil {
log.Fatal(err)
}

Expand Down
4 changes: 2 additions & 2 deletions synchronizer/reorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func (rd *ReorgDetector) Subscribe() <-chan BlockReorg {
}

// Start starts the ReorgDetector tracking for reorg events
func (rd *ReorgDetector) Start() error {
func (rd *ReorgDetector) Start(ctx context.Context) error {
log.Info("starting block reorganization detector")

ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := context.WithCancel(ctx)
rd.cancel = cancel

blocks := make(chan *ethgo.Block)
Expand Down

0 comments on commit 755252c

Please sign in to comment.