decode: fix handling of blinded_payinfo.

Our pay code handles this correctly, but decode was still using an old model
where there was a payinfo per hop, not per path.

Reported-by: @t-bast
See: #5823
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-12 14:28:03 +10:30
parent 6eb7a4cbf2
commit 2dec805465
3 changed files with 55 additions and 40 deletions

View File

@@ -148,13 +148,14 @@ If **type** is "bolt12 invoice", and **valid** is *true*:
- **invoice\_paths** (array of objects): Paths to pay the destination:
- **first\_node\_id** (pubkey): the (presumably well-known) public key of the start of the path
- **blinding** (pubkey): blinding factor for this path
- **payinfo** (object):
- **fee\_base\_msat** (msat): basefee for path
- **fee\_proportional\_millionths** (u32): proportional fee for path
- **cltv\_expiry\_delta** (u32): CLTV delta for path
- **features** (hex): features allowed for path
- **path** (array of objects): an individual path:
- **blinded\_node\_id** (pubkey): node\_id of the hop
- **encrypted\_recipient\_data** (hex): encrypted TLV entry for this hop
- **fee\_base\_msat** (msat, optional): basefee for path
- **fee\_proportional\_millionths** (u32, optional): proportional fee for path
- **cltv\_expiry\_delta** (u32, optional): CLTV delta for path
- **features** (hex, optional): features allowed for path
- **invoice\_created\_at** (u64): the UNIX timestamp of invoice creation
- **invoice\_payment\_hash** (hex): the hash of the *payment\_preimage* (always 64 characters)
- **invoice\_amount\_msat** (msat): the amount required to fulfill invoice
@@ -302,4 +303,4 @@ RESOURCES
Main web site: <https://github.com/ElementsProject/lightning>
[comment]: # ( SHA256STAMP:eadd9b06e6cb495a794568f3a9e2371c09718311c0b61ad05b0fca3014c429d3)
[comment]: # ( SHA256STAMP:a8843027b18a1d54efcf0ca423fc6fbe0c2136d32fa3d8c552a875b6844dd950)

View File

@@ -927,6 +927,7 @@
"required": [
"first_node_id",
"blinding",
"payinfo",
"path"
],
"additionalProperties": false,
@@ -939,6 +940,34 @@
"type": "pubkey",
"description": "blinding factor for this path"
},
"payinfo": {
"type": "object",
"required": [
"fee_base_msat",
"fee_proportional_millionths",
"cltv_expiry_delta",
"features"
],
"additionalProperties": false,
"properties": {
"fee_base_msat": {
"type": "msat",
"description": "basefee for path"
},
"fee_proportional_millionths": {
"type": "u32",
"description": "proportional fee for path"
},
"cltv_expiry_delta": {
"type": "u32",
"description": "CLTV delta for path"
},
"features": {
"type": "hex",
"description": "features allowed for path"
}
}
},
"path": {
"type": "array",
"description": "an individual path",
@@ -957,22 +986,6 @@
"encrypted_recipient_data": {
"type": "hex",
"description": "encrypted TLV entry for this hop"
},
"fee_base_msat": {
"type": "msat",
"description": "basefee for path"
},
"fee_proportional_millionths": {
"type": "u32",
"description": "proportional fee for path"
},
"cltv_expiry_delta": {
"type": "u32",
"description": "CLTV delta for path"
},
"features": {
"type": "hex",
"description": "features allowed for path"
}
}
}