diff --git a/platform/fabric/core/generic/delivery/delivery.go b/platform/fabric/core/generic/delivery/delivery.go index ef81bde52..675d35aa0 100644 --- a/platform/fabric/core/generic/delivery/delivery.go +++ b/platform/fabric/core/generic/delivery/delivery.go @@ -32,7 +32,6 @@ import ( var logger = logging.MustGetLogger("fabric-sdk.delivery") var ( - ErrComm = errors.New("communication issue") StartGenesis = &ab.SeekPosition{ Type: &ab.SeekPosition_Oldest{ Oldest: &ab.SeekOldest{}, @@ -84,6 +83,10 @@ type Delivery struct { stop chan error } +var ( + ctr = atomic.Uint32{} +) + func New( networkName string, channelConfig driver.ChannelConfig, @@ -137,16 +140,6 @@ func (d *Delivery) Stop(err error) { close(d.stop) } -var ctr = atomic.Uint32{} - -func (d *Delivery) untilStop() error { - for err := range d.stop { - logger.Infof("Stopping delivery service") - return err - } - return nil -} - func (d *Delivery) Run(ctx context.Context) error { logger.Debugf("Running delivery service [%d]", ctr.Add(1)) if ctx == nil { @@ -278,6 +271,14 @@ func (d *Delivery) runReceiver(ctx context.Context, ch chan<- blockResponse) { } } +func (d *Delivery) untilStop() error { + for err := range d.stop { + logger.Infof("Stopping delivery service") + return err + } + return nil +} + func (d *Delivery) connect(ctx context.Context) (DeliverStream, error) { // first cleanup everything d.cleanup()