We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7cd856d commit 2b7ba37Copy full SHA for 2b7ba37
src/bitcoind/interface.rs
@@ -401,13 +401,21 @@ impl BitcoinD {
401
"importdescriptors",
402
¶ms!(Json::Array(all_descriptors)),
403
)?;
404
- if res.get(0).map(|x| x.get("success")) == Some(Some(&Json::Bool(true))) {
+ let all_succeeded = res
405
+ .as_array()
406
+ .map(|results| {
407
+ results
408
+ .iter()
409
+ .all(|res| res.get("success") == Some(&Json::Bool(true)))
410
+ })
411
+ .unwrap_or(false);
412
+ if all_succeeded {
413
return Ok(());
414
}
415
416
Err(BitcoindError::Custom(format!(
417
"Error returned from 'importdescriptor': {:?}",
- res.get(0).map(|r| r.get("error"))
418
+ res
419
)))
420
421
0 commit comments