rpc sender dialinfo

This commit is contained in:
John Smith
2022-03-24 22:07:55 -04:00
parent c276dd7796
commit cc715dfc96
4 changed files with 75 additions and 9 deletions

View File

@@ -35,9 +35,9 @@ impl NodeRef {
self.node_id
}
// pub fn dial_info_filter(&self) -> DialInfoFilter {
// self.dial_info_filter.clone()
// }
pub fn dial_info_filter(&self) -> &DialInfoFilter {
&self.dial_info_filter
}
pub fn operate<T, F>(&self, f: F) -> T
where
@@ -46,6 +46,16 @@ impl NodeRef {
self.routing_table.operate_on_bucket_entry(self.node_id, f)
}
// Returns if this node has seen and acknowledged our node's dial info yet
pub fn has_seen_our_dial_info(&self) -> bool {
let nm = self.routing_table.network_manager();
self.operate(|e| e.has_seen_our_dial_info())
}
pub fn set_seen_our_dial_info(&self) {
let nm = self.routing_table.network_manager();
self.operate(|e| e.set_seen_our_dial_info(true));
}
// Returns the best dial info to attempt a connection to this node
pub fn best_dial_info(&self) -> Option<DialInfo> {
let nm = self.routing_table.network_manager();