1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

Remove padding within node_announcement address data

This optional padding makes it very difficulty to deserialize
node_announcements into internal structs for storage and then
reconstruct the original node_announcement, plus are unused on the
network today and no known implementations construct
node_announcement messages with them.
This commit is contained in:
Matt Corallo 2018-08-29 17:37:12 -04:00 committed by Rusty Russell
parent 2b253f7a61
commit 8516beb2c4

View File

@ -238,7 +238,6 @@ appropriate number of bytes for that type.
The following `address descriptor` types are defined:
* `0`: padding; data = none (length 0)
* `1`: ipv4; data = `[4:ipv4_addr][2:port]` (length 6)
* `2`: ipv6; data = `[16:ipv6_addr][2:port]` (length 18)
* `3`: Tor v2 onion service; data = `[10:onion_addr][2:port]` (length 12)
@ -268,8 +267,8 @@ The origin node:
- SHOULD fill `addresses` with an address descriptor for each public network
address that expects incoming connections.
- MUST set `addrlen` to the number of bytes in `addresses`.
- MUST place non-zero typed address descriptors in ascending order.
- MAY place any number of zero-typed address descriptors anywhere.
- MUST place address descriptors in ascending order.
- SHOULD NOT place any zero-typed address descriptors anywhere.
- SHOULD use placement only for aligning fields that follow `addresses`.
- MUST NOT create a `type 1` OR `type 2` address descriptor with `port` equal
to 0.