Skip to content

Commit

Permalink
pool: remove Error::OneShotRecvError variant
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Sep 19, 2024
1 parent bf17baf commit a583058
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
* database: remove `Order` enum ([Yuki Kishimoto])
* database: remove `order` arg from `NostrDatabase::query` ([Yuki Kishimoto])
* pool: remove high latency log ([Yuki Kishimoto])
* pool: remove `Error::OneShotRecvError` variant ([Yuki Kishimoto])
* zapper: remove `Err` from `NostrZapper` and unnecessary variants from `ZapperError` ([Yuki Kishimoto])
* js(nostr): remove `Keys::vanity` ([Yuki Kishimoto])
* cli: remove `reverse` flag from `query` command
Expand Down
3 changes: 0 additions & 3 deletions crates/nostr-relay-pool/src/relay/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ pub enum Error {
/// Batch event empty
#[error("batch event cannot be empty")]
BatchEventEmpty,
/// Impossible to receive oneshot message
#[error("impossible to recv msg")]
OneShotRecvError,
/// Read actions disabled
#[error("read actions are disabled for this relay")]
ReadDisabled,
Expand Down
10 changes: 2 additions & 8 deletions crates/nostr-relay-pool/src/relay/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,14 +1085,8 @@ impl InternalRelay {
// Wait for oneshot reply
match time::timeout(Some(opts.timeout), rx).await {
Some(result) => match result {
Ok(val) => {
if val {
Ok(())
} else {
Err(Error::MessageNotSent)
}
}
Err(_) => Err(Error::OneShotRecvError),
Ok(true) => Ok(()),
Ok(false) | Err(_) => Err(Error::MessageNotSent),
},
None => Err(Error::RecvTimeout),
}
Expand Down

0 comments on commit a583058

Please sign in to comment.