Miner testing
I fixed the height calculation and added a sanity check. I also added some extra testing, improved the logging, and changed build.Critical
to not print to stderr during normal testing, because it is triggered intentionally during testing.
The logic on build.Critical
will only print to stderr if build.Release != "testing" || !build.DEBUG
, which means that if you are doing testing without the DEBUG flag set, it will print.
This PR should fix the mining troubles that have been reported. As best I can tell, it affects all miners, is dependent on what order you see blocks in, and it's just coincidence that only 051 miners were affected this time around. I do believe the bug is fixed after this PR.