[Feature] Adds mining pool screens #5
Loading…
Reference in a new issue
No description provided.
Delete branch "kdmukai/btclock_v3:mining_stats_v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds current hashrate and earnings screens for Braiins Pool and Ocean.
Depends on btclock/webui#2
Thanks for another great addition to the functionality!
I do have some suggestions for improvement:
src/lib/mining_pool_stats_fetch.cpp
(from line 30) you retrieve the miningPoolName preference multiple times, it's better to retrieve the value one time and store it in a property and the reuse that in the if/else-if statements.src/lib/screen_handler.cpp
Maybe it's better to just add a getMiningPoolName() getter method to
src/lib/mining_pool_stats_fetch.cpp
to DRYshared.hpp
sincedefaults.hpp
is meant for preference defaultssrc/lib/shared.hpp
I think it's better to set the constants in the 70 range (so 70, 71)I've already did a quick and dirty addition of the Noderunners pool, but since it's a solo pool (ckpool based), they don't (can't) show any earnings. The quick solution I used to skip the screen now is:
But I think this can be more efficient. It might make sense to define supported mining pools with interfaces and classes, like this:
Implementation of BraiinsPool example:
You can then declutter the fetch task a lot:
I'm looking for a method to add more icons without using to much extra space. It probably helps a lot to remove the "empty" pixels above and below the logo.
Also I'm looking to load only one of them in memory depending on the setting, and maybe loading them from file system.
And if they are stored on filesystem, hopefully they could be gzipped to.
miningPoolName
lookups fromPreferences
.As I mentioned on telegram, I am in favor of the
Interface
refactor you suggest above. Unfortunately I need to switch gears now and based on my C++ struggles throughout, I'm not confident that even an easy refactor will go smoothly and quickly!