When Gupax can't read disk files at startup, it will [Error],
with an option to reset the state file, the user is given two
options [Yes] or [No].
Gupax's global error screen system ignores new errors from
overriding the current IF the current is a [Panic]. This makes
sure the worst errors stay on screen.
This also means after clicking [Yes], it will get ignored and the
screen won't change. So, allow for certain buttons to pass through.
I should probably re-make this whole global error screen system,
it's pretty much a global variable anyone can mutate randomly.
General cleanup and optimizations. Some functions are fixed,
some were turned into [const fn], and other small stuff like
[AtomicUnit] using a [u64] instead of a [u128]
Writing [a.lock().unwrap().b.lock().unwrap()] sucks, so these are
some macros that are for common situations. This commit also has
a [sed] replace on all previous code that _could_ have been a macro,
which they all are now.
Hopefully nothing breaks :D
This adds all necessary functions/conversions/serde/tests for the
new APIs. It also includes the actual reads inside the watchdog loop.
Every loop, [tick] will increment by 1. At [60], the watchdog
will attempt to read and parse the [network] & [pool] APIs.
Since the loop is [900ms], this means this will occur around
every 54 seconds. [tick] gets reset upon successful read/parsing.
Instead of a single "true" filename when walking dirs searching
for the newly downloaded (Gupax|P2Pool|XMRig), allow for multiple
valid names as long as they _seem_ correct AND are files, e.g:
GUPAX|Gupax|gupax (.exe)
P2POOL|P2Pool|P2pool|p2pool (.exe)
XMRIG|XMRig|Xmrig|xmrig (.exe)
If the packaging naming schemes change for any of these,
the update code will be able to actually handle it.
Includes some small fixes:
- [localhost] will always be changed to [127.0.0.1] in the case
of XMRig (it doesn't understand localhost by itself)
- P2Pool/XMRig API path now checks for a [/] or [\]
and correctly applies the endpoint, e.g:
BASEPATH = "/home/hinto/p2pool"
ENDPOINT = "local/stats"
if BASEPATH doesn't end with '/' { BASEPATH.push('/') }
API_PATH = BASEPATH + ENDPOINT ("/home/hinto/p2pool/local/stats")
- P2Pool payout line got changed in: be18ad4177
The regex is now a more generic: [payout of [0-9].[0-9]+ XMR]