PeerAddress: Add I2P hostname parsing (WIP)

Note: this is not verified as correct encoding yet.
This commit is contained in:
Sean Gilligan 2022-08-19 03:21:25 -07:00
parent 94ad7dd344
commit c0ba6a9f53

View file

@ -282,6 +282,11 @@ public class PeerAddress extends ChildMessage {
addr = null; addr = null;
break; break;
case I2P: case I2P:
if (addrLen != 32)
throw new ProtocolException("invalid length of I2P address: " + addrLen);
hostname = BASE32.encode(addrBytes).replace("=","") + ".b32.i2p";
addr = null;
break;
case CJDNS: case CJDNS:
// ignore unimplemented network IDs for now // ignore unimplemented network IDs for now
addr = null; addr = null;