mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-28 21:50:26 +08:00
node: improve seeds information
Previously, the seeds information would only consist of the connected NodeIds. Improve on this by adding any disconnected and fetching seeds as well. A seed can either be disconnected, connected, or fetching -- where fetching implies connected. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -6,6 +6,7 @@ use std::sync::Arc;
|
||||
|
||||
use crossbeam_channel as chan;
|
||||
use cyphernet::Ecdh;
|
||||
use radicle::node::Seeds;
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::crypto::Signer;
|
||||
@@ -118,7 +119,7 @@ impl<G: Signer + Ecdh + 'static> radicle::node::Handle for Handle<G> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn seeds(&mut self, id: Id) -> Result<Vec<NodeId>, Self::Error> {
|
||||
fn seeds(&mut self, id: Id) -> Result<Seeds, Self::Error> {
|
||||
let (sender, receiver) = chan::bounded(1);
|
||||
self.command(service::Command::Seeds(id, sender))?;
|
||||
receiver.recv().map_err(Error::from)
|
||||
|
||||
Reference in New Issue
Block a user