Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

fix(whisper): correct PoW calculation #10166

Merged
merged 1 commit into from Jan 11, 2019
Merged

fix(whisper): correct PoW calculation #10166

merged 1 commit into from Jan 11, 2019

Conversation

niklasad1
Copy link
Collaborator

@niklasad1 niklasad1 commented Jan 10, 2019

Closes #9625

  • Fix off-by-one error on leading_zeros which was used to index in the hash to get leading zeros when not aligned on byte boundary (i.e, all the bits in a byte was not zero such as 0001 1111)
  • Fix u64 overflow by using float powi instead of shifting because leading_zeros can be bigger than 63

* Fix off-by-one error on `leading_zeros` which was used to index in the hash to get leading zeros when not aligned on byte boundary (i.e, all the bits in a byte was not zero such as 0001 1111)
* Fix overflow by shifting with bigger value than 63
@niklasad1 niklasad1 added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Jan 10, 2019
@5chdn 5chdn added this to the 2.4 milestone Jan 10, 2019
@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 11, 2019
@sorpaas sorpaas merged commit 67eee6a into master Jan 11, 2019
@sorpaas sorpaas deleted the whisper/fix-pow-calc branch January 11, 2019 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants