diff --git a/core/deliverservice/blocksprovider/blocksprovider.go b/core/deliverservice/blocksprovider/blocksprovider.go index 9993b1d6768..c385e3ca16c 100644 --- a/core/deliverservice/blocksprovider/blocksprovider.go +++ b/core/deliverservice/blocksprovider/blocksprovider.go @@ -191,7 +191,9 @@ func (b *blocksProviderImpl) DeliverBlocks() { // Gossip messages with other nodes logger.Debugf("[%s] Gossiping block [%d], peers number [%d]", b.chainID, seqNum, numberOfPeers) - b.gossip.Gossip(gossipMsg) + if !b.isDone() { + b.gossip.Gossip(gossipMsg) + } default: logger.Warningf("[%s] Received unknown: ", b.chainID, t) return diff --git a/core/deliverservice/client.go b/core/deliverservice/client.go index 2cc2b4ad198..4a72b8b6435 100644 --- a/core/deliverservice/client.go +++ b/core/deliverservice/client.go @@ -100,9 +100,9 @@ func (bc *broadcastClient) try(action func() (interface{}, error)) (interface{}, return resp, nil } if bc.shouldStop() { - return nil, errors.New("Client is closing") + return nil, errors.New("client is closing") } - return nil, fmt.Errorf("Attempts (%d) or elapsed time (%v) exhausted", attempt, totalRetryTime) + return nil, fmt.Errorf("attempts (%d) or elapsed time (%v) exhausted", attempt, totalRetryTime) } func (bc *broadcastClient) doAction(action func() (interface{}, error)) (interface{}, error) { diff --git a/core/deliverservice/client_test.go b/core/deliverservice/client_test.go index 971a1d62b67..44620157f25 100644 --- a/core/deliverservice/client_test.go +++ b/core/deliverservice/client_test.go @@ -516,7 +516,7 @@ func TestCloseWhileRecv(t *testing.T) { assert.Equal(t, int32(1), atomic.LoadInt32(&flag), "Recv returned before bc.Close() was called") assert.Nil(t, resp) assert.Error(t, err) - assert.Contains(t, "Client is closing", err.Error()) + assert.Contains(t, "client is closing", err.Error()) } func TestCloseWhileSleep(t *testing.T) { diff --git a/core/deliverservice/deliveryclient.go b/core/deliverservice/deliveryclient.go index 255a55808e2..37fa7c5f1d2 100644 --- a/core/deliverservice/deliveryclient.go +++ b/core/deliverservice/deliveryclient.go @@ -126,19 +126,19 @@ func (d *deliverServiceImpl) UpdateEndpoints(chainID string, endpoints []string) func (d *deliverServiceImpl) validateConfiguration() error { conf := d.conf if len(conf.Endpoints) == 0 { - return errors.New("No endpoints specified") + return errors.New("no endpoints specified") } if conf.Gossip == nil { - return errors.New("No gossip provider specified") + return errors.New("no gossip provider specified") } if conf.ABCFactory == nil { - return errors.New("No AtomicBroadcast factory specified") + return errors.New("no AtomicBroadcast factory specified") } if conf.ConnFactory == nil { - return errors.New("No connection factory specified") + return errors.New("no connection factory specified") } if conf.CryptoSvc == nil { - return errors.New("No crypto service specified") + return errors.New("no crypto service specified") } return nil } @@ -256,7 +256,7 @@ func DefaultConnectionFactory(channelID string) func(endpoint string) (*grpc.Cli if viper.GetBool("peer.tls.enabled") { creds, err := comm.GetCredentialSupport().GetDeliverServiceCredentials(channelID) if err != nil { - return nil, fmt.Errorf("Failed obtaining credentials for channel %s: %v", channelID, err) + return nil, fmt.Errorf("failed obtaining credentials for channel %s: %v", channelID, err) } dialOpts = append(dialOpts, grpc.WithTransportCredentials(creds)) } else {