Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
ref impl: rename mergeSub to handleUnsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
protolambda committed Jan 19, 2022
1 parent ae12199 commit 15beb19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions opnode/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (c *OpNodeCmd) RunNode() {
c.log.Info("Starting OpNode")

var unsub []func()
mergeSub := func(sub ethereum.Subscription, errMsg string) {
handleUnsubscribe := func(sub ethereum.Subscription, errMsg string) {
unsub = append(unsub, sub.Unsubscribe)
go func() {
err, ok := <-sub.Err()
Expand Down Expand Up @@ -182,7 +182,7 @@ func (c *OpNodeCmd) RunNode() {
l1HeadsFeed.Subscribe(l1SubCh)
// start driving engine: sync blocks by deriving them from L1 and driving them into the engine
engDriveSub := eng.Drive(c.ctx, c.l1Downloader, l1SubCh)
mergeSub(engDriveSub, "engine driver unexpectedly failed")
handleUnsubscribe(engDriveSub, "engine driver unexpectedly failed")
}

// Keep subscribed to the L1 heads, which keeps the L1 maintainer pointing to the best headers to sync
Expand All @@ -194,7 +194,7 @@ func (c *OpNodeCmd) RunNode() {
l1HeadsFeed.Send(sig)
})
})
mergeSub(l1HeadsSub, "l1 heads subscription failed")
handleUnsubscribe(l1HeadsSub, "l1 heads subscription failed")

// subscribe to L1 heads for info
l1Heads := make(chan eth.HeadSignal, 10)
Expand Down

0 comments on commit 15beb19

Please sign in to comment.