@Override public KademliaOverlayID getOverlayID(SkyNetID skyNetID) { BigDecimal dec = skyNetID.getID().multiply(upperBound); BigInteger kademliaOverlayID = null; try { kademliaOverlayID = dec.toBigIntegerExact(); } catch (Exception e) { log.fatal("Unable to create exact integer out of " + dec.toPlainString()); } return new KademliaOverlayID(kademliaOverlayID.subtract(BigInteger.ONE), config); }
@Override public KademliaOverlayKey getOverlayKey(SkyNetID skyNetKey) { BigInteger kademliaOverlayKey = skyNetKey.getID().multiply(upperBound).toBigIntegerExact(); return new KademliaOverlayKey(kademliaOverlayKey.subtract(BigInteger.ONE), config); }