Browse Source

Use parse_hash() for Daemon::getblocktxids()

skip-invalid-blocks
Roman Zeyde 6 years ago
parent
commit
e9d9f6b16c
No known key found for this signature in database GPG Key ID: 87CAE5FA46917CBB
  1. 6
      src/daemon.rs

6
src/daemon.rs

@ -483,10 +483,8 @@ impl Daemon {
.as_array() .as_array()
.chain_err(|| "invalid block txids")? .chain_err(|| "invalid block txids")?
.iter() .iter()
.map(|txid| { .map(|txid| parse_hash(txid))
Sha256dHash::from_hex(txid.as_str().chain_err(|| "txid not string")?) .collect::<Result<Vec<Sha256dHash>>>()
.chain_err(|| "invalid hex")
}).collect::<Result<Vec<Sha256dHash>>>()
} }
pub fn getblocks(&self, blockhashes: &[Sha256dHash]) -> Result<Vec<Block>> { pub fn getblocks(&self, blockhashes: &[Sha256dHash]) -> Result<Vec<Block>> {

Loading…
Cancel
Save