@@ -175,24 +175,30 @@ impl Transport {
177 async fn recv_response(&mut self, output: jsonrpc::Output) -> anyhow::Result<()> {
177 async fn recv_response(&mut self, output: jsonrpc::Output) -> anyhow::Result<()> {
178− match output {
178+ let (id, result) = match output {
179 jsonrpc::Output::Success(jsonrpc::Success { id, result, .. }) => {
179 jsonrpc::Output::Success(jsonrpc::Success { id, result, .. }) => {
180 info!("<- {}", result);
180 info!("<- {}", result);
185− .expect("pending_request with id not found!");
186− tx.send(Ok(result)).await?;
181+ (id, Ok(result))
188 jsonrpc::Output::Failure(jsonrpc::Failure { id, error, .. }) => {
183 jsonrpc::Output::Failure(jsonrpc::Failure { id, error, .. }) => {
189− let tx = self
184+ error!("<- {}", error);
192− .expect("pending_request with id not found!");
193− tx.send(Err(error.into())).await?;
185+ (id, Err(error.into()))
192+ .expect("pending_request with id not found!");
194+ match tx.send(result).await {
197+ "Tried sending response into a closed channel (id={:?}), original request likely timed out",