/** * 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; }
public void remove(Destination peer) { AbstractBucket bucket = getBucket(peer); if (bucket != null) { bucket.remove(peer); if (bucket instanceof SBucket) refillSiblings(); } else log.debug("Can't remove peer because no bucket contains it: " + Util.toBase32(peer)); }