From 8292ed45a96347d5b6bf334cc77f4da2e9ec1460 Mon Sep 17 00:00:00 2001 From: yacovm Date: Wed, 7 Mar 2018 18:00:59 +0200 Subject: [PATCH] [FAB-8688] Gossip onConnect() references wrong field 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 --- gossip/comm/conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gossip/comm/conn.go b/gossip/comm/conn.go index b0d7b327a3a..af5254d1e8e 100644 --- a/gossip/comm/conn.go +++ b/gossip/comm/conn.go @@ -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() }