Veil-Project / veil

Veil-Project
MIT License
117 stars 91 forks source link

[Bug][RPC][Mining] The network hashrate returned by `getmininginfo` rpc is wrong #1018

Closed us77ipis closed 1 year ago

us77ipis commented 1 year ago

The problem is that the function that should return the network hashrate for one of the three mining algos, calculates the average hashrate using the nChainWork "Total amount of work (expected number of hashes) in the chain up to and including this block" which includes the work of all three algos and if I see correctly even also PoS work. https://github.com/Veil-Project/veil/blob/4107c99a2029a07f89ad0b1e0f68c03ec55b7350/src/rpc/mining.cpp#L159

This is also the reason why all the returned network hashrates for the three different algos are always almost the same even though their difficulties vary a lot.