Skip to content

Commit

Permalink
Tiny gossip comm fix
Browse files Browse the repository at this point in the history
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 <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Nov 17, 2016
1 parent 83d4f2a commit 8c2064e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gossip/comm/comm_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,18 @@ func NewCommInstanceWithServer(port int, sec SecurityProvider, pkID common.PKIid
defer commInst.stopWG.Done()
s.Serve(ll)
}()
}

proto.RegisterGossipServer(s, commInst)
proto.RegisterGossipServer(s, commInst)
}

commInst.logger.SetLevel(logging.WARNING)

time.Sleep(time.Duration(200) * time.Millisecond)

return commInst, nil
}

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

0 comments on commit 8c2064e

Please sign in to comment.