Skip to content

Commit

Permalink
Simplify and document -custombackupthreshold
Browse files Browse the repository at this point in the history
Also move -backuppath and -zpivbackuppath to more appropriate areas in
the help output.
  • Loading branch information
Fuzzbawls committed Apr 29, 2018
1 parent c034fde commit 1e3fdea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ std::string HelpMessage(HelpMessageMode mode)
#endif
}
strUsage += HelpMessageOpt("-datadir=<dir>", _("Specify data directory"));
strUsage += HelpMessageOpt("-backuppath=<(dir/file)>", _("Specify custom backup path to add a copy of any wallet backup. If set as dir, every backup generates a timestamped file. If set as file, will rewrite to that file every backup."));
strUsage += HelpMessageOpt("-dbcache=<n>", strprintf(_("Set database cache size in megabytes (%d to %d, default: %d)"), nMinDbCache, nMaxDbCache, nDefaultDbCache));
strUsage += HelpMessageOpt("-loadblock=<file>", _("Imports blocks from external blk000??.dat file") + " " + _("on startup"));
strUsage += HelpMessageOpt("-maxreorg=<n>", strprintf(_("Set the Maximum reorg depth (default: %u)"), Params(CBaseChainParams::MAIN).MaxReorganizationDepth()));
Expand Down Expand Up @@ -428,7 +427,9 @@ std::string HelpMessage(HelpMessageMode mode)

#ifdef ENABLE_WALLET
strUsage += HelpMessageGroup(_("Wallet options:"));
strUsage += HelpMessageOpt("-backuppath=<dir|file>", _("Specify custom backup path to add a copy of any wallet backup. If set as dir, every backup generates a timestamped file. If set as file, will rewrite to that file every backup."));
strUsage += HelpMessageOpt("-createwalletbackups=<n>", _("Number of automatic wallet backups (default: 10)"));
strUsage += HelpMessageOpt("-custombackupthreshold=<n>", strprintf(_("Number of custom location backups to retain (default: %d)"), DEFAULT_CUSTOMBACKUPTHRESHOLD));
strUsage += HelpMessageOpt("-disablewallet", _("Do not load the wallet and disable wallet RPC calls"));
strUsage += HelpMessageOpt("-keypool=<n>", strprintf(_("Set key pool size to <n> (default: %u)"), 100));
if (GetBoolArg("-help-debug", false))
Expand Down Expand Up @@ -530,13 +531,14 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-budgetvotemode=<mode>", _("Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)"));

strUsage += HelpMessageGroup(_("Zerocoin options:"));
#ifdef ENABLE_WALLET
strUsage += HelpMessageOpt("-enablezeromint=<n>", strprintf(_("Enable automatic Zerocoin minting (0-1, default: %u)"), 1));
strUsage += HelpMessageOpt("-zeromintpercentage=<n>", strprintf(_("Percentage of automatically minted Zerocoin (1-100, default: %u)"), 10));
strUsage += HelpMessageOpt("-preferredDenom=<n>", strprintf(_("Preferred Denomination for automatically minted Zerocoin (1/5/10/50/100/500/1000/5000), 0 for no preference. default: %u)"), 0));
strUsage += HelpMessageOpt("-backupzpiv=<n>", strprintf(_("Enable automatic wallet backups triggered after each zPIV minting (0-1, default: %u)"), 1));
strUsage += HelpMessageOpt("-zpivbackuppath=<dir|file>", _("Specify custom backup path to add a copy of any automatic zPIV backup. If set as dir, every backup generates a timestamped file. If set as file, will rewrite to that file every backup. If backuppath is set as well, 4 backups will happen"));
#endif // ENABLE_WALLET
strUsage += HelpMessageOpt("-reindexzerocoin=<n>", strprintf(_("Delete all zerocoin spends and mints that have been recorded to the blockchain database and reindex them (0-1, default: %u)"), 0));
strUsage += HelpMessageOpt("-zpivbackuppath=<(dir/file)>", _("Specify custom backup path to add a copy of any automatic zPIV backup. If set as dir, every backup generates a timestamped file. If set as file, will rewrite to that file every backup. If backuppath is set as well, 4 backups will happen"));


// strUsage += " -anonymizepivxamount=<n> " + strprintf(_("Keep N PIV anonymized (default: %u)"), 0) + "\n";
// strUsage += " -liquidityprovider=<n> " + strprintf(_("Provide liquidity to Obfuscation by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), 0) + "\n";
Expand Down
2 changes: 2 additions & 0 deletions src/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ static const CAmount DEFAULT_TRANSACTION_MAXFEE = 1 * COIN;
static const CAmount nHighTransactionMaxFeeWarning = 100 * nHighTransactionFeeWarning;
//! Largest (in bytes) free transaction we're willing to create
static const unsigned int MAX_FREE_TRANSACTION_CREATE_SIZE = 1000;
//! -custombackupthreshold default
static const int DEFAULT_CUSTOMBACKUPTHRESHOLD = 1;

// Zerocoin denomination which creates exactly one of each denominations:
// 6666 = 1*5000 + 1*1000 + 1*500 + 1*100 + 1*50 + 1*10 + 1*5 + 1
Expand Down
6 changes: 2 additions & 4 deletions src/walletdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,10 +948,8 @@ bool BackupWallet(const CWallet& wallet, const filesystem::path& strDest, bool f
bool defaultPath = AttemptBackupWallet(wallet, pathSrc.string(), pathDest.string());

if(defaultPath && !pathCustom.empty()) {
string strThreshold = GetArg("-custombackupthreshold", "");
int nThreshold = 0;
if (strThreshold != "") {
nThreshold = atoi(strThreshold);
int nThreshold = GetArg("-custombackupthreshold", DEFAULT_CUSTOMBACKUPTHRESHOLD);
if (nThreshold > 0) {

typedef std::multimap<std::time_t, filesystem::path> folder_set_t;
folder_set_t folderSet;
Expand Down

0 comments on commit 1e3fdea

Please sign in to comment.