X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-block-sync%2Fsrc%2Fconvert.rs;h=ed28833b7b30d4986fe53e2801d2ddaf43dcf765;hb=5824e226cad67e32d5e8be71ebbb6f91a3fc2116;hp=358076f4c25a883f5e571b421f9d3ff1ebe20f27;hpb=e635db0da31841e8a8ac5c5450c8f595541a6ced;p=rust-lightning diff --git a/lightning-block-sync/src/convert.rs b/lightning-block-sync/src/convert.rs index 358076f4..ed28833b 100644 --- a/lightning-block-sync/src/convert.rs +++ b/lightning-block-sync/src/convert.rs @@ -15,6 +15,7 @@ use serde_json; use std::convert::From; use std::convert::TryFrom; use std::convert::TryInto; +use bitcoin::hashes::Hash; /// Conversion from `std::io::Error` into `BlockSourceError`. impl From for BlockSourceError { @@ -57,7 +58,7 @@ impl TryInto for JsonResponse { // Add an empty previousblockhash for the genesis block. if let None = header.get("previousblockhash") { - let hash: BlockHash = Default::default(); + let hash: BlockHash = BlockHash::all_zeros(); header.as_object_mut().unwrap().insert("previousblockhash".to_string(), serde_json::json!(hash.to_hex())); } @@ -182,7 +183,7 @@ impl TryInto for JsonResponse { } /// Converts a JSON value into a transaction. WATCH OUT! this cannot be used for zero-input transactions -/// (e.g. createrawtransaction). See https://github.com/rust-bitcoin/rust-bitcoincore-rpc/issues/197 +/// (e.g. createrawtransaction). See impl TryInto for JsonResponse { type Error = std::io::Error; fn try_into(self) -> std::io::Result {