lnd/routing
bitromortac d28a71765b
multi: represent the blinded forwarding next hop as an fn.Either
The forwarding next hop is currently always a short channel ID. To allow a
blinded route to identify the next hop by node ID instead, change
ForwardingInfo.NextHop to fn.Either[lnwire.ShortChannelID, [33]byte], where
the Left is the outgoing channel ID and the Right (wired up in a follow-up
commit) is the next node's public key.

This commit is a pure representational change with no behavioural effect:
every next hop is still a channel ID. The Either is encapsulated behind
ForwardingInfo methods so callers never destructure it directly: IsExit()
is the single source of truth for exit-hop detection (used by the link and
the contract court) and NextHopChannel() yields the outgoing SCID.
2026-07-29 14:02:00 +00:00
..
blindedpath chanstate: use channel types in interfaces 2026-07-07 07:18:56 -03:00
chainview multi: fix lint findings from btcd v2 migration 2026-06-24 11:57:10 -07:00
localchans chanstate: use channel types in local chans 2026-07-07 07:18:58 -03:00
route Merge pull request #10789 from bitromortac/2604-bolt12-1a 2026-06-15 22:10:31 -03:00
shards multi: Fix typos [skip ci] 2022-01-24 12:19:02 +02:00
testdata routing: add private key attribute in router test 2021-06-23 18:13:02 +08:00
additional_edge.go multi+refactor: move models package to graph/db 2024-11-28 13:34:33 +02:00
additional_edge_test.go lint: remove redundant loop var copies in test files 2026-06-03 15:32:45 -03:00
bandwidth.go graph/db: thread context through ForEachNodeDirectedChannel 2026-02-25 15:33:34 +02:00
bandwidth_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
blinding.go routing: improve lasthoppaylaod size calculation 2024-12-10 19:05:49 +01:00
blinding_test.go lint: remove redundant loop var copies in test files 2026-06-03 15:32:45 -03:00
control_tower.go routing: fix log output line 2026-03-19 19:30:13 +01:00
control_tower_test.go multi: move failed attempt cfg option to the router subsytem 2026-02-25 08:02:26 +01:00
graph.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
heap.go routing: add inbound fee support to pathfinding 2024-03-31 18:12:28 +02:00
heap_test.go routing: optimize path finding structures 2019-10-24 21:38:07 -03:00
integrated_routing_context_test.go multi: skip range check in pathfinder and switch for custom htlc payments 2025-08-06 09:37:08 +02:00
integrated_routing_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
log.go multi: start updating various loggers to use the new v2 type 2024-10-22 17:03:55 +02:00
missioncontrol.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
missioncontrol_state.go routing: separate MissionControl from MissionControlManager 2024-10-01 14:06:50 +02:00
missioncontrol_state_test.go multi: formatting and comment fixes 2022-02-10 11:02:02 +01:00
missioncontrol_store.go routing: allow misson control manager to startup despite errors 2025-12-02 20:38:55 +01:00
missioncontrol_store_test.go lint: remove redundant loop var copies in test files 2026-06-03 15:32:45 -03:00
missioncontrol_test.go multi: update walletdb package 2025-04-09 18:47:53 +02:00
mock_graph_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
mock_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
nodepair.go routing: extended DirectedNodePair functionality 2019-08-13 18:45:06 +02:00
pathfind.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
pathfind_test.go multi: represent the blinded forwarding next hop as an fn.Either 2026-07-29 14:02:00 +00:00
payment_lifecycle.go lint: enable copyloopvar and remove redundant loop var copies in non-test files 2026-06-03 15:32:46 -03:00
payment_lifecycle_test.go lint: remove redundant loop var copies in test files 2026-06-03 15:32:45 -03:00
payment_session.go graphdb: pass context to GraphSession 2026-02-25 16:11:46 +02:00
payment_session_source.go models: simplify models.Node 2025-11-12 22:54:04 +08:00
payment_session_test.go lint: remove redundant loop var copies in test files 2026-06-03 15:32:45 -03:00
probability_apriori.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
probability_apriori_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
probability_bimodal.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
probability_bimodal_test.go lint: remove redundant loop var copies in test files 2026-06-03 15:32:45 -03:00
probability_estimator.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
probability_estimator_test.go routing: add probability benchmarks 2023-02-14 13:34:25 +01:00
README.md scripted-diff: replace ⛰ emoji with $ [skip ci] 2022-10-28 12:06:49 -04:00
result_interpretation.go multi: move FailureReason to payment package 2025-08-14 19:53:18 +02:00
result_interpretation_test.go routing: remove paymentFailure pointer 2025-04-30 17:43:58 +02:00
router.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
router_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
setup_test.go channeldb/test: test with postgres 2021-10-29 10:54:44 +02:00
unified_edges.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00
unified_edges_test.go multi: upgrade to btcd v2 modules 2026-06-24 10:58:36 -07:00

routing

Build Status MIT licensed GoDoc

The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.

Installation and Updating

$  go get -u github.com/lightningnetwork/lnd/routing