global: we always offer OPT_ROUTE_BLINDING, don't need to test.

We did since v23.05.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-07-09 18:04:44 +09:30 committed by Vincenzo Palazzo
parent 01cd605cb1
commit 162ebe2a72
5 changed files with 2 additions and 23 deletions

View file

@ -618,10 +618,7 @@ static void handle_peer_add_htlc(struct peer *peer, const u8 *msg)
if (!fromwire_update_add_htlc(msg, msg, &channel_id, &id, &amount,
&payment_hash, &cltv_expiry,
onion_routing_packet, &tlvs)
/* This is an *even* field: don't send if we didn't understand */
|| (tlvs->blinding_point && !feature_offered(peer->our_features->bits[INIT_FEATURE],
OPT_ROUTE_BLINDING))) {
onion_routing_packet, &tlvs)) {
peer_failed_warn(peer->pps, &peer->channel_id,
"Bad peer_add_htlc %s", tal_hex(msg, msg));
}

View file

@ -167,7 +167,6 @@ static bool handle_blinded_terminal(struct onion_payload *p,
}
struct onion_payload *onion_decode(const tal_t *ctx,
bool blinding_support,
const struct route_step *rs,
const struct pubkey *blinding,
const u64 *accepted_extra_tlvs,
@ -214,12 +213,6 @@ struct onion_payload *onion_decode(const tal_t *ctx,
if (p->tlv->encrypted_recipient_data) {
struct tlv_encrypted_data_tlv *enc;
/* Only supported with --experimental-onion-messages! */
if (!blinding_support) {
*failtlvtype = TLV_PAYLOAD_ENCRYPTED_RECIPIENT_DATA;
goto field_bad;
}
/* BOLT #4:
*
* - If `blinding_point` is set in the incoming `update_add_htlc`:

View file

@ -8,7 +8,6 @@
/**
* onion_decode: decode payload from a decrypted onion.
* @ctx: context to allocate onion_contents off.
* @blinding_support: --experimental-route-blinding?
* @rs: the route_step, whose raw_payload is of at least length
* onion_payload_length().
* @blinding: the optional incoming blinding point.
@ -21,7 +20,6 @@
* If the payload is not valid, returns NULL.
*/
struct onion_payload *onion_decode(const tal_t *ctx,
bool blinding_support,
const struct route_step *rs,
const struct pubkey *blinding,
const u64 *accepted_extra_tlvs,

View file

@ -935,8 +935,6 @@ static bool htlc_accepted_hook_deserialize(struct htlc_accepted_hook_payload *re
rs->raw_payload = prepend_length(rs, take(payload));
request->payload = onion_decode(request,
feature_offered(ld->our_features->bits[INIT_FEATURE],
OPT_ROUTE_BLINDING),
rs,
hin->blinding,
ld->accept_extra_tlv_types,
@ -1267,9 +1265,6 @@ static bool peer_accepted_htlc(const tal_t *ctx,
struct onionpacket *op;
struct lightningd *ld = channel->peer->ld;
struct htlc_accepted_hook_payload *hook_payload;
const bool opt_blinding
= feature_offered(ld->our_features->bits[INIT_FEATURE],
OPT_ROUTE_BLINDING);
*failmsg = NULL;
@ -1357,8 +1352,6 @@ static bool peer_accepted_htlc(const tal_t *ctx,
hook_payload->route_step = tal_steal(hook_payload, rs);
hook_payload->payload = onion_decode(hook_payload,
feature_offered(ld->our_features->bits[INIT_FEATURE],
OPT_ROUTE_BLINDING),
rs,
hin->blinding,
ld->accept_extra_tlv_types,
@ -1372,8 +1365,7 @@ static bool peer_accepted_htlc(const tal_t *ctx,
hook_payload->next_onion = serialize_onionpacket(hook_payload, rs->next);
/* We could have blinding from hin or from inside onion. */
if (opt_blinding
&& hook_payload->payload && hook_payload->payload->blinding) {
if (hook_payload->payload && hook_payload->payload->blinding) {
struct sha256 sha;
blinding_hash_e_and_ss(hook_payload->payload->blinding,
&hook_payload->payload->blinding_ss,

View file

@ -728,7 +728,6 @@ enum watch_result onchaind_funding_spent(struct channel *channel UNNEEDED,
{ fprintf(stderr, "onchaind_funding_spent called!\n"); abort(); }
/* Generated stub for onion_decode */
struct onion_payload *onion_decode(const tal_t *ctx UNNEEDED,
bool blinding_support UNNEEDED,
const struct route_step *rs UNNEEDED,
const struct pubkey *blinding UNNEEDED,
const u64 *accepted_extra_tlvs UNNEEDED,