wire: remove our own blinded payments patch since it's in spec.

Since this was merged, `make extract-peer-csv` was broken!

But the field names changed:
1. `tlv_update_add_tlvs` -> `tlv_update_add_htlc_tlvs`
2. `blinding` -> `blinding_point`.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-05-22 10:21:44 +09:30
parent 244217f921
commit e51460be28
4 changed files with 14 additions and 29 deletions

View File

@@ -689,20 +689,20 @@ static void handle_peer_add_htlc(struct peer *peer, const u8 *msg)
u8 onion_routing_packet[TOTAL_PACKET_SIZE(ROUTING_INFO_SIZE)];
enum channel_add_err add_err;
struct htlc *htlc;
struct tlv_update_add_tlvs *tlvs;
struct tlv_update_add_htlc_tlvs *tlvs;
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 && !feature_offered(peer->our_features->bits[INIT_FEATURE],
OPT_ROUTE_BLINDING))) {
|| (tlvs->blinding_point && !feature_offered(peer->our_features->bits[INIT_FEATURE],
OPT_ROUTE_BLINDING))) {
peer_failed_warn(peer->pps, &peer->channel_id,
"Bad peer_add_htlc %s", tal_hex(msg, msg));
}
add_err = channel_add_htlc(peer->channel, REMOTE, id, amount,
cltv_expiry, &payment_hash,
onion_routing_packet, tlvs->blinding, &htlc, NULL,
onion_routing_packet, tlvs->blinding_point, &htlc, NULL,
/* We don't immediately fail incoming htlcs,
* instead we wait and fail them after
* they've been committed */
@@ -2416,11 +2416,11 @@ static void resend_commitment(struct peer *peer, struct changed_htlc *last)
last[i].id);
if (h->state == SENT_ADD_COMMIT) {
struct tlv_update_add_tlvs *tlvs;
struct tlv_update_add_htlc_tlvs *tlvs;
if (h->blinding) {
tlvs = tlv_update_add_tlvs_new(tmpctx);
tlvs->blinding = tal_dup(tlvs, struct pubkey,
h->blinding);
tlvs = tlv_update_add_htlc_tlvs_new(tmpctx);
tlvs->blinding_point = tal_dup(tlvs, struct pubkey,
h->blinding);
} else
tlvs = NULL;
msg = towire_update_add_htlc(NULL, &peer->channel_id,
@@ -3294,7 +3294,7 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
const char *failstr;
struct amount_sat htlc_fee;
struct pubkey *blinding;
struct tlv_update_add_tlvs *tlvs;
struct tlv_update_add_htlc_tlvs *tlvs;
if (!peer->channel_ready[LOCAL] || !peer->channel_ready[REMOTE])
status_failed(STATUS_FAIL_MASTER_IO,
@@ -3306,8 +3306,8 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
master_badmsg(WIRE_CHANNELD_OFFER_HTLC, inmsg);
if (blinding) {
tlvs = tlv_update_add_tlvs_new(tmpctx);
tlvs->blinding = tal_dup(tlvs, struct pubkey, blinding);
tlvs = tlv_update_add_htlc_tlvs_new(tmpctx);
tlvs->blinding_point = tal_dup(tlvs, struct pubkey, blinding);
} else
tlvs = NULL;

View File

@@ -1,14 +0,0 @@
diff --git a/wire/extracted_peer_wire_csv b/wire/extracted_peer_wire_csv
index 5a2a8c23f..7b26242e3 100644
--- a/wire/extracted_peer_wire_csv
+++ b/wire/extracted_peer_wire_csv
@@ -95,6 +95,9 @@ msgdata,update_add_htlc,amount_msat,u64,
msgdata,update_add_htlc,payment_hash,sha256,
msgdata,update_add_htlc,cltv_expiry,u32,
msgdata,update_add_htlc,onion_routing_packet,byte,1366
+msgdata,update_add_htlc,tlvs,update_add_tlvs,
+tlvtype,update_add_tlvs,blinding,0
+tlvdata,update_add_tlvs,blinding,blinding,point,
msgtype,update_fulfill_htlc,130
msgdata,update_fulfill_htlc,channel_id,channel_id,
msgdata,update_fulfill_htlc,id,u64,

View File

@@ -226,9 +226,8 @@ msgdata,update_add_htlc,amount_msat,u64,
msgdata,update_add_htlc,payment_hash,sha256,
msgdata,update_add_htlc,cltv_expiry,u32,
msgdata,update_add_htlc,onion_routing_packet,byte,1366
msgdata,update_add_htlc,tlvs,update_add_tlvs,
tlvtype,update_add_tlvs,blinding,0
tlvdata,update_add_tlvs,blinding,blinding,point,
tlvtype,update_add_htlc_tlvs,blinding_point,0
tlvdata,update_add_htlc_tlvs,blinding_point,blinding,point,
msgtype,update_fulfill_htlc,130
msgdata,update_fulfill_htlc,channel_id,channel_id,
msgdata,update_fulfill_htlc,id,u64,
1 msgtype,init,16
226 msgdata,update_add_htlc,payment_hash,sha256,
227 msgdata,update_add_htlc,cltv_expiry,u32,
228 msgdata,update_add_htlc,onion_routing_packet,byte,1366
229 msgdata,update_add_htlc,tlvs,update_add_tlvs, tlvtype,update_add_htlc_tlvs,blinding_point,0
230 tlvtype,update_add_tlvs,blinding,0 tlvdata,update_add_htlc_tlvs,blinding_point,blinding,point,
tlvdata,update_add_tlvs,blinding,blinding,point,
231 msgtype,update_fulfill_htlc,130
232 msgdata,update_fulfill_htlc,channel_id,channel_id,
233 msgdata,update_fulfill_htlc,id,u64,

View File

@@ -222,7 +222,7 @@ struct msg_update_add_htlc {
u32 expiry;
struct sha256 payment_hash;
u8 onion_routing_packet[TOTAL_PACKET_SIZE(ROUTING_INFO_SIZE)];
struct tlv_update_add_tlvs *tlvs;
struct tlv_update_add_htlc_tlvs *tlvs;
};
struct msg_update_fee {
struct channel_id channel_id;