]> git.bitcoin.ninja Git - rust-lightning/commit
Avoid adding duplicate hint candidates if they are first hops
authorElias Rohrer <dev@tnull.de>
Fri, 22 Sep 2023 14:38:30 +0000 (16:38 +0200)
committerElias Rohrer <dev@tnull.de>
Thu, 28 Sep 2023 17:45:30 +0000 (19:45 +0200)
commitc480b0c857d0999c12c1c2507a5d8c93592d91cc
treef64922494d3c9b9dbfa4d05a3aa45a6dab6f077d
parent7a6d3097a6aa59b5aa2e8e83527cd3ee79560750
Avoid adding duplicate hint candidates if they are first hops

If we have a direct channel to a node generating an invoice with route
hints, we'd previously happily add multiple candidates that all refer to
the same channel. To keep our candidate set small and unify our tracking
where possible, we now check if its `short_channel_id` is an
`outbound_scid_alias` of any of our first hops and refrain from adding
another candidate if it's the case.
lightning/src/routing/router.rs