upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index aa9c23d..c9e7dee 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -2,6 +2,7 @@
2 2
3#include "headers_core.h" 3#include "headers_core.h"
4#include "selftest.h" 4#include "selftest.h"
5#include "walletcmd.h"
5#include <thread> // hardware_concurrency, to sanity-check /genproclimit 6#include <thread> // hardware_concurrency, to sanity-check /genproclimit
6#ifndef _WIN32 7#ifndef _WIN32
7#include <csignal> 8#include <csignal>
@@ -78,6 +79,11 @@ static void PrintUsage()
78 printf(" /dumpwallet=FILE (export private keys as text -- readable by\n"); 79 printf(" /dumpwallet=FILE (export private keys as text -- readable by\n");
79 printf(" anyone, so guard it like cash)\n"); 80 printf(" anyone, so guard it like cash)\n");
80 printf(" /importwallet=FILE (load keys from such a file back in)\n"); 81 printf(" /importwallet=FILE (load keys from such a file back in)\n");
82 printf(" /newaddress (print the next receiving address, then exit)\n");
83 printf(" /newphrase (create a twelve-word recovery phrase for a\n");
84 printf(" wallet that has none, show it once, exit)\n");
85 printf(" /restorephrase=\"WORDS\" (rebuild this wallet from a phrase and scan\n");
86 printf(" the chain for its coins, then exit)\n");
81 printf(" /rescan (walk the chain for coins this wallet owns\n"); 87 printf(" /rescan (walk the chain for coins this wallet owns\n");
82 printf(" but never recorded, then exit)\n"); 88 printf(" but never recorded, then exit)\n");
83 printf("\n"); 89 printf("\n");
@@ -347,6 +353,38 @@ int main(int argc, char* argv[])
347 // /rescan -- walk the chain and pick up anything the wallet's keys own but 353 // /rescan -- walk the chain and pick up anything the wallet's keys own but
348 // the wallet never recorded. Cheap to offer and the only recourse when a 354 // the wallet never recorded. Cheap to offer and the only recourse when a
349 // balance is wrong for this reason. 355 // balance is wrong for this reason.
356 string strShow = argval2(argc, argv, "/showderived", "-showderived");
357 if (!strShow.empty())
358 {
359 int nRet = CmdShowDerived(atoi(strShow.c_str()));
360 DBFlush(true);
361 return nRet;
362 }
363
364 if (arg(argc,argv,"/newaddress") || arg(argc,argv,"-newaddress"))
365 {
366 int nRet = CmdNewAddress();
367 DBFlush(true);
368 return nRet;
369 }
370
371 if (arg(argc,argv,"/newphrase") || arg(argc,argv,"-newphrase"))
372 {
373 int nRet = CmdNewPhrase();
374 DBFlush(true);
375 return nRet;
376 }
377
378 string strRestore = argval2(argc, argv, "/restorephrase", "-restorephrase");
379 if (!strRestore.empty())
380 {
381 string strDepth = argval2(argc, argv, "/restoredepth", "-restoredepth");
382 int nMinDepth = strDepth.empty() ? 0 : atoi(strDepth.c_str());
383 int nRet = CmdRestorePhrase(strRestore, nMinDepth);
384 DBFlush(true);
385 return nRet;
386 }
387
350 if (arg(argc,argv,"/rescan") || arg(argc,argv,"-rescan")) 388 if (arg(argc,argv,"/rescan") || arg(argc,argv,"-rescan"))
351 { 389 {
352 string strScanError; 390 string strScanError;