mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
wireaddr: update bolt version, remove 'padding' from addresses.
Nobody used this, so it was removed from the spec. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
2
Makefile
2
Makefile
@@ -9,7 +9,7 @@ CCANDIR := ccan
|
|||||||
|
|
||||||
# Where we keep the BOLT RFCs
|
# Where we keep the BOLT RFCs
|
||||||
BOLTDIR := ../lightning-rfc/
|
BOLTDIR := ../lightning-rfc/
|
||||||
BOLTVERSION := b6ae60d24138a3601561fbc1c9d82d983595ae4f
|
BOLTVERSION := 8516beb2c4fe6fc19bb4b1824b1635ae13805f49
|
||||||
|
|
||||||
-include config.vars
|
-include config.vars
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ bool wireaddr_is_wildcard(const struct wireaddr *addr)
|
|||||||
case ADDR_TYPE_IPV6:
|
case ADDR_TYPE_IPV6:
|
||||||
case ADDR_TYPE_IPV4:
|
case ADDR_TYPE_IPV4:
|
||||||
return memeqzero(addr->addr, addr->addrlen);
|
return memeqzero(addr->addr, addr->addrlen);
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
case ADDR_TYPE_TOR_V2:
|
case ADDR_TYPE_TOR_V2:
|
||||||
case ADDR_TYPE_TOR_V3:
|
case ADDR_TYPE_TOR_V3:
|
||||||
return false;
|
return false;
|
||||||
@@ -229,8 +228,6 @@ char *fmt_wireaddr_without_port(const tal_t * ctx, const struct wireaddr *a)
|
|||||||
case ADDR_TYPE_TOR_V3:
|
case ADDR_TYPE_TOR_V3:
|
||||||
return tal_fmt(ctx, "%s.onion",
|
return tal_fmt(ctx, "%s.onion",
|
||||||
b32_encode(tmpctx, a->addr, a->addrlen));
|
b32_encode(tmpctx, a->addr, a->addrlen));
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hex = tal_hexstr(ctx, a->addr, a->addrlen);
|
hex = tal_hexstr(ctx, a->addr, a->addrlen);
|
||||||
@@ -562,7 +559,6 @@ struct addrinfo *wireaddr_to_addrinfo(const tal_t *ctx,
|
|||||||
return ai;
|
return ai;
|
||||||
case ADDR_TYPE_TOR_V2:
|
case ADDR_TYPE_TOR_V2:
|
||||||
case ADDR_TYPE_TOR_V3:
|
case ADDR_TYPE_TOR_V3:
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
abort();
|
abort();
|
||||||
@@ -587,7 +583,6 @@ bool all_tor_addresses(const struct wireaddr_internal *wireaddr)
|
|||||||
return false;
|
return false;
|
||||||
case ADDR_TYPE_TOR_V2:
|
case ADDR_TYPE_TOR_V2:
|
||||||
case ADDR_TYPE_TOR_V3:
|
case ADDR_TYPE_TOR_V3:
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ struct sockaddr_un;
|
|||||||
*
|
*
|
||||||
* The following `address descriptor` types are defined:
|
* The following `address descriptor` types are defined:
|
||||||
*
|
*
|
||||||
* * `0`: padding; data = none (length 0)
|
|
||||||
* * `1`: ipv4; data = `[4:ipv4_addr][2:port]` (length 6)
|
* * `1`: ipv4; data = `[4:ipv4_addr][2:port]` (length 6)
|
||||||
* * `2`: ipv6; data = `[16:ipv6_addr][2:port]` (length 18)
|
* * `2`: ipv6; data = `[16:ipv6_addr][2:port]` (length 18)
|
||||||
* * `3`: Tor v2 onion service; data = `[10:onion_addr][2:port]` (length 12)
|
* * `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
|
#define LARGEST_ADDRLEN TOR_V3_ADDRLEN
|
||||||
|
|
||||||
enum wire_addr_type {
|
enum wire_addr_type {
|
||||||
ADDR_TYPE_PADDING = 0,
|
|
||||||
ADDR_TYPE_IPV4 = 1,
|
ADDR_TYPE_IPV4 = 1,
|
||||||
ADDR_TYPE_IPV6 = 2,
|
ADDR_TYPE_IPV6 = 2,
|
||||||
ADDR_TYPE_TOR_V2 = 3,
|
ADDR_TYPE_TOR_V2 = 3,
|
||||||
@@ -71,7 +69,6 @@ enum addr_listen_announce {
|
|||||||
ADDR_LISTEN_AND_ANNOUNCE = ADDR_LISTEN|ADDR_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);
|
void towire_wireaddr(u8 **pptr, const struct wireaddr *addr);
|
||||||
bool fromwire_wireaddr(const u8 **cursor, size_t *max, struct wireaddr *addr);
|
bool fromwire_wireaddr(const u8 **cursor, size_t *max, struct wireaddr *addr);
|
||||||
|
|
||||||
|
|||||||
@@ -703,8 +703,6 @@ static void try_connect_one_addr(struct connecting *connect)
|
|||||||
case ADDR_TYPE_IPV6:
|
case ADDR_TYPE_IPV6:
|
||||||
af = AF_INET6;
|
af = AF_INET6;
|
||||||
break;
|
break;
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -852,7 +850,6 @@ static bool handle_wireaddr_listen(struct daemon *daemon,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
case ADDR_TYPE_TOR_V2:
|
case ADDR_TYPE_TOR_V2:
|
||||||
case ADDR_TYPE_TOR_V3:
|
case ADDR_TYPE_TOR_V3:
|
||||||
break;
|
break;
|
||||||
@@ -906,8 +903,6 @@ static void finalize_announcable(struct wireaddr **announcable)
|
|||||||
*
|
*
|
||||||
* The origin node:
|
* The origin node:
|
||||||
*...
|
*...
|
||||||
* - MUST place non-zero typed address descriptors in ascending order.
|
|
||||||
*...
|
|
||||||
* - MUST NOT include more than one `address descriptor` of the same
|
* - MUST NOT include more than one `address descriptor` of the same
|
||||||
* type.
|
* type.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -260,7 +260,6 @@ bool guess_address(struct wireaddr *addr)
|
|||||||
}
|
}
|
||||||
case ADDR_TYPE_TOR_V2:
|
case ADDR_TYPE_TOR_V2:
|
||||||
case ADDR_TYPE_TOR_V3:
|
case ADDR_TYPE_TOR_V3:
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
status_broken("Cannot guess address type %u", addr->type);
|
status_broken("Cannot guess address type %u", addr->type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,8 +207,6 @@ int main(int argc, char *argv[])
|
|||||||
case ADDR_TYPE_IPV6:
|
case ADDR_TYPE_IPV6:
|
||||||
af = AF_INET6;
|
af = AF_INET6;
|
||||||
break;
|
break;
|
||||||
case ADDR_TYPE_PADDING:
|
|
||||||
abort();
|
|
||||||
}
|
}
|
||||||
ai = wireaddr_to_addrinfo(tmpctx, &addr.u.wireaddr);
|
ai = wireaddr_to_addrinfo(tmpctx, &addr.u.wireaddr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1280,10 +1280,6 @@ static struct wireaddr *read_addresses(const tal_t *ctx, const u8 *ser)
|
|||||||
while (cursor && len) {
|
while (cursor && len) {
|
||||||
struct wireaddr wireaddr;
|
struct wireaddr wireaddr;
|
||||||
|
|
||||||
/* Skip any padding */
|
|
||||||
while (len && cursor[0] == ADDR_TYPE_PADDING)
|
|
||||||
fromwire_u8(&cursor, &len);
|
|
||||||
|
|
||||||
/* BOLT #7:
|
/* BOLT #7:
|
||||||
*
|
*
|
||||||
* The final node:
|
* The final node:
|
||||||
|
|||||||
@@ -491,7 +491,7 @@ static void forward_htlc(struct htlc_in *hin,
|
|||||||
*
|
*
|
||||||
* The origin node:
|
* The origin node:
|
||||||
* - SHOULD accept HTLCs that pay a fee equal to or greater than:
|
* - 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,
|
if (mul_overflows_u64(amt_to_forward,
|
||||||
ld->config.fee_per_satoshi)) {
|
ld->config.fee_per_satoshi)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user