From c2eb29a7758bb752a1373b8901a380d88cb8f871 Mon Sep 17 00:00:00 2001 From: Conrado Gouvea Date: Wed, 22 Jan 2025 13:15:23 -0300 Subject: [PATCH] frost-client: fix error if there is no self contact (#437) --- frost-client/src/config.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frost-client/src/config.rs b/frost-client/src/config.rs index a2743a0..cb379fc 100644 --- a/frost-client/src/config.rs +++ b/frost-client/src/config.rs @@ -31,6 +31,13 @@ pub struct Config { impl Config { pub fn contact_by_pubkey(&self, pubkey: &[u8]) -> Result> { + 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()