Skip to content

Commit 8c2064e

Browse files
committed
Tiny gossip comm fix
Fixed a case only relevant for gossip integration with the peer. The RegisterGossipServer invocation on line 107 should be skipped if an external gRPC server is provided since it's registered on line 123 Change-Id: Ie7a730a7aef1e9e00cc8db1af44713b69a37efb6 Signed-off-by: Yacov Manevich <[email protected]>
1 parent 83d4f2a commit 8c2064e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

gossip/comm/comm_impl.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -101,20 +101,18 @@ func NewCommInstanceWithServer(port int, sec SecurityProvider, pkID common.PKIid
101101
defer commInst.stopWG.Done()
102102
s.Serve(ll)
103103
}()
104-
}
105104

106-
proto.RegisterGossipServer(s, commInst)
105+
proto.RegisterGossipServer(s, commInst)
106+
}
107107

108108
commInst.logger.SetLevel(logging.WARNING)
109109

110-
time.Sleep(time.Duration(200) * time.Millisecond)
111-
112110
return commInst, nil
113111
}
114112

115113
// NewCommInstance creates a new comm instance that binds itself to the given gRPC server
116114
func NewCommInstance(s *grpc.Server, sec SecurityProvider, PKIID common.PKIidType, dialOpts ...grpc.DialOption) (Comm, error) {
117-
commInst, err := NewCommInstanceWithServer(-1, sec, PKIID)
115+
commInst, err := NewCommInstanceWithServer(-1, sec, PKIID, dialOpts ...)
118116
if err != nil {
119117
return nil, err
120118
}

0 commit comments

Comments
 (0)