mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
common: rename tlv_payload's "blinding_point" to "current_blinding_point" as per spec.
Simple rename in a few internal places. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
cc2c720dd9
commit
cfca4e010f
4 changed files with 11 additions and 26 deletions
|
@ -21,7 +21,7 @@ static bool check_nonfinal_tlv(const struct tlv_payload *tlv,
|
|||
{
|
||||
for (size_t i = 0; i < tal_count(tlv->fields); i++) {
|
||||
switch (tlv->fields[i].numtype) {
|
||||
case TLV_PAYLOAD_BLINDING_POINT:
|
||||
case TLV_PAYLOAD_CURRENT_BLINDING_POINT:
|
||||
case TLV_PAYLOAD_ENCRYPTED_RECIPIENT_DATA:
|
||||
continue;
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ static bool check_final_tlv(const struct tlv_payload *tlv,
|
|||
for (size_t i = 0; i < tal_count(tlv->fields); i++) {
|
||||
switch (tlv->fields[i].numtype) {
|
||||
case TLV_PAYLOAD_ENCRYPTED_RECIPIENT_DATA:
|
||||
case TLV_PAYLOAD_BLINDING_POINT:
|
||||
case TLV_PAYLOAD_CURRENT_BLINDING_POINT:
|
||||
case TLV_PAYLOAD_AMT_TO_FORWARD:
|
||||
case TLV_PAYLOAD_OUTGOING_CLTV_VALUE:
|
||||
case TLV_PAYLOAD_TOTAL_AMOUNT_MSAT:
|
||||
|
@ -230,18 +230,18 @@ struct onion_payload *onion_decode(const tal_t *ctx,
|
|||
* - MUST use that `current_blinding_point` as the blinding point for decryption.
|
||||
*/
|
||||
if (blinding) {
|
||||
if (p->tlv->blinding_point) {
|
||||
*failtlvtype = TLV_PAYLOAD_BLINDING_POINT;
|
||||
if (p->tlv->current_blinding_point) {
|
||||
*failtlvtype = TLV_PAYLOAD_CURRENT_BLINDING_POINT;
|
||||
goto field_bad;
|
||||
}
|
||||
p->blinding = tal_dup(p, struct pubkey, blinding);
|
||||
} else {
|
||||
if (!p->tlv->blinding_point) {
|
||||
*failtlvtype = TLV_PAYLOAD_BLINDING_POINT;
|
||||
if (!p->tlv->current_blinding_point) {
|
||||
*failtlvtype = TLV_PAYLOAD_CURRENT_BLINDING_POINT;
|
||||
goto field_bad;
|
||||
}
|
||||
p->blinding = tal_dup(p, struct pubkey,
|
||||
p->tlv->blinding_point);
|
||||
p->tlv->current_blinding_point);
|
||||
}
|
||||
|
||||
/* BOLT #4:
|
||||
|
@ -335,7 +335,7 @@ struct onion_payload *onion_decode(const tal_t *ctx,
|
|||
* incoming `update_add_htlc` or `current_blinding_point`
|
||||
* is present.
|
||||
*/
|
||||
if (blinding || p->tlv->blinding_point) {
|
||||
if (blinding || p->tlv->current_blinding_point) {
|
||||
*failtlvtype = TLV_PAYLOAD_ENCRYPTED_RECIPIENT_DATA;
|
||||
goto field_bad;
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ u8 *onion_blinded_hop(const tal_t *ctx,
|
|||
}
|
||||
tlv->outgoing_cltv_value = cast_const(u32 *, outgoing_cltv_value);
|
||||
tlv->encrypted_recipient_data = cast_const(u8 *, enctlv);
|
||||
tlv->blinding_point = cast_const(struct pubkey *, blinding);
|
||||
tlv->current_blinding_point = cast_const(struct pubkey *, blinding);
|
||||
|
||||
return make_tlv_hop(ctx, tlv);
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/wire/onion_wire.csv b/wire/onion_wire.csv
|
||||
index 3884c63dd..f5b3e9234 100644
|
||||
--- a/wire/onion_wire.csv
|
||||
+++ b/wire/onion_wire.csv
|
||||
@@ -10,8 +10,8 @@ tlvdata,payload,payment_data,payment_secret,byte,32
|
||||
tlvdata,payload,payment_data,total_msat,tu64,
|
||||
tlvtype,payload,encrypted_recipient_data,10
|
||||
tlvdata,payload,encrypted_recipient_data,encrypted_data,byte,...
|
||||
-tlvtype,payload,current_blinding_point,12
|
||||
-tlvdata,payload,current_blinding_point,blinding,point,
|
||||
+tlvtype,payload,blinding_point,12
|
||||
+tlvdata,payload,blinding_point,blinding,point,
|
||||
tlvtype,payload,payment_metadata,16
|
||||
tlvdata,payload,payment_metadata,payment_metadata,byte,...
|
||||
tlvtype,payload,total_amount_msat,18
|
|
@ -10,8 +10,8 @@ tlvdata,payload,payment_data,payment_secret,byte,32
|
|||
tlvdata,payload,payment_data,total_msat,tu64,
|
||||
tlvtype,payload,encrypted_recipient_data,10
|
||||
tlvdata,payload,encrypted_recipient_data,encrypted_data,byte,...
|
||||
tlvtype,payload,blinding_point,12
|
||||
tlvdata,payload,blinding_point,blinding,point,
|
||||
tlvtype,payload,current_blinding_point,12
|
||||
tlvdata,payload,current_blinding_point,blinding,point,
|
||||
tlvtype,payload,payment_metadata,16
|
||||
tlvdata,payload,payment_metadata,payment_metadata,byte,...
|
||||
tlvtype,payload,total_amount_msat,18
|
||||
|
|
|
Loading…
Add table
Reference in a new issue