X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fverifier.rs;h=c44cb663158e19d7e1c850b22bd57f6f952665c1;hb=81c27c87b10f2e097eef99e0766d1bcef2ebef60;hp=5e912446d3a219ad22f8363a3b329a254f45cbb9;hpb=e93aff4aff39c4d68960d59c28c40570e18732f8;p=rapid-gossip-sync-server diff --git a/src/verifier.rs b/src/verifier.rs index 5e91244..c44cb66 100644 --- a/src/verifier.rs +++ b/src/verifier.rs @@ -1,4 +1,4 @@ -use std::convert::TryInto; +use std::io::ErrorKind; use std::ops::Deref; use std::sync::Arc; use std::sync::Mutex; @@ -65,7 +65,15 @@ impl ChainVerifier where L::Target: let block_hash_result = client.request_resource::(&uri).await; let block_hash: Vec = block_hash_result.map_err(|error| { - log_error!(logger, "Could't find block hash at height {}: {}", block_height, error.to_string()); + match error.kind() { + ErrorKind::InvalidData => { + // the response length was likely 0 + log_error!(logger, "Could't find block hash at height {}: Invalid response! Please make sure the `-rest=1` flag is set.", block_height); + } + _ => { + log_error!(logger, "Could't find block hash at height {}: {}", block_height, error.to_string()); + } + } UtxoLookupError::UnknownChain })?.0; let block_hash = BlockHash::from_slice(&block_hash).unwrap();