Skip to content

Commit

Permalink
close channel after pushing sidecar once
Browse files Browse the repository at this point in the history
Signed-off-by: Pranay Valson <[email protected]>
  • Loading branch information
noslav committed Apr 17, 2024
1 parent e326c4a commit af0fe96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ var (
errBlockInterruptedByTimeout = errors.New("timeout while building block")
)

var BlobTxSidecarChan = make(chan *types.BlobTxSidecarData, 1000)
var enableBlobTxSidecar bool
var closeOnce sync.Once

// environment is the worker's current environment and holds all
// information of the sealing block generation.
Expand Down Expand Up @@ -128,7 +128,9 @@ func (env *environment) copy() *environment {
}
}
log.Info("Closing Chain Sync BlobTxSidecar Channel For", "Block Number:", env.header.Number.Uint64(), "Length:", len(types.BlobTxSidecarChan))
close(types.BlobTxSidecarChan)
closeOnce.Do(func() {
close(types.BlobTxSidecarChan)
})
}()
}

Expand Down

0 comments on commit af0fe96

Please sign in to comment.