indra-labs / indra

Distributed Virtual Private Network Powered By Bitcoin Lightning
Creative Commons Zero v1.0 Universal
49 stars 7 forks source link

6 change transportnewlistener to use multiaddrmultiaddr instead of string #14

Closed l0k18 closed 1 year ago

l0k18 commented 1 year ago

This change preserves the existing fixed length based on the size of an IPv6 address, plus one byte length prefix, of 21, and removes all instances of netip.AddrPort in favour of a uniform use of multiaddr.Multiaddr.

It is planned to later properly deal with variable length addresses, since there may be a need for other formats with longer or shorter encodings, but this achieves the main goal of this issue, which is to eliminate the two different ways and make them all follow one.

All tests pass same as prior to the changes. There is a few stray minor things like altering the blinder length in the cloaked receiver public key to 4:4 instead of the prior 3:5.

This change also brings enforcement of the contract of panic with nil onions, required for the later change that will come with the addition of the Offset field to the Crypt.