pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.77k stars 1.21k forks source link

Hashing may be broken on MacOS #184

Closed hashbender closed 5 years ago

hashbender commented 5 years ago

Hi, First of all, thanks for this awesome utility.

I'm testing out sha256d on my Macbook.

I've added a bit of logging to see what header actually results in a valid hash.

Hash:   00000000218d3be1e2e81f93097812d12dceeb51d249ebcced5cd730e20cba86
Target: 00000000ffff0000000000000000000000000000000000000000000000000000
[2019-08-28 20:06:14] FOUND!
[2019-08-28 20:06:14] HEADER: 200000008dd67af66b6876482d200ff2ba053e3d73ea1cb50019d73100000000000000009d71cec245dcba060e7602a592c9327e3329b112e16177101797945c35b978f55d6740b7171ba3d17e67710e

When I run that header through other hashing libs, it doesn't result in a valid POW. Am I missing something or is this broken on MacOS?

The command I'm running: ./minerd -D -P --url=stratum+tcp://btc-us.f2pool.com:3333 --user=test.user --algo=sha256d

pooler commented 5 years ago

The example above seems correct to me, you just need to get the endianness of the header right if you want to hash it using other libraries.