From 89201de40e327a76599ff17700baa3d209a86473 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Thu, 18 Feb 2016 01:17:36 +0100 Subject: [PATCH] Fix missing removal of map entry --- .../p2p/peers/peerexchange/PeerExchangeManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/network/src/main/java/io/bitsquare/p2p/peers/peerexchange/PeerExchangeManager.java b/network/src/main/java/io/bitsquare/p2p/peers/peerexchange/PeerExchangeManager.java index 31c1348f2d..e551707dfd 100644 --- a/network/src/main/java/io/bitsquare/p2p/peers/peerexchange/PeerExchangeManager.java +++ b/network/src/main/java/io/bitsquare/p2p/peers/peerexchange/PeerExchangeManager.java @@ -88,10 +88,15 @@ public class PeerExchangeManager implements MessageListener, ConnectionListener @Override public void onConnection(Connection connection) { + if (connection.getPeersNodeAddressOptional().isPresent()) + peerExchangeHandlerMap.remove(connection.getPeersNodeAddressOptional().get().getFullAddress()); } @Override public void onDisconnect(CloseConnectionReason closeConnectionReason, Connection connection) { + if (connection.getPeersNodeAddressOptional().isPresent()) + peerExchangeHandlerMap.remove(connection.getPeersNodeAddressOptional().get().getFullAddress()); + boolean lostAllConnections = networkNode.getAllConnections().isEmpty(); if (lostAllConnections || connectToMorePeersTimer == null) { long delaySec = lostAllConnections ? RETRY_DELAY_AFTER_ALL_CON_LOST_SEC : RETRY_DELAY_SEC;