mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-17 15:24:32 +01:00
little fixes
This commit is contained in:
@@ -177,7 +177,7 @@ fn pub_and_wait(
|
|||||||
let mut rep = pub_timeout(¤t, &msg.topic, &msg.message, &msg_rx, link_tx);
|
let mut rep = pub_timeout(¤t, &msg.topic, &msg.message, &msg_rx, link_tx);
|
||||||
// If that failed, try looking for some other signer
|
// If that failed, try looking for some other signer
|
||||||
if rep.is_none() {
|
if rep.is_none() {
|
||||||
for cid in client_list.keys() {
|
for cid in client_list.into_keys().filter(|k| k != ¤t) {
|
||||||
rep = pub_timeout(&cid, &msg.topic, &msg.message, &msg_rx, link_tx);
|
rep = pub_timeout(&cid, &msg.topic, &msg.message, &msg_rx, link_tx);
|
||||||
if rep.is_some() {
|
if rep.is_some() {
|
||||||
let mut cs = conns_.lock().unwrap();
|
let mut cs = conns_.lock().unwrap();
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ impl ControlPersist for FlashPersister {
|
|||||||
.0
|
.0
|
||||||
.get_raw(FlashKey::Id.as_str(), &mut buf)?
|
.get_raw(FlashKey::Id.as_str(), &mut buf)?
|
||||||
.ok_or(anyhow!("no existing id"))?;
|
.ok_or(anyhow!("no existing id"))?;
|
||||||
Ok(String::from_utf8(existing.to_vec()).expect("bad byte conversion to utf8"))
|
Ok(String::from_utf8(existing.to_vec())?)
|
||||||
}
|
}
|
||||||
fn read_policy(&self) -> Result<Policy> {
|
fn read_policy(&self) -> Result<Policy> {
|
||||||
let mut buf = [0u8; 250];
|
let mut buf = [0u8; 250];
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const CLIENT_ID: &str = "sphinx-1";
|
|||||||
#[cfg(feature = "pingpong")]
|
#[cfg(feature = "pingpong")]
|
||||||
const CLIENT_ID: &str = "test-1";
|
const CLIENT_ID: &str = "test-1";
|
||||||
|
|
||||||
const ID_LEN: usize = 8;
|
const ID_LEN: usize = 12;
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
// Temporary. Will disappear once ESP-IDF 4.4 is released, but for now it is necessary to call this function once,
|
// Temporary. Will disappear once ESP-IDF 4.4 is released, but for now it is necessary to call this function once,
|
||||||
|
|||||||
Reference in New Issue
Block a user