Browse Source

Add option to avoid spending unconfirmed change

Conflicts:
	src/init.cpp
	src/wallet.cpp
	src/wallet.h

Rebased-from: 86d40cab2725e758f4ddaf1e1149f0ab897df110 0.8.x
0.8
Wladimir J. van der Laan 11 years ago committed by Warren Togami
parent
commit
6b7c937114
  1. 2
      src/init.cpp
  2. 4
      src/wallet.cpp
  3. 2
      src/wallet.h

2
src/init.cpp

@ -358,6 +358,7 @@ std::string HelpMessage() @@ -358,6 +358,7 @@ std::string HelpMessage()
" -rpcthreads=<n> " + _("Set the number of threads to service RPC calls (default: 4)") + "\n" +
" -blocknotify=<cmd> " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" +
" -walletnotify=<cmd> " + _("Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)") + "\n" +
" -spendzeroconfchange " + _("Spend unconfirmed change when sending transactions (default: 1)") + "\n" +
" -alertnotify=<cmd> " + _("Execute command when a relevant alert is received (%s in cmd is replaced by message)") + "\n" +
" -upgradewallet " + _("Upgrade wallet to latest format") + "\n" +
" -keypool=<n> " + _("Set key pool size to <n> (default: 100)") + "\n" +
@ -627,6 +628,7 @@ bool AppInit2(boost::thread_group& threadGroup) @@ -627,6 +628,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);
if (mapArgs.count("-mininput"))
{

4
src/wallet.cpp

@ -14,6 +14,8 @@ @@ -14,6 +14,8 @@
using namespace std;
bool bSpendZeroConfChange = true;
//////////////////////////////////////////////////////////////////////////////
//
// mapWallet
@ -1170,7 +1172,7 @@ bool CWallet::SelectCoins(int64 nTargetValue, set<pair<const CWalletTx*,unsigned @@ -1170,7 +1172,7 @@ bool CWallet::SelectCoins(int64 nTargetValue, set<pair<const CWalletTx*,unsigned
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)));
}

2
src/wallet.h

@ -18,6 +18,8 @@ @@ -18,6 +18,8 @@
#include "util.h"
#include "walletdb.h"
extern bool bSpendZeroConfChange;
class CAccountingEntry;
class CWalletTx;
class CReserveKey;

Loading…
Cancel
Save