/** * Returns <code>true</code> if the packet uses a protocol version that is compatible * with this I2P-Bote version, <code>false</code> otherwise. */ public boolean isProtocolVersionOk() { // everything above 4 is backwards compatible, everything below 4 is incompatible return getProtocolVersion() >= 4; }
/** * @param peer * @param packet A packet received from a peer */ public void update(Destination peer, I2PBotePacket packet) { if (packet.isProtocolVersionOk()) unban(peer); else ban(peer, new BanReason(WRONG_PROTO_VER, "" + packet.getProtocolVersion())); } }