bitcoind: do not assert presence of 'warning' field in unloadwallet response

This commit is contained in:
Antoine Poinsot 2023-05-12 10:57:23 +02:00
parent 08223c0ded
commit 3a82c3a81d
No known key found for this signature in database
GPG Key ID: E13FC145CD3F4304

View File

@ -449,8 +449,7 @@ impl BitcoinD {
pub fn unload_wallet(&self, wallet_path: String) -> Option<String> {
self.make_node_request("unloadwallet", &params!(Json::String(wallet_path),))
.get("warning")
.expect("No 'warning' in 'unloadwallet' response?")
.as_str()
.and_then(Json::as_str)
.and_then(|w| {
if w.is_empty() {
None