From: David ‘Bombe’ Roden Date: Thu, 19 Mar 2009 22:05:48 +0000 (+0100) Subject: End getPeerNote() on “EndListPeerNotes” message and only store the peer note we’re... X-Git-Tag: v0.1.1~78 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=c8465d7012830ae5867e228bd055fc7b93cafcd6;p=jFCPlib.git End getPeerNote() on “EndListPeerNotes” message and only store the peer note we’re interested in. --- diff --git a/src/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/net/pterodactylus/fcp/highlevel/FcpClient.java index a30218e..90ad4da 100644 --- a/src/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -30,6 +30,7 @@ import java.util.concurrent.CountDownLatch; import net.pterodactylus.fcp.AddPeer; import net.pterodactylus.fcp.ClientHello; import net.pterodactylus.fcp.CloseConnectionDuplicateClientName; +import net.pterodactylus.fcp.EndListPeerNotes; import net.pterodactylus.fcp.EndListPeers; import net.pterodactylus.fcp.FcpAdapter; import net.pterodactylus.fcp.FcpConnection; @@ -428,7 +429,17 @@ public class FcpClient { */ @Override public void receivedPeerNote(FcpConnection fcpConnection, PeerNote peerNote) { - objectWrapper.set(peerNote); + if (peerNote.getNodeIdentifier().equals(peer.getIdentity())) { + objectWrapper.set(peerNote); + } + } + + /** + * {@inheritDoc} + */ + @Override + public void receivedEndListPeerNotes(FcpConnection fcpConnection, EndListPeerNotes endListPeerNotes) { + completionLatch.countDown(); } }.execute(); return objectWrapper.get();