From 25687d0f580aa9104049e6c8a38a13fbd168ce84 Mon Sep 17 00:00:00 2001 From: Herr Seppia Date: Tue, 19 Mar 2024 16:58:06 +0100 Subject: [PATCH] Remove iter.rev Resolves #139 --- CHANGELOG.md | 2 ++ src/kbucket/key.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b5f802..f136f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change 'need_bootstrappers' to have dinamically threshold [#135] - Change `BinaryID::from_nonce` to return result [#136] - Change maintainer to ping nodes while removal [#138] +- Remove `iter.rev()` from BinaryID verification [#139] ## [0.6.0] - 2023-11-01 @@ -139,6 +140,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [#135]: https://github.com/dusk-network/kadcast/issues/135 [#136]: https://github.com/dusk-network/kadcast/issues/136 [#138]: https://github.com/dusk-network/kadcast/issues/138 +[#139]: https://github.com/dusk-network/kadcast/issues/139 diff --git a/src/kbucket/key.rs b/src/kbucket/key.rs index d6b3a7c..10191a4 100644 --- a/src/kbucket/key.rs +++ b/src/kbucket/key.rs @@ -120,7 +120,7 @@ impl BinaryID { let nonce_bytes = nonce.to_le_bytes(); hasher.update(nonce_bytes); if BinaryID::verify_difficulty( - &mut hasher.finalize_reset().iter().rev(), + &mut hasher.finalize_reset().iter(), K_DIFF_PRODUCED_BIT, ) { return Self { @@ -139,7 +139,7 @@ impl BinaryID { hasher.update(self.bytes); hasher.update(self.nonce); BinaryID::verify_difficulty( - &mut hasher.finalize().iter().rev(), + &mut hasher.finalize().iter(), K_DIFF_MIN_BIT, ) }