Skip to content

Commit

Permalink
Merge "[FAB-3636] Check the error, associating id to cert"
Browse files Browse the repository at this point in the history
  • Loading branch information
hacera-jonathan authored and Gerrit Code Review committed May 4, 2017
2 parents 8fbd4ea + c7d93ff commit f2e94b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion gossip/comm/comm_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ func NewCommInstanceWithServer(port int, idMapper identity.Mapper, peerIdentity
subscriptions: make([]chan proto.ReceivedMessage, 0),
}
commInst.connStore = newConnStore(commInst, commInst.logger)
commInst.idMapper.Put(idMapper.GetPKIidOfCert(peerIdentity), peerIdentity)
if err := commInst.idMapper.Put(idMapper.GetPKIidOfCert(peerIdentity), peerIdentity); err != nil {
commInst.logger.Panic("Failed associating self PKIID to cert:", err)
}

if port > 0 {
commInst.stopWG.Add(1)
Expand Down
4 changes: 3 additions & 1 deletion gossip/service/gossip_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ func InitGossipServiceCustomDeliveryFactory(peerIdentity []byte, endpoint string
logger.Info("Initialize gossip with endpoint", endpoint, "and bootstrap set", bootPeers)

idMapper := identity.NewIdentityMapper(mcs)
idMapper.Put(mcs.GetPKIidOfCert(peerIdentity), peerIdentity)
if err := idMapper.Put(mcs.GetPKIidOfCert(peerIdentity), peerIdentity); err != nil {
logger.Panic("Failed associating self PKIID to cert:", err)
}

gossip := integration.NewGossipComponent(peerIdentity, endpoint, s, secAdv,
mcs, idMapper, secureDialOpts, bootPeers...)
Expand Down

0 comments on commit f2e94b3

Please sign in to comment.