/** * Returns <code>true</code> if a peer exists in the bucket. * @param destination * @return */ boolean contains(Destination destination) { return getPeer(destination) != null; }
/** * Looks up a <code>KademliaPeer</code> by I2P destination. If no bucket * (k or s-bucket) contains the peer, <code>null</code> is returned. * @param destination * @return */ private KademliaPeer getPeer(Destination destination) { AbstractBucket bucket = getBucket(destination); if (bucket != null) return bucket.getPeer(destination); else return null; }