@@ -867,6 +867,10 @@ func (c *Committer) applyBundle(bundle *channelconfig.Bundle) error {
867867 tlsRootCerts = append (tlsRootCerts , msp .GetTLSRootCerts ()... )
868868 tlsRootCerts = append (tlsRootCerts , msp .GetTLSIntermediateCerts ()... )
869869 for _ , endpoint := range org .Endpoints () {
870+ if len (endpoint ) == 0 {
871+ c .logger .Debugf ("[Channel: %s] empty endpoint for %s, skipping" , c .ChannelConfig .ID (), org .MSPID ())
872+ continue
873+ }
870874 c .logger .Debugf ("[Channel: %s] Adding orderer endpoint: [%s:%s:%s]" , c .ChannelConfig .ID (), org .Name (), org .MSPID (), endpoint )
871875 newOrderers = append (newOrderers , & grpc.ConnectionConfig {
872876 Address : endpoint ,
@@ -877,8 +881,16 @@ func (c *Committer) applyBundle(bundle *channelconfig.Bundle) error {
877881 })
878882 }
879883 // If the Orderer MSP config omits the Endpoints and there is only one orderer org, we try to get the addresses from another key in the channel config.
880- if len (newOrderers ) == 0 && len (orgs ) == 1 {
881- for _ , endpoint := range bundle .ChannelConfig ().OrdererAddresses () {
884+ // This is only here for backwards compatibility and is deprecated in Fabric 3.
885+ // https://hyperledger-fabric.readthedocs.io/en/latest/upgrade_to_newest_version.html#define-ordering-node-endpoint-per-org
886+ addr := bundle .ChannelConfig ().OrdererAddresses ()
887+ if len (newOrderers ) == 0 && len (orgs ) == 1 && len (addr ) > 0 {
888+ c .logger .Infof ("falling back to OrdererAddresses field in channel config (deprecated, please refer to Fabric docs)" )
889+ for _ , endpoint := range addr {
890+ if len (endpoint ) == 0 {
891+ c .logger .Debugf ("[Channel: %s] empty orderer address, skipping" , c .ChannelConfig .ID ())
892+ continue
893+ }
882894 c .logger .Debugf ("[Channel: %s] Adding orderer address [%s:%s:%s]" , c .ChannelConfig .ID (), org .Name (), org .MSPID (), endpoint )
883895 newOrderers = append (newOrderers , & grpc.ConnectionConfig {
884896 Address : endpoint ,
0 commit comments