Changed serialization of block to binary format.

This commit is contained in:
Revertron
2021-05-03 08:42:21 +02:00
parent c3576d62d8
commit fab62bdfc8
4 changed files with 17 additions and 10 deletions
+1 -2
View File
@@ -9,8 +9,7 @@ pub fn check_block_hash(block: &Block) -> bool {
let mut copy: Block = block.clone();
copy.hash = Bytes::default();
copy.signature = Bytes::default();
let data = serde_json::to_string(&copy).unwrap();
blakeout_data(data.as_bytes()) == block.hash
blakeout_data(&copy.as_bytes()) == block.hash
}
/// Hashes data by given hasher