Skip to content

Commit

Permalink
fix break change
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo authored and KaoImin committed Jul 25, 2022
1 parent 13e57fe commit 99518ab
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/api/src/jsonrpc/ws_subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,20 @@ where
"eth_subscription",
"eth_subscription",
"eth_unsubscribe",
|params, pending, ctx| match Type::try_from(params) {
|params, mut sink, ctx| match Type::try_from(params) {
Ok(typ) => {
if let Some(sink) = pending.accept() {
let raw_hub = RawHub { typ, sink };
sink.accept()?;
let raw_hub = RawHub { typ, sink };

tokio::spawn(async move {
let _ignore = ctx.send(raw_hub).await;
});
}
tokio::spawn(async move {
let _ignore = ctx.send(raw_hub).await;
});
Ok(())
}
Err(e) => {
let e: Error = e.into();
pending.reject(e);
let _ = sink.reject(e);
Ok(())
}
},
)
Expand Down Expand Up @@ -133,7 +134,6 @@ where

let latest_web3_header = Web3Header::from(latest_block.header.clone());
for hub in self.header_hubs.iter_mut() {
// unbound sender can ignore it's return
let _ignore = hub.sink.send(&latest_web3_header);
}
}
Expand Down

0 comments on commit 99518ab

Please sign in to comment.