Add source reference to BlindedPathCandidate hop
authorJeffrey Czyz <jkczyz@gmail.com>
Wed, 20 Mar 2024 21:43:03 +0000 (16:43 -0500)
committerJeffrey Czyz <jkczyz@gmail.com>
Mon, 15 Apr 2024 15:58:23 +0000 (10:58 -0500)
commite0bc6fa8b2fc67baee03e86aee1e04f5191d08e9
tree9c9417145afd557fa72eb303fe7bbb46c8aeb527
parent63ebaccca3c284c28f24537c2c0c034f9cc9c3c4
Add source reference to BlindedPathCandidate hop

Blinded paths currently contain a node id for the introduction node.
However, a compact representation will allow a directed short channel id
instead. Update BlindedPathCandidate and OneHopBlindedPathCandidate to
store a NodeId reference from either the NetworkGraph or from the user-
provided first hops.

This approach avoids looking up the introduction node id on demand,
which may not be resolvable. Thus, that would require returning an
Option from CandidateRouteHop::source and handle None accordingly.
lightning/src/routing/router.rs