upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/util.cpp
diff options
context:
space:
mode:
authorVictorio Nascimento <155357371+Vic-Nas@users.noreply.github.com>2026-07-27 16:45:28 -0400
committerGitHub <noreply@github.com>2026-07-27 17:45:28 -0300
commit6ca1a1d6799474f8ca977b93ab630af7ace879c2 (patch)
treea0312ebc10fc6a56742d0e5caa85c31eb6d3eaa7 /src/util.cpp
parent56df9830d5a002ff9ce3fac47e497673f8159e39 (diff)
Add Linux GUI installer via Wine (#3)
* Add Linux GUI installer via Wine * Fix launcher creation and add BTF_RELAY env var support * Pool server, Linux GUI, unified binary, README update * Root Makefile: make linux / make windows, cleaner README * Remove headless.cpp * Fix XPM color count mismatch causing toolbar image errors on Linux * XPM icons: same code on Windows and Linux, no ifdefs around image loading * Fix GTK icon crash and Linux printf format * btfrv: 10s socket timeout on relay connects * Faster peer discovery: more dials per pass, shorter backoff and sleep * Parallel btf peer connections * Fix GetMyExternalIP - was disabled, now uses modern IP echo services * Fix tunnel disconnect on idle and restore external IP detection * Filter stale Nostr descriptors * Sort peers by freshness, fresh first * Pool: add .btf Stratum listener — miners connect via rendezvous, no port forwarding needed * btf pool: self-replacing listeners, one per relay, no queuing between miners * Mining modes: solo/operator/participant — pool server on-demand, participant Stratum client * Status bar: show external IP and .btf address * README: clean rewrite, concept-first, minimal * make linux produces AppImage * make linux produces AppImage * Pool dashboard: connect instructions, tabs, share bars * Perf fixes: GetMyExternalIP threaded, btf listener counted * Perf fixes: GetMyExternalIP threaded, btf listener counted * Fix pool payouts: defer until coinbase maturity * Pool: clean mode switching, IP warning * Pool: clean mode switching * Fix gPoolRunning: remove static * AppImage: use real icon from bitcoin.ico * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Fix exit crash; Mining menu * Windows build: use mingw32-make * Windows build: simpler make invocation * Add deps-windows target * Windows build fixes * Windows build fixes * Windows makefile: fix obj dir * Windows: output to repo root * Windows: bundle DLLs into zip * Replace wxWidgets with ImGui+GLFW: same build on Linux and Windows * Fix %I64d that slipped back through rebase (main.h, net.h) * MinGW: add _mkdir shim for non-MSVC Windows; fix %I64d * Fix gPoolRunning extern outside ifndef _WIN32 * Remove -lboost_system: boost is header-only in this codebase * Status bar: copy buttons for IP and .btf address * Windows: add app icon via windres, strip wx stuff from rc file * Clean GUI: single Options menu item, bigger font, better spacing, cleaner options dialog; update README * GUI: embed Roboto font at 16px for clear readability on all platforms * Windows: windres depends on obj dir target * Fix balance hidden off-screen: put on own line below address bar * Windows: inline mkdir in every rule, remove dir target that confused make * Windows: move all target to top so it's the default rule * Fix pool server not starting: always start when operator selected, re-sync dialog state on open * Write debug.log to data directory (AppData/Roaming/Bitflash on Windows) * Participant miner: use wallet address as username so payouts go to wallet * Add .gitattributes to lock LF line endings, prevent CRLF drift * Refactor pool mining to btf-only transport * Persist pool settings and startup wiring * Prune stale peers and expose pool queries * Fix build regressions and add CLI mode/arg parity * Fix rpc miner stats declaration order * Centralize pool runtime extern declarations * Separate operator/participant dashboards and restore peer stats * Add live telemetry strip and clearer per-mode runtime metrics * Reduce mining dashboard clutter and remove manual pool entry * Count only authorized pool miners * Seed initial pool job on startup * Use a real share target for pool work * Switch pool accounting to round-based shares * Fix nostr pool announcer stats call sites * Fix pool stats definition order * Improve pool worker status display * Add mutex include for participant status * Replace ImClamp in dashboard layout * Clarify participant work status * Log participant status transitions * Reduce peer discovery log noise * Add participant status badge * Track participant auth acknowledgements * Log and validate pool job delivery --------- Co-authored-by: Bitflash Pool Dev <pool@bitflash>
Diffstat (limited to 'src/util.cpp')
-rw-r--r--src/util.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/util.cpp b/src/util.cpp
index 0b794d4..7f56530 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -200,10 +200,11 @@ void PrintException(std::exception* pex, const char* pszThread)
200 snprintf(pszMessage, sizeof(pszMessage), 200 snprintf(pszMessage, sizeof(pszMessage),
201 "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread); 201 "UNKNOWN EXCEPTION \n%s in %s \n", pszModule, pszThread);
202 printf("\n\n************************\n%s", pszMessage); 202 printf("\n\n************************\n%s", pszMessage);
203 if (wxTheApp) 203 // Suppress the dialog and rethrow during shutdown — threads unwinding on
204 wxMessageBox(pszMessage, "Error", wxOK | wxICON_ERROR); 204 // exit cause spurious "UNKNOWN EXCEPTION" popups that aren't real errors.
205 throw; 205 // Show error in GUI via repaint signal — GUI polls g_errorMessage
206 //DebugBreak(); 206 if (!fShutdown)
207 throw;
207} 208}
208 209
209 210
@@ -224,7 +225,7 @@ void ParseString(const string& str, char c, vector<string>& v)
224string FormatMoney(int64 n, bool fPlus) 225string FormatMoney(int64 n, bool fPlus)
225{ 226{
226 n /= CENT; 227 n /= CENT;
227 string str = strprintf("%I64d.%02I64d", (n > 0 ? n : -n)/100, (n > 0 ? n : -n)%100); 228 string str = strprintf("%lld.%02lld", (n > 0 ? n : -n)/100, (n > 0 ? n : -n)%100);
228 for (int i = 6; i < str.size(); i += 4) 229 for (int i = 6; i < str.size(); i += 4)
229 if (isdigit(str[str.size() - i - 1])) 230 if (isdigit(str[str.size() - i - 1]))
230 str.insert(str.size() - i, 1, ','); 231 str.insert(str.size() - i, 1, ',');
@@ -373,7 +374,7 @@ void AddTimeData(unsigned int ip, int64 nTime)
373 if (vTimeOffsets.empty()) 374 if (vTimeOffsets.empty())
374 vTimeOffsets.push_back(0); 375 vTimeOffsets.push_back(0);
375 vTimeOffsets.push_back(nOffsetSample); 376 vTimeOffsets.push_back(nOffsetSample);
376 printf("Added time data, samples %d, ip %08x, offset %+I64d (%+I64d minutes)\n", vTimeOffsets.size(), ip, vTimeOffsets.back(), vTimeOffsets.back()/60); 377 printf("Added time data, samples %d, ip %08x, offset %+lld (%+lld minutes)\n", vTimeOffsets.size(), ip, vTimeOffsets.back(), vTimeOffsets.back()/60);
377 if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1) 378 if (vTimeOffsets.size() >= 5 && vTimeOffsets.size() % 2 == 1)
378 { 379 {
379 sort(vTimeOffsets.begin(), vTimeOffsets.end()); 380 sort(vTimeOffsets.begin(), vTimeOffsets.end());
@@ -387,7 +388,7 @@ void AddTimeData(unsigned int ip, int64 nTime)
387 /// to make sure it doesn't get changed again 388 /// to make sure it doesn't get changed again
388 } 389 }
389 foreach(int64 n, vTimeOffsets) 390 foreach(int64 n, vTimeOffsets)
390 printf("%+I64d ", n); 391 printf("%+lld ", n);
391 printf("| nTimeOffset = %+I64d (%+I64d minutes)\n", nTimeOffset, nTimeOffset/60); 392 printf("| nTimeOffset = %+lld (%+lld minutes)\n", nTimeOffset, nTimeOffset/60);
392 } 393 }
393} 394}