enostr: use data instead of strings in Pubkey and EventId

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-02-07 12:02:13 -08:00
parent 6c2c352e6f
commit 9a9bb13e08
5 changed files with 162 additions and 70 deletions

View File

@@ -141,7 +141,10 @@ impl RelayPool {
Ok(())
}
/// Attempts to receive a pool event from a list of relays. The function searches each relay in the list in order, attempting to receive a message from each. If a message is received, return it. If no message is received from any relays, None is returned.
/// Attempts to receive a pool event from a list of relays. The
/// function searches each relay in the list in order, attempting to
/// receive a message from each. If a message is received, return it.
/// If no message is received from any relays, None is returned.
pub fn try_recv(&mut self) -> Option<PoolEvent<'_>> {
for relay in &mut self.relays {
let relay = &mut relay.relay;
@@ -149,6 +152,7 @@ impl RelayPool {
match msg.try_into() {
Ok(event) => {
relay.status = RelayStatus::Connected;
// let's just handle pongs here.
// We only need to do this natively.
#[cfg(not(target_arch = "wasm32"))]