Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,12 +918,14 @@ bool AppInit2()
LogPrintf("AppInit2 : parameter interaction: -enableswifttx=false -> setting -nSwiftTXDepth=0\n");
}

#ifdef ENABLE_WALLET
if (mapArgs.count("-reservebalance")) {
if (!ParseMoney(mapArgs["-reservebalance"], nReserveBalance)) {
InitError(_("Invalid amount for -reservebalance=<amount>"));
return false;
}
}
#endif

// Make sure enough file descriptors are available
int nBind = std::max((int)mapArgs.count("-bind") + (int)mapArgs.count("-whitebind"), 1);
Expand Down
2 changes: 0 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ bool fAlerts = DEFAULT_ALERTS;
/* If the tip is older than this (in seconds), the node is considered to be in initial block download. */
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;

int64_t nReserveBalance = 0;

/** Fees smaller than this (in upiv) are considered zero fee (for relaying and mining)
* We are ~100 times smaller then bitcoin now (2015-06-23), set minRelayTxFee only 10 times higher
* so it's still 10 times lower comparing to bitcoin.
Expand Down
2 changes: 0 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ extern bool fVerifyingBlocks;
extern bool fLargeWorkForkFound;
extern bool fLargeWorkInvalidChainFound;

extern int64_t nReserveBalance;

extern std::map<uint256, int64_t> mapRejectedBlocks;

/** Best header we've seen so far (used for getheaders queries' starting points). */
Expand Down
6 changes: 2 additions & 4 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bool bSpendZeroConfChange = true;
bool bdisableSystemnotifications = false; // Those bubbles can be annoying and slow down the UI when you get lots of trx
bool fSendFreeTransactions = false;
bool fPayAtLeastCustomFee = true;
int64_t nReserveBalance = 0;

/**
* Fees smaller than this (in upiv) are considered zero fee (for transaction creation)
Expand Down Expand Up @@ -2037,10 +2038,7 @@ bool CWallet::StakeableCoins(std::vector<COutput>* pCoins)
{
CAmount nBalance = GetStakingBalance(GetBoolArg("-coldstaking", true));

if (nBalance == 0) return false;
if (mapArgs.count("-reservebalance") && !ParseMoney(mapArgs["-reservebalance"], nReserveBalance))
return error("%s : invalid reserve balance amount", __func__);
if (nBalance <= nReserveBalance) return false;
if (nBalance == 0 || nBalance <= nReserveBalance) return false;

const bool fIncludeCold = (sporkManager.IsSporkActive(SPORK_17_COLDSTAKING_ENFORCEMENT) &&
GetBoolArg("-coldstaking", true));
Expand Down
1 change: 1 addition & 0 deletions src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ extern bool bSpendZeroConfChange;
extern bool bdisableSystemnotifications;
extern bool fSendFreeTransactions;
extern bool fPayAtLeastCustomFee;
extern int64_t nReserveBalance;

//! -paytxfee default
static const CAmount DEFAULT_TRANSACTION_FEE = 0;
Expand Down