more work

This commit is contained in:
John Smith
2023-02-13 21:12:27 -05:00
parent 1d8e2d3fda
commit f11dc8aaac
11 changed files with 111 additions and 103 deletions

View File

@@ -24,8 +24,8 @@ impl RoutingTable {
let noderefs = routing_table.find_fastest_nodes(
min_peer_count,
VecDeque::new(),
|_rti, k: TypedKey, v: Option<Arc<BucketEntry>>| {
NodeRef::new(routing_table.clone(), k, v.unwrap().clone(), None)
|_rti, entry: Option<Arc<BucketEntry>>| {
NodeRef::new(routing_table.clone(), entry.unwrap().clone(), None)
},
);

View File

@@ -53,8 +53,7 @@ impl RoutingTable {
// Register new outbound relay
if let Some(nr) = self.register_node_with_peer_info(
RoutingDomain::PublicInternet,
outbound_relay_peerinfo.node_id.key,
outbound_relay_peerinfo.signed_node_info,
outbound_relay_peerinfo,
false,
) {
info!("Outbound relay node selected: {}", nr);

View File

@@ -21,13 +21,9 @@ impl RoutingTable {
);
// Roll all bucket entry transfers
let entries: Vec<Arc<BucketEntry>> = inner
.buckets
.iter()
.flat_map(|b| b.entries().map(|(_k, v)| v.clone()))
.collect();
for v in entries {
v.with_mut(inner, |_rti, e| e.roll_transfers(last_ts, cur_ts));
let all_entries: Vec<Arc<BucketEntry>> = inner.all_entries.iter().collect();
for entry in all_entries {
entry.with_mut(inner, |_rti, e| e.roll_transfers(last_ts, cur_ts));
}
}