Delete "old" peer from in-memory known peer cache too

This commit is contained in:
catbref 2020-06-04 10:57:49 +01:00
parent 5ad2bc1940
commit d77acd9eb9

View File

@ -1001,6 +1001,9 @@ public class Network {
for (PeerData peerData : peers) {
LOGGER.debug(() -> String.format("Deleting old peer %s from repository", peerData.getAddress().toString()));
repository.getNetworkRepository().delete(peerData.getAddress());
// Delete from known peer cache too
this.allKnownPeers.remove(peerData);
}
repository.saveChanges();