diff options
Diffstat (limited to 'src/main_gui.cpp')
| -rw-r--r-- | src/main_gui.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
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() | |||
| 115 | printf("Mining mode:\n"); | 115 | printf("Mining mode:\n"); |
| 116 | printf(" /operator\n"); | 116 | printf(" /operator\n"); |
| 117 | printf(" /participant=POOL_BTF_ADDRESS\n"); | 117 | printf(" /participant=POOL_BTF_ADDRESS\n"); |
| 118 | printf(" /payoutaddr=BTF_ADDRESS (participant: pay shares to this address, no wallet needed)\n"); | ||
| 119 | printf(" /payoutfile=FILE (participant: rotate payout addresses from file)\n"); | ||
| 120 | printf(" /hashthreads=N (participant: mining threads, default cores-1)\n"); | ||
| 118 | printf(" /solomine\n"); | 121 | printf(" /solomine\n"); |
| 119 | printf(" /genproclimit=N (mining threads; 0 or absent = every core but one)\n"); | 122 | printf(" /genproclimit=N (mining threads; 0 or absent = every core but one)\n"); |
| 120 | printf(" /checkblocks=N (blocks re-verified at startup, default 288, 0 = all)\n"); | 123 | printf(" /checkblocks=N (blocks re-verified at startup, default 288, 0 = all)\n"); |
| @@ -225,6 +228,18 @@ static void ParseStartupArguments(int argc, char* argv[]) | |||
| 225 | fMineModeFromCommandLine = true; | 228 | fMineModeFromCommandLine = true; |
| 226 | } | 229 | } |
| 227 | 230 | ||
| 231 | string payoutAddr = argval2(argc, argv, "/payoutaddr", "-payoutaddr"); | ||
| 232 | if (!payoutAddr.empty()) | ||
| 233 | strPayoutAddress = payoutAddr; | ||
| 234 | |||
| 235 | string payoutFile = argval2(argc, argv, "/payoutfile", "-payoutfile"); | ||
| 236 | if (!payoutFile.empty()) | ||
| 237 | strPayoutFile = payoutFile; | ||
| 238 | |||
| 239 | string hashThreads = argval2(argc, argv, "/hashthreads", "-hashthreads"); | ||
| 240 | if (!hashThreads.empty()) | ||
| 241 | nHashThreads = atoi(hashThreads.c_str()); | ||
| 242 | |||
| 228 | string poolName = argval2(argc, argv, "/poolname", "-poolname"); | 243 | string poolName = argval2(argc, argv, "/poolname", "-poolname"); |
| 229 | if (!poolName.empty()) | 244 | if (!poolName.empty()) |
| 230 | strPoolName = poolName; | 245 | strPoolName = poolName; |
| @@ -610,6 +625,31 @@ int main(int argc, char* argv[]) | |||
| 610 | 625 | ||
| 611 | ReacceptWalletTransactions(); | 626 | ReacceptWalletTransactions(); |
| 612 | 627 | ||
| 628 | // /dumpaddresses=N:FILE -- generate N fresh wallet keys and write their | ||
| 629 | // addresses (one per line) to FILE, then exit. Keys stay in this wallet; | ||
| 630 | // the file alone is enough for a miner elsewhere to rotate payout | ||
| 631 | // addresses via /payoutfile. (No HD/xpub exists in this wallet format.) | ||
| 632 | string dumpSpec = argval2(argc, argv, "/dumpaddresses", "-dumpaddresses"); | ||
| 633 | if (!dumpSpec.empty()) | ||
| 634 | { | ||
| 635 | size_t colon = dumpSpec.rfind(':'); | ||
| 636 | if (colon == string::npos) { fprintf(stderr, "usage: /dumpaddresses=N:FILE\n"); return 1; } | ||
| 637 | int n = atoi(dumpSpec.substr(0, colon).c_str()); | ||
| 638 | string file = dumpSpec.substr(colon + 1); | ||
| 639 | FILE* f = fopen(file.c_str(), "w"); | ||
| 640 | if (!f) { fprintf(stderr, "cannot open %s\n", file.c_str()); return 1; } | ||
| 641 | for (int i = 0; i < n; i++) | ||
| 642 | { | ||
| 643 | CKey key; | ||
| 644 | key.MakeNewKey(); | ||
| 645 | if (!AddKey(key)) { fclose(f); fprintf(stderr, "AddKey failed at %d\n", i); return 1; } | ||
| 646 | fprintf(f, "%s\n", PubKeyToAddress(key.GetPubKey()).c_str()); | ||
| 647 | } | ||
| 648 | fclose(f); | ||
| 649 | printf("wrote %d fresh wallet addresses to %s\n", n, file.c_str()); | ||
| 650 | return 0; | ||
| 651 | } | ||
| 652 | |||
| 613 | if (!StartNode(strErrors)) { fprintf(stderr,"StartNode: %s\n",strErrors.c_str()); return 1; } | 653 | if (!StartNode(strErrors)) { fprintf(stderr,"StartNode: %s\n",strErrors.c_str()); return 1; } |
| 614 | 654 | ||
| 615 | if (nMineMode == MINE_OPERATOR) { | 655 | if (nMineMode == MINE_OPERATOR) { |