When adding new Node clear any dangling Connection objects to its address

This commit is contained in:
Simon Walton 2019-03-20 15:45:06 -07:00
parent 4ac25121e0
commit 8947d4d133

View file

@ -677,6 +677,9 @@ SharedNodePointer LimitedNodeList::addOrUpdateNode(const QUuid& uuid, NodeType_t
// If there is a new node with the same socket, this is a reconnection, kill the old node
removeOldNode(findNodeWithAddr(publicSocket));
removeOldNode(findNodeWithAddr(localSocket));
// If there is an old Connection to the new node's address kill it
_nodeSocket.cleanupConnection(publicSocket);
_nodeSocket.cleanupConnection(localSocket);
auto it = _connectionIDs.find(uuid);
if (it == _connectionIDs.end()) {