From d881a4bd66cb09da942faf7dbf93846fee6fc6c7 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 31 Mar 2020 09:08:58 +1030 Subject: [PATCH] BOLT: update to latest version. This is all typo/clarity fixes, no substantive changes. Signed-off-by: Rusty Russell --- Makefile | 2 +- bitcoin/short_channel_id.h | 4 ++-- common/bolt11.c | 2 +- common/gossip_store.c | 1 + connectd/handshake.c | 4 ++-- gossipd/gossipd.c | 3 ++- lightningd/peer_htlcs.c | 2 +- openingd/openingd.c | 4 ++-- 8 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 704c3c69c..25bf664e6 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../lightning-rfc/ -BOLTVERSION := 17df7f2bba4dab844569c3305201606dee800741 +BOLTVERSION := 4107c69e315b4f33d5b00459bef919bcfaa64bf2 -include config.vars diff --git a/bitcoin/short_channel_id.h b/bitcoin/short_channel_id.h index d657c4e0a..fb65ed0b4 100644 --- a/bitcoin/short_channel_id.h +++ b/bitcoin/short_channel_id.h @@ -19,8 +19,8 @@ STRUCTEQ_DEF(short_channel_id, 0, u64); /* BOLT #7: * * - MUST set `node_id_1` and `node_id_2` to the public keys of the two nodes - * operating the channel, such that `node_id_1` is the numerically-lesser of the - * two DER-encoded keys sorted in ascending numerical order. + * operating the channel, such that `node_id_1` is the lexicographically-lesser of the + * two compressed keys sorted in ascending lexicographic order. *... * - if the origin node is `node_id_1` in the message: * - MUST set the `direction` bit of `channel_flags` to 0. diff --git a/common/bolt11.c b/common/bolt11.c index 5efa638ae..c1020c6cf 100644 --- a/common/bolt11.c +++ b/common/bolt11.c @@ -1040,7 +1040,7 @@ char *bolt11_encode_(const tal_t *ctx, * - if a specific minimum `amount` is required for successful payment: * - MUST include that `amount`. * - MUST encode `amount` as a positive decimal integer with no leading 0s. - * - If the `p` multiplier is used the `amount` the last decimal MUST be `0`. + * - If the `p` multiplier is used the last decimal of `amount` MUST be `0`. * - SHOULD use the shortest representation possible, by using the largest multiplier or omitting the multiplier. */ if (b11->msat) { diff --git a/common/gossip_store.c b/common/gossip_store.c index 324c3f7be..800fd1fb8 100644 --- a/common/gossip_store.c +++ b/common/gossip_store.c @@ -34,6 +34,7 @@ void gossip_setup_timestamp_filter(struct per_peer_state *pps, * equal to `first_timestamp`, and less than `first_timestamp` plus * `timestamp_range`. * - MAY wait for the next outgoing gossip flush to send these. + * ... * - SHOULD restrict future gossip messages to those whose `timestamp` * is greater or equal to `first_timestamp`, and less than * `first_timestamp` plus `timestamp_range`. diff --git a/connectd/handshake.c b/connectd/handshake.c index 1db8e3126..66480c2bd 100644 --- a/connectd/handshake.c +++ b/connectd/handshake.c @@ -425,11 +425,11 @@ static struct handshake *new_handshake(const tal_t *ctx, * into the handshake digest: * * * The initiating node mixes in the responding node's static public - * key serialized in Bitcoin's DER-compressed format: + * key serialized in Bitcoin's compressed format: * * `h = SHA-256(h || rs.pub.serializeCompressed())` * * * The responding node mixes in their local static public key - * serialized in Bitcoin's DER-compressed format: + * serialized in Bitcoin's compressed format: * * `h = SHA-256(h || ls.pub.serializeCompressed())` */ sha_mix_in_key(&handshake->h, responder_id); diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index 882cbbed5..88b6f80da 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -613,7 +613,8 @@ static struct io_plan *connectd_new_peer(struct io_conn *conn, * * A node: * - if the `gossip_queries` feature is negotiated: - * - MUST NOT relay any gossip messages unless explicitly requested. + * - MUST NOT relay any gossip messages it did not generate itself, + * unless explicitly requested. */ if (peer->gossip_queries_feature) { gs = NULL; diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index a5a9994e0..28bc375c0 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -327,7 +327,7 @@ static void fail_out_htlc(struct htlc_out *hout, * * Where `fee` is calculated according to the receiving peer's * advertised fee schema (as described in [BOLT - * #7](07-routing-gossip.md#htlc-fees). + * #7](07-routing-gossip.md#htlc-fees)). */ static bool check_fwd_amount(struct htlc_in *hin, struct amount_msat amt_to_forward, diff --git a/openingd/openingd.c b/openingd/openingd.c index c392b25d3..f74eabe75 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -561,7 +561,7 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags) *... * - `funding_pubkey`, `revocation_basepoint`, `htlc_basepoint`, * `payment_basepoint`, or `delayed_payment_basepoint` are not - * valid DER-encoded compressed secp256k1 pubkeys. + * valid secp256k1 pubkeys in compressed format. */ if (feature_negotiated(state->features, OPT_UPFRONT_SHUTDOWN_SCRIPT)) { @@ -902,7 +902,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg) *... * - `funding_pubkey`, `revocation_basepoint`, `htlc_basepoint`, * `payment_basepoint`, or `delayed_payment_basepoint` are not valid - * DER-encoded compressed secp256k1 pubkeys. + * secp256k1 pubkeys in compressed format. */ if (feature_negotiated(state->features, OPT_UPFRONT_SHUTDOWN_SCRIPT)) {