diff --git a/src/init.cpp b/src/init.cpp index 1704bdad3..0a963b98b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -358,6 +358,7 @@ std::string HelpMessage() " -rpcthreads= " + _("Set the number of threads to service RPC calls (default: 4)") + "\n" + " -blocknotify= " + _("Execute command when the best block changes (%s in cmd is replaced by block hash)") + "\n" + " -walletnotify= " + _("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= " + _("Execute command when a relevant alert is received (%s in cmd is replaced by message)") + "\n" + " -upgradewallet " + _("Upgrade wallet to latest format") + "\n" + " -keypool= " + _("Set key pool size to (default: 100)") + "\n" + @@ -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")) { diff --git a/src/wallet.cpp b/src/wallet.cpp index cd5a3f9eb..da288bdf6 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -14,6 +14,8 @@ using namespace std; +bool bSpendZeroConfChange = true; + ////////////////////////////////////////////////////////////////////////////// // // mapWallet @@ -1170,7 +1172,7 @@ bool CWallet::SelectCoins(int64 nTargetValue, set