From dec78fd8bb4cc8f52c857088b274fd06cea2e730 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 21 Oct 2025 20:56:59 +0800 Subject: chore(block): directly use self.digest instead --- src/blocks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/blocks.rs b/src/blocks.rs index 1097626..a058c3c 100644 --- a/src/blocks.rs +++ b/src/blocks.rs @@ -49,7 +49,7 @@ impl Block { for i in 0.. { // reset every loop let mut hasher = Sha256::new(); - Digest::update(&mut hasher, bincode::encode_to_vec((&self.prev_hash, &self.trans, i), bincode::config::standard()).unwrap()); + self.digest(&mut hasher); let hashed = hasher.finalize(); if Self::pref_zeros(&hashed).is_ok() { return i; -- cgit v1.2.3