aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-02-11 12:49:33 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-02-11 12:49:33 +0100
commit1bbca249b202c4802cc2c4d4de4a26e6392b4d92 (patch)
tree5a255f3765474b8e1476fdf4a821580309853e1e /src/wallet.cpp
parentd5fa3eff03b4e58fc46d72599904231408cbce80 (diff)
Add option to avoid spending unconfirmed change
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 979560651c..0e51ebb448 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -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)));
}