@@ -31,7 +31,6 @@ import (
31
31
"github.com/hyperledger/fabric/gossip/integration"
32
32
"github.com/hyperledger/fabric/gossip/state"
33
33
"github.com/hyperledger/fabric/gossip/util"
34
- peergossip "github.com/hyperledger/fabric/peer/gossip"
35
34
"github.com/hyperledger/fabric/protos/common"
36
35
proto "github.com/hyperledger/fabric/protos/gossip"
37
36
"github.com/spf13/viper"
@@ -121,17 +120,17 @@ func (jcm *joinChannelMessage) AnchorPeersOf(org api.OrgIdentityType) []api.Anch
121
120
var logger = util .GetLogger (util .LoggingServiceModule , "" )
122
121
123
122
// 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 ) {
125
124
// TODO: Remove this.
126
125
// TODO: This is a temporary work-around to make the gossip leader election module load its logger at startup
127
126
// 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
128
127
util .GetLogger (util .LoggingElectionModule , "" )
129
- InitGossipServiceCustomDeliveryFactory (peerIdentity , endpoint , s , & deliveryFactoryImpl {}, mcs , bootPeers ... )
128
+ InitGossipServiceCustomDeliveryFactory (peerIdentity , endpoint , s , & deliveryFactoryImpl {}, mcs , secAdv , bootPeers ... )
130
129
}
131
130
132
131
// InitGossipServiceCustomDeliveryFactory initialize gossip service with customize delivery factory
133
132
// 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 ) {
135
134
once .Do (func () {
136
135
logger .Info ("Initialize gossip with endpoint" , endpoint , "and bootstrap set" , bootPeers )
137
136
dialOpts := []grpc.DialOption {}
@@ -141,8 +140,6 @@ func InitGossipServiceCustomDeliveryFactory(peerIdentity []byte, endpoint string
141
140
dialOpts = append (dialOpts , grpc .WithInsecure ())
142
141
}
143
142
144
- secAdv := peergossip .NewSecurityAdvisor ()
145
-
146
143
if overrideEndpoint := viper .GetString ("peer.gossip.endpoint" ); overrideEndpoint != "" {
147
144
endpoint = overrideEndpoint
148
145
}
0 commit comments