Commit 089a2d1
committed
ln/fix: return invalid payload for final hop trampoline with blinding
As is, we're returning an `invalid_onion_blinding` error with no
associated data, because the calling code does not attach any data
when we have a `OnionDecodeErr::Relay` error. This is arguably not
the correct error code anyway, as described below, so this commit
updates it to `invalid_onion_payload` which does not require additional
error data.
In this case, we have received a trampoline payload which we believe
should contain details of the next trampoline hop. This information
is missing, so we've received an invalid payload. When a blinding point
point is present in the payload, we're also the introduction node.
BOLT04 indicates that if this `current_path_key` is present and we are
the final hop we should return a regular error (rather than using
`invalid_onion_blinding` when you're the the final hop). Before this
commit, this code was considering our node to be non-final and returning
an error accordingly.
Our role as the final hop is ambiguous here - we are the final hop in
the sphinx packet, but the trampoline packet implies that there should
be more hops to come. Given that the trampoline packet is invalid, we
defer to our position in the sphinx packet and send back an invalid
payload error instead.1 parent bead243 commit 089a2d1
2 files changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2160 | 2160 | | |
2161 | 2161 | | |
2162 | 2162 | | |
2163 | | - | |
| 2163 | + | |
2164 | 2164 | | |
2165 | 2165 | | |
2166 | 2166 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1837 | 1837 | | |
1838 | 1838 | | |
1839 | 1839 | | |
1840 | | - | |
| 1840 | + | |
1841 | 1841 | | |
1842 | 1842 | | |
1843 | 1843 | | |
| |||
0 commit comments