Browse Source
Merge pull request #3651
1bbca24
Add option to avoid spending unconfirmed change (Wladimir J. van der Laan)
try
Wladimir J. van der Laan
11 years ago
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
3 changed files with
5 additions and
1 deletions
-
src/init.cpp
-
src/wallet.cpp
-
src/wallet.h
|
|
@ -274,6 +274,7 @@ std::string HelpMessage(HelpMessageMode hmm) |
|
|
|
strUsage += " -upgradewallet " + _("Upgrade wallet to latest format") + "\n"; |
|
|
|
strUsage += " -wallet=<file> " + _("Specify wallet file (within data directory)") + "\n"; |
|
|
|
strUsage += " -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n"; |
|
|
|
strUsage += " -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n"; |
|
|
|
#endif |
|
|
|
strUsage += "\n" + _("Block creation options:") + "\n"; |
|
|
|
strUsage += " -blockminsize=<n> " + _("Set minimum block size in bytes (default: 0)") + "\n"; |
|
|
@ -539,6 +540,7 @@ bool AppInit2(boost::thread_group& threadGroup) |
|
|
|
if (nTransactionFee > 0.25 * COIN) |
|
|
|
InitWarning(_("Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.")); |
|
|
|
} |
|
|
|
bSpendZeroConfChange = GetArg("-spendzeroconfchange", true); |
|
|
|
|
|
|
|
strWalletFile = GetArg("-wallet", "wallet.dat"); |
|
|
|
#endif |
|
|
|
|
|
@ -18,6 +18,7 @@ using namespace std; |
|
|
|
|
|
|
|
// Settings
|
|
|
|
int64_t nTransactionFee = 0; |
|
|
|
bool bSpendZeroConfChange = true; |
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
@ -1192,7 +1193,7 @@ bool CWallet::SelectCoins(int64_t nTargetValue, set<pair<const CWalletTx*,unsign |
|
|
|
|
|
|
|
return (SelectCoinsMinConf(nTargetValue, 1, 6, vCoins, setCoinsRet, nValueRet) || |
|
|
|
SelectCoinsMinConf(nTargetValue, 1, 1, vCoins, setCoinsRet, nValueRet) || |
|
|
|
SelectCoinsMinConf(nTargetValue, 0, 1, vCoins, setCoinsRet, nValueRet)); |
|
|
|
(bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue, 0, 1, vCoins, setCoinsRet, nValueRet))); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -25,6 +25,7 @@ |
|
|
|
|
|
|
|
// Settings
|
|
|
|
extern int64_t nTransactionFee; |
|
|
|
extern bool bSpendZeroConfChange; |
|
|
|
|
|
|
|
class CAccountingEntry; |
|
|
|
class CCoinControl; |
|
|
|