From c7f138ec909cb566253110acedce102b649fdefe Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Wed, 11 Apr 2018 17:05:35 +0300 Subject: [PATCH] Rename HASH_LEN to HASH_PREFIX_LEN --- src/index.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.rs b/src/index.rs index ac11f4b..c36f0e4 100644 --- a/src/index.rs +++ b/src/index.rs @@ -13,7 +13,7 @@ use pbr; use Bytes; -const HASH_LEN: usize = 8; +const HASH_PREFIX_LEN: usize = 8; fn index_block(block: &Block, height: usize) -> Vec { let null_hash = Sha256dHash::default(); @@ -26,12 +26,12 @@ fn index_block(block: &Block, height: usize) -> Vec { } let mut key = Vec::::new(); // ??? key.push(b'I'); - key.extend_from_slice(&input.prev_hash[..HASH_LEN]); + key.extend_from_slice(&input.prev_hash[..HASH_PREFIX_LEN]); key.write_u16::(input.prev_index as u16) .unwrap(); rows.push(Row { key: key, - value: txid[..HASH_LEN].to_vec(), + value: txid[..HASH_PREFIX_LEN].to_vec(), }); } for output in &tx.output { @@ -43,7 +43,7 @@ fn index_block(block: &Block, height: usize) -> Vec { let mut key = Vec::::new(); // ??? key.push(b'O'); key.extend_from_slice(&script_hash); - key.extend_from_slice(&txid[..HASH_LEN]); + key.extend_from_slice(&txid[..HASH_PREFIX_LEN]); rows.push(Row { key: key, value: vec![],