Skip to content

Commit

Permalink
frost-client: fix error if there is no self contact (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
conradoplg authored Jan 22, 2025
1 parent 65efddd commit c2eb29a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions frost-client/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ pub struct Config {

impl Config {
pub fn contact_by_pubkey(&self, pubkey: &[u8]) -> Result<Contact, Box<dyn Error>> {
if Some(pubkey) == self.communication_key.as_ref().map(|c| c.pubkey.as_slice()) {
return Ok(Contact {
version: Some(0),
name: "".to_string(),
pubkey: pubkey.to_vec(),
});
}
Ok(self
.contact
.values()
Expand Down

0 comments on commit c2eb29a

Please sign in to comment.