diff --git a/json/src/lib.rs b/json/src/lib.rs index bc3468f4..20980971 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -1003,6 +1003,14 @@ pub struct GetAddressInfoResult { pub label: Option, } +/// Used to represent values that can either be a string or a string array. +#[derive(Clone, Debug, Deserialize, Serialize)] +#[serde(untagged)] +pub enum StringOrStringArray { + String(String), + StringArray(Vec), +} + /// Models the result of "getblockchaininfo" #[derive(Clone, Debug, Deserialize, Serialize)] pub struct GetBlockchainInfoResult { @@ -1044,8 +1052,8 @@ pub struct GetBlockchainInfoResult { /// Status of softforks in progress #[serde(default)] pub softforks: HashMap, - /// Any network and blockchain warnings. - pub warnings: String, + /// Any network and blockchain warnings. In later versions of bitcoind, it's an array of strings. + pub warnings: StringOrStringArray, } #[derive(Clone, PartialEq, Eq, Debug)]