diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-10-21 21:25:11 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-10-21 21:25:11 +0800 |
| commit | f396a01d7ba171e30e44084dc0d0a4f0a146956f (patch) | |
| tree | 84c4b1e6b80d01fc81d95bbfb646e7c160fa7a11 /src/blocks.rs | |
| parent | d15e68de27f8b5e1a3130a0f8415dd132e5bbe58 (diff) | |
Revert "chore(block): directly use self.digest instead"
This reverts commit dec78fd8bb4cc8f52c857088b274fd06cea2e730.
oops, it did not account for nonce
Diffstat (limited to 'src/blocks.rs')
| -rw-r--r-- | src/blocks.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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; |
