From 6e4865c14c858d00c6cfa6967e66a86b31cd12f8 Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Sat, 8 Aug 2026 02:29:26 +0000 Subject: pool: sync-gate job creation, retry failed payouts; widen nostr relay set - RebuildJob: no jobs with zero peers or a tip older than 30min; mining unsynced produced orphaned blocks and payouts that can never be paid (observed in production: 8 orphan 'found blocks') - payout exec: on SendMoney failure requeue with 60s backoff, up to 30 attempts, instead of silently forfeiting the payment - nostr: add oxtr.dev, nos.social, fmt.wiz.biz, current.fyi, nostr.bg (12 relays total) for announcement redundancy (cherry picked from commit f1986cd7e4a6f69469a2256eb96ff03f3f146792) --- src/main_gui.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'src/main_gui.cpp') diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 875988f..0b4e091 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -115,6 +115,9 @@ static void PrintUsage() printf("Mining mode:\n"); printf(" /operator\n"); printf(" /participant=POOL_BTF_ADDRESS\n"); + printf(" /payoutaddr=BTF_ADDRESS (participant: pay shares to this address, no wallet needed)\n"); + printf(" /payoutfile=FILE (participant: rotate payout addresses from file)\n"); + printf(" /hashthreads=N (participant: mining threads, default cores-1)\n"); printf(" /solomine\n"); printf(" /genproclimit=N (mining threads; 0 or absent = every core but one)\n"); printf(" /checkblocks=N (blocks re-verified at startup, default 288, 0 = all)\n"); @@ -225,6 +228,18 @@ static void ParseStartupArguments(int argc, char* argv[]) fMineModeFromCommandLine = true; } + string payoutAddr = argval2(argc, argv, "/payoutaddr", "-payoutaddr"); + if (!payoutAddr.empty()) + strPayoutAddress = payoutAddr; + + string payoutFile = argval2(argc, argv, "/payoutfile", "-payoutfile"); + if (!payoutFile.empty()) + strPayoutFile = payoutFile; + + string hashThreads = argval2(argc, argv, "/hashthreads", "-hashthreads"); + if (!hashThreads.empty()) + nHashThreads = atoi(hashThreads.c_str()); + string poolName = argval2(argc, argv, "/poolname", "-poolname"); if (!poolName.empty()) strPoolName = poolName; @@ -610,6 +625,31 @@ int main(int argc, char* argv[]) ReacceptWalletTransactions(); + // /dumpaddresses=N:FILE -- generate N fresh wallet keys and write their + // addresses (one per line) to FILE, then exit. Keys stay in this wallet; + // the file alone is enough for a miner elsewhere to rotate payout + // addresses via /payoutfile. (No HD/xpub exists in this wallet format.) + string dumpSpec = argval2(argc, argv, "/dumpaddresses", "-dumpaddresses"); + if (!dumpSpec.empty()) + { + size_t colon = dumpSpec.rfind(':'); + if (colon == string::npos) { fprintf(stderr, "usage: /dumpaddresses=N:FILE\n"); return 1; } + int n = atoi(dumpSpec.substr(0, colon).c_str()); + string file = dumpSpec.substr(colon + 1); + FILE* f = fopen(file.c_str(), "w"); + if (!f) { fprintf(stderr, "cannot open %s\n", file.c_str()); return 1; } + for (int i = 0; i < n; i++) + { + CKey key; + key.MakeNewKey(); + if (!AddKey(key)) { fclose(f); fprintf(stderr, "AddKey failed at %d\n", i); return 1; } + fprintf(f, "%s\n", PubKeyToAddress(key.GetPubKey()).c_str()); + } + fclose(f); + printf("wrote %d fresh wallet addresses to %s\n", n, file.c_str()); + return 0; + } + if (!StartNode(strErrors)) { fprintf(stderr,"StartNode: %s\n",strErrors.c_str()); return 1; } if (nMineMode == MINE_OPERATOR) { -- cgit v1.2.3