diff --git a/Makefile b/Makefile index b6794072b..11f6a2e60 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../lightning-rfc/ -BOLTVERSION := b6ae60d24138a3601561fbc1c9d82d983595ae4f +BOLTVERSION := 8516beb2c4fe6fc19bb4b1824b1635ae13805f49 -include config.vars diff --git a/common/wireaddr.c b/common/wireaddr.c index 648c28424..acf064a57 100644 --- a/common/wireaddr.c +++ b/common/wireaddr.c @@ -182,7 +182,6 @@ bool wireaddr_is_wildcard(const struct wireaddr *addr) case ADDR_TYPE_IPV6: case ADDR_TYPE_IPV4: return memeqzero(addr->addr, addr->addrlen); - case ADDR_TYPE_PADDING: case ADDR_TYPE_TOR_V2: case ADDR_TYPE_TOR_V3: return false; @@ -229,8 +228,6 @@ char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a) case ADDR_TYPE_TOR_V3: return tal_fmt(ctx, "%s.onion", b32_encode(tmpctx, a->addr, a->addrlen)); - case ADDR_TYPE_PADDING: - break; } hex = tal_hexstr(ctx, a->addr, a->addrlen); @@ -562,7 +559,6 @@ struct addrinfo *wireaddr_to_addrinfo(const tal_t *ctx, return ai; case ADDR_TYPE_TOR_V2: case ADDR_TYPE_TOR_V3: - case ADDR_TYPE_PADDING: break; } abort(); @@ -587,7 +583,6 @@ bool all_tor_addresses(const struct wireaddr_internal *wireaddr) return false; case ADDR_TYPE_TOR_V2: case ADDR_TYPE_TOR_V3: - case ADDR_TYPE_PADDING: continue; } } diff --git a/common/wireaddr.h b/common/wireaddr.h index 70e9723f0..da9daf05d 100644 --- a/common/wireaddr.h +++ b/common/wireaddr.h @@ -27,7 +27,6 @@ struct sockaddr_un; * * 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) @@ -46,7 +45,6 @@ struct sockaddr_un; #define LARGEST_ADDRLEN TOR_V3_ADDRLEN enum wire_addr_type { - ADDR_TYPE_PADDING = 0, ADDR_TYPE_IPV4 = 1, ADDR_TYPE_IPV6 = 2, ADDR_TYPE_TOR_V2 = 3, @@ -71,7 +69,6 @@ enum addr_listen_announce { ADDR_LISTEN_AND_ANNOUNCE = ADDR_LISTEN|ADDR_ANNOUNCE }; -/* Inserts a single ADDR_TYPE_PADDING if addr is NULL */ void towire_wireaddr(u8 **pptr, const struct wireaddr *addr); bool fromwire_wireaddr(const u8 **cursor, size_t *max, struct wireaddr *addr); diff --git a/connectd/connectd.c b/connectd/connectd.c index f75fbaf1f..1370f3f42 100644 --- a/connectd/connectd.c +++ b/connectd/connectd.c @@ -703,8 +703,6 @@ static void try_connect_one_addr(struct connecting *connect) case ADDR_TYPE_IPV6: af = AF_INET6; break; - case ADDR_TYPE_PADDING: - break; } } @@ -852,7 +850,6 @@ static bool handle_wireaddr_listen(struct daemon *daemon, return true; } return false; - case ADDR_TYPE_PADDING: case ADDR_TYPE_TOR_V2: case ADDR_TYPE_TOR_V3: break; @@ -906,8 +903,6 @@ static void finalize_announcable(struct wireaddr **announcable) * * The origin node: *... - * - MUST place non-zero typed address descriptors in ascending order. - *... * - MUST NOT include more than one `address descriptor` of the same * type. */ diff --git a/connectd/netaddress.c b/connectd/netaddress.c index 612d6ef12..9f7956e82 100644 --- a/connectd/netaddress.c +++ b/connectd/netaddress.c @@ -260,7 +260,6 @@ bool guess_address(struct wireaddr *addr) } case ADDR_TYPE_TOR_V2: case ADDR_TYPE_TOR_V3: - case ADDR_TYPE_PADDING: status_broken("Cannot guess address type %u", addr->type); break; } diff --git a/devtools/gossipwith.c b/devtools/gossipwith.c index 75de6a0b1..8c6e42abd 100644 --- a/devtools/gossipwith.c +++ b/devtools/gossipwith.c @@ -207,8 +207,6 @@ int main(int argc, char *argv[]) case ADDR_TYPE_IPV6: af = AF_INET6; break; - case ADDR_TYPE_PADDING: - abort(); } ai = wireaddr_to_addrinfo(tmpctx, &addr.u.wireaddr); } diff --git a/gossipd/routing.c b/gossipd/routing.c index 1695744d5..29b3572f0 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -1280,10 +1280,6 @@ static struct wireaddr *read_addresses(const tal_t *ctx, const u8 *ser) while (cursor && len) { struct wireaddr wireaddr; - /* Skip any padding */ - while (len && cursor[0] == ADDR_TYPE_PADDING) - fromwire_u8(&cursor, &len); - /* BOLT #7: * * The final node: diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 8cdcea241..587d56425 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -491,7 +491,7 @@ static void forward_htlc(struct htlc_in *hin, * * The origin node: * - SHOULD accept HTLCs that pay a fee equal to or greater than: - * - fee_base_msat + ( amount_msat * fee_proportional_millionths / 1000000 ) + * - fee_base_msat + ( amount_to_forward * fee_proportional_millionths / 1000000 ) */ if (mul_overflows_u64(amt_to_forward, ld->config.fee_per_satoshi)) {