Improving RawClient::batch_call after review suggestion

This commit is contained in:
Dr Maxim Orlovsky 2021-04-12 15:39:35 +02:00
parent d64aaffb3f
commit cfc7bfe037
No known key found for this signature in database
GPG Key ID: FFC0250947E5C6F7

View File

@ -683,10 +683,7 @@ impl<T: Read + Write> ElectrumApi for RawClient<T> {
for req_id in missing_responses.iter() {
match self.recv(&receiver, *req_id) {
Ok(mut resp) => answers.insert(
resp["id"].as_u64().unwrap_or_default(),
resp["result"].take(),
),
Ok(mut resp) => answers.insert(req_id, resp["result"].take()),
Err(e) => {
// In case of error our sender could still be left in the map, depending on where
// the error happened. Just in case, try to remove it here