From f396a01d7ba171e30e44084dc0d0a4f0a146956f Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 21 Oct 2025 21:25:11 +0800 Subject: Revert "chore(block): directly use self.digest instead" This reverts commit dec78fd8bb4cc8f52c857088b274fd06cea2e730. oops, it did not account for nonce --- 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 9908be6..65c0380 100644 --- a/src/blocks.rs +++ b/src/blocks.rs @@ -50,7 +50,7 @@ impl Block { for i in 0.. { // reset every loop let mut hasher = Sha256::new(); - self.digest(&mut hasher); + Digest::update(&mut hasher, bincode::encode_to_vec((&self.prev_hash, &self.trans, i), bincode::config::standard()).unwrap()); let hashed = hasher.finalize(); if Self::pref_zeros(&hashed).is_ok() { return i; -- cgit v1.2.3