mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
common: update to latest route-blinding spec.
``` make check-source-bolt CHECK_BOLT_PREFIX="--prefix=BOLT-route-blinding" BOLTVERSION=guilt/offers ``` Other than textual changes, this does: 1. Ensures we put total_amount_msat in onion final hop (reported by @t-bast). 2. Require that they put total_amount_msat in onion final hop. 3. Return `invalid_onion_blinding` exactly as defined by the spec (i.e. less aggressive when we're the final hop) (also reported by @t-bast, but I already knew). See: #5823 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-EXPERIMENTAL: `offers` breaking blinded payments change (total_amount_sat required, Eclair compat)
This commit is contained in:
@@ -102,8 +102,8 @@ static bool handle_blinded_terminal(struct onion_payload *p,
|
||||
}
|
||||
|
||||
/* BOLT-route-blinding #4:
|
||||
* - MUST return an error if `amt_to_forward` or
|
||||
* `outgoing_cltv_value` are not present.
|
||||
* - MUST return an error if `amt_to_forward`, `outgoing_cltv_value`
|
||||
* or `total_amount_msat` are not present.
|
||||
* - MUST return an error if `amt_to_forward` is below what it expects
|
||||
* for the payment.
|
||||
*/
|
||||
@@ -117,6 +117,11 @@ static bool handle_blinded_terminal(struct onion_payload *p,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!tlv->total_amount_msat) {
|
||||
*failtlvtype = TLV_TLV_PAYLOAD_TOTAL_AMOUNT_MSAT;
|
||||
return false;
|
||||
}
|
||||
|
||||
p->amt_to_forward = amount_msat(*tlv->amt_to_forward);
|
||||
p->outgoing_cltv = *tlv->outgoing_cltv_value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user