Constrain constant values to a single location in code
This commit is contained in:
@@ -85,7 +85,7 @@ bool CDBEnv::Open(const boost::filesystem::path& pathIn)
|
||||
LogPrintf("CDBEnv::Open: LogDir=%s ErrorFile=%s\n", pathLogDir.string(), pathErrorFile.string());
|
||||
|
||||
unsigned int nEnvFlags = 0;
|
||||
if (GetBoolArg("-privdb", true))
|
||||
if (GetBoolArg("-privdb", DEFAULT_WALLET_PRIVDB))
|
||||
nEnvFlags |= DB_PRIVATE;
|
||||
|
||||
dbenv->set_lg_dir(pathLogDir.string().c_str());
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <db_cxx.h>
|
||||
|
||||
static const unsigned int DEFAULT_WALLET_DBLOGSIZE = 100;
|
||||
static const bool DEFAULT_WALLET_PRIVDB = true;
|
||||
|
||||
extern unsigned int nWalletDBUpdated;
|
||||
|
||||
|
||||
@@ -2260,7 +2260,7 @@ bool CWallet::NewKeyPool()
|
||||
if (IsLocked())
|
||||
return false;
|
||||
|
||||
int64_t nKeys = max(GetArg("-keypool", 100), (int64_t)0);
|
||||
int64_t nKeys = max(GetArg("-keypool", DEFAULT_KEYPOOL_SIZE), (int64_t)0);
|
||||
for (int i = 0; i < nKeys; i++)
|
||||
{
|
||||
int64_t nIndex = i+1;
|
||||
@@ -2287,7 +2287,7 @@ bool CWallet::TopUpKeyPool(unsigned int kpSize)
|
||||
if (kpSize > 0)
|
||||
nTargetSize = kpSize;
|
||||
else
|
||||
nTargetSize = max(GetArg("-keypool", 100), (int64_t) 0);
|
||||
nTargetSize = max(GetArg("-keypool", DEFAULT_KEYPOOL_SIZE), (int64_t) 0);
|
||||
|
||||
while (setKeyPool.size() < (nTargetSize + 1))
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ extern bool bSpendZeroConfChange;
|
||||
extern bool fSendFreeTransactions;
|
||||
extern bool fPayAtLeastCustomFee;
|
||||
|
||||
static const unsigned int DEFAULT_KEYPOOL_SIZE = 100;
|
||||
//! -paytxfee default
|
||||
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
|
||||
//! -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB
|
||||
@@ -53,6 +54,7 @@ static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 2;
|
||||
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;
|
||||
static const bool DEFAULT_WALLETBROADCAST = true;
|
||||
|
||||
class CAccountingEntry;
|
||||
class CBlockIndex;
|
||||
|
||||
@@ -810,7 +810,7 @@ void ThreadFlushWalletDB(const string& strFile)
|
||||
if (fOneThread)
|
||||
return;
|
||||
fOneThread = true;
|
||||
if (!GetBoolArg("-flushwallet", true))
|
||||
if (!GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET))
|
||||
return;
|
||||
|
||||
unsigned int nLastSeen = nWalletDBUpdated;
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
static const bool DEFAULT_FLUSHWALLET = true;
|
||||
|
||||
class CAccount;
|
||||
class CAccountingEntry;
|
||||
struct CBlockLocator;
|
||||
|
||||
Reference in New Issue
Block a user