Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions keep-desktop/src/frost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,19 @@ pub(crate) async fn frost_event_listener(
},
);
}
Ok(KfpNodeEvent::HealthCheckComplete {
responsive,
unresponsive,
..
}) => {
push_frost_event(
&frost_events,
FrostNodeMsg::HealthCheckComplete {
responsive,
unresponsive,
},
);
}
Ok(_) => {}
Err(tokio::sync::broadcast::error::RecvError::Lagged(_)) => {}
Err(tokio::sync::broadcast::error::RecvError::Closed) => break,
Expand Down Expand Up @@ -807,6 +820,25 @@ impl App {
"Received recovery xpub announcement"
);
}
FrostNodeMsg::HealthCheckComplete {
responsive,
unresponsive,
} => {
tracing::info!(
responsive = responsive.len(),
unresponsive = unresponsive.len(),
"Health check complete"
);
if let Some(s) = self.relay_screen_mut() {
for peer in &mut s.peers {
if responsive.contains(&peer.share_index) {
peer.online = true;
} else if unresponsive.contains(&peer.share_index) {
peer.online = false;
}
}
}
}
}
iced::Task::none()
}
Expand Down
12 changes: 12 additions & 0 deletions keep-desktop/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ pub enum FrostNodeMsg {
share_index: u16,
recovery_xpubs: Vec<AnnouncedXpub>,
},
HealthCheckComplete {
responsive: Vec<u16>,
unresponsive: Vec<u16>,
},
}

impl fmt::Debug for FrostNodeMsg {
Expand Down Expand Up @@ -390,6 +394,14 @@ impl fmt::Debug for FrostNodeMsg {
.field("share_index", share_index)
.field("xpub_count", &recovery_xpubs.len())
.finish(),
Self::HealthCheckComplete {
responsive,
unresponsive,
} => f
.debug_struct("HealthCheckComplete")
.field("responsive", &responsive.len())
.field("unresponsive", &unresponsive.len())
.finish(),
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions keep-mobile/src/keep_mobile.udl
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ dictionary DescriptorProposal {
sequence<RecoveryTierConfig> tiers;
};

dictionary AnnouncedXpubInfo {
string xpub;
string fingerprint;
string? label;
};

[Trait, WithForeign]
interface DescriptorCallbacks {
[Throws=KeepMobileError]
Expand All @@ -175,6 +181,8 @@ interface DescriptorCallbacks {
void on_complete(string session_id, string external_descriptor, string internal_descriptor);
[Throws=KeepMobileError]
void on_failed(string session_id, string error);
[Throws=KeepMobileError]
void on_xpub_announced(u16 share_index, sequence<AnnouncedXpubInfo> xpubs);
};

[Trait, WithForeign]
Expand Down Expand Up @@ -275,6 +283,9 @@ interface KeepMobile {

[Throws=KeepMobileError]
void wallet_descriptor_approve_contribution(string session_id);

[Throws=KeepMobileError]
void wallet_announce_xpubs(sequence<AnnouncedXpubInfo> xpubs);
};

dictionary ParsedBunkerUrl {
Expand Down