@@ -31,7 +31,6 @@ import (
3131 "github.com/hyperledger/fabric/gossip/integration"
3232 "github.com/hyperledger/fabric/gossip/state"
3333 "github.com/hyperledger/fabric/gossip/util"
34- peergossip "github.com/hyperledger/fabric/peer/gossip"
3534 "github.com/hyperledger/fabric/protos/common"
3635 proto "github.com/hyperledger/fabric/protos/gossip"
3736 "github.com/spf13/viper"
@@ -121,17 +120,17 @@ func (jcm *joinChannelMessage) AnchorPeersOf(org api.OrgIdentityType) []api.Anch
121120var logger = util .GetLogger (util .LoggingServiceModule , "" )
122121
123122// InitGossipService initialize gossip service
124- func InitGossipService (peerIdentity []byte , endpoint string , s * grpc.Server , mcs api.MessageCryptoService , bootPeers ... string ) {
123+ func InitGossipService (peerIdentity []byte , endpoint string , s * grpc.Server , mcs api.MessageCryptoService , secAdv api. SecurityAdvisor , bootPeers ... string ) {
125124 // TODO: Remove this.
126125 // TODO: This is a temporary work-around to make the gossip leader election module load its logger at startup
127126 // TODO: in order for the flogging package to register this logger in time so it can set the log levels as requested in the config
128127 util .GetLogger (util .LoggingElectionModule , "" )
129- InitGossipServiceCustomDeliveryFactory (peerIdentity , endpoint , s , & deliveryFactoryImpl {}, mcs , bootPeers ... )
128+ InitGossipServiceCustomDeliveryFactory (peerIdentity , endpoint , s , & deliveryFactoryImpl {}, mcs , secAdv , bootPeers ... )
130129}
131130
132131// InitGossipServiceCustomDeliveryFactory initialize gossip service with customize delivery factory
133132// implementation, might be useful for testing and mocking purposes
134- func InitGossipServiceCustomDeliveryFactory (peerIdentity []byte , endpoint string , s * grpc.Server , factory DeliveryServiceFactory , mcs api.MessageCryptoService , bootPeers ... string ) {
133+ func InitGossipServiceCustomDeliveryFactory (peerIdentity []byte , endpoint string , s * grpc.Server , factory DeliveryServiceFactory , mcs api.MessageCryptoService , secAdv api. SecurityAdvisor , bootPeers ... string ) {
135134 once .Do (func () {
136135 logger .Info ("Initialize gossip with endpoint" , endpoint , "and bootstrap set" , bootPeers )
137136 dialOpts := []grpc.DialOption {}
@@ -141,8 +140,6 @@ func InitGossipServiceCustomDeliveryFactory(peerIdentity []byte, endpoint string
141140 dialOpts = append (dialOpts , grpc .WithInsecure ())
142141 }
143142
144- secAdv := peergossip .NewSecurityAdvisor ()
145-
146143 if overrideEndpoint := viper .GetString ("peer.gossip.endpoint" ); overrideEndpoint != "" {
147144 endpoint = overrideEndpoint
148145 }
0 commit comments