]> git.bitcoin.ninja Git - rust-lightning/commit
Add a new `NodeCounters` utility to track counters when routing
authorMatt Corallo <git@bluematt.me>
Tue, 19 Mar 2024 19:29:06 +0000 (19:29 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 10 Jul 2024 01:31:48 +0000 (01:31 +0000)
commitc6cd3c817643d5648d613f45b63393e47001b530
tree673201de4f44467d67af0107978b23be7370a10a
parenta17a159c937578abbd57e3e271be4fcc47b1620d
Add a new `NodeCounters` utility to track counters when routing

In the next commit we'll stop using `NodeId`s to look up nodes when
routing, instead using the new per-node counters. Here we take the
first step, adding a local struct which tracks temporary counters
for route hints/source/destination nodes.

Because we must ensure we have a 1-to-1 mapping from node ids to
`node_counter`s, even across first-hop and last-hop hints, we have
to be careful to check the network graph first, then a new
`private_node_id_to_node_counter` map to ensure we only ever end up
with one counter per node id.
lightning/src/routing/gossip.rs
lightning/src/routing/router.rs