mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
script/evgrd: fetch successors of requested tips
This commit is contained in:
@@ -202,19 +202,15 @@ async fn handle_connect(
|
||||
|
||||
let fetchevs = FetchEventsMessage::decode_async(&mut stream).await?;
|
||||
info!(target: "evgrd", "Fetching events {fetchevs:?}");
|
||||
// Now do your thing with the daemon and get missing tips
|
||||
let events = daemon.event_graph.fetch_successors_of(fetchevs.unref_tips).await?;
|
||||
|
||||
// Then send them like this:
|
||||
|
||||
// for ev in evs {
|
||||
// MSG_EVENT.encode_async(&mut stream).await?;
|
||||
// ev.encode_async(&mut stream).await?;
|
||||
// }
|
||||
for event in events {
|
||||
MSG_EVENT.encode_async(&mut stream).await?;
|
||||
event.encode_async(&mut stream).await?;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async_daemonize!(realmain);
|
||||
|
||||
@@ -47,7 +47,7 @@ impl VersionMessage {
|
||||
|
||||
#[derive(Debug, Clone, SerialEncodable, SerialDecodable)]
|
||||
pub struct FetchEventsMessage {
|
||||
unref_tips: Vec<(u64, blake3::Hash)>,
|
||||
pub unref_tips: Vec<(u64, blake3::Hash)>,
|
||||
}
|
||||
|
||||
impl FetchEventsMessage {
|
||||
|
||||
Reference in New Issue
Block a user