diff --git a/client/src/client.rs b/client/src/client.rs index b6394f8a..5e73e2a0 100644 --- a/client/src/client.rs +++ b/client/src/client.rs @@ -270,6 +270,14 @@ pub trait RpcApi: Sized { fn get_block_header_info( &self, hash: &BlockHash, + ) -> Result { + self.call("getblockheader", &[into_json(hash)?, 1.into()]) + } + + /// Returns information about the block header, including merkle-root and coinbase tx. + fn get_block_header_info_full( + &self, + hash: &BlockHash, ) -> Result { self.call("getblockheader", &[into_json(hash)?, 2.into()]) } diff --git a/json/src/lib.rs b/json/src/lib.rs index 486eee01..d03b7adc 100644 --- a/json/src/lib.rs +++ b/json/src/lib.rs @@ -340,9 +340,9 @@ pub struct GetBlockHeaderResult { pub next_block_hash: Option, pub status: GetBlockResultStatus, #[serde(rename = "tx")] - pub coinbase_tx: Vec, /// its a vector but it only has one value + pub coinbase_tx: Option>, // its a vector but it only has one value #[serde(rename = "merkleproof")] - pub coinbase_merkle_proof: Vec, + pub coinbase_merkle_proof: Option>, } #[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]