Skip to content

Commit

Permalink
[FAB-8688] Gossip onConnect() references wrong field
Browse files Browse the repository at this point in the history
In gossip, when a peer p contacts peer q and tries to connect
to it, while it's already connected to it - q closes the current
connection with p and replaces it with q.

However, the code referenced the identity field instead of the
pki-id field and thus it always replaced the connection,
without closing the previous connection.

Change-Id: I021ce246ce3735aa9e3451f20590fd119737a310
Signed-off-by: yacovm <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Mar 7, 2018
1 parent 8793c73 commit 8292ed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gossip/comm/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (cs *connectionStore) onConnected(serverStream proto.Gossip_GossipStreamSer
cs.Lock()
defer cs.Unlock()

if c, exists := cs.pki2Conn[string(connInfo.Identity)]; exists {
if c, exists := cs.pki2Conn[string(connInfo.ID)]; exists {
c.close()
}

Expand Down

0 comments on commit 8292ed4

Please sign in to comment.