aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2015-04-20 10:13:18 -0700
committerGregory Maxwell <greg@xiph.org>2015-04-20 10:13:18 -0700
commit219953ce5095c0430713e4f67d222bdb19d2bdbc (patch)
treec1eb397c1731ebe70088539aa930f6dfb266274a /src/wallet/wallet.cpp
parentb6ea3bcede1cbbf89486b9d67329e0110c4624ae (diff)
downloadbitcoin-219953ce5095c0430713e4f67d222bdb19d2bdbc.tar.xz
Show zero value txouts in listunspent.
It's reasonable that automatic coin selection will not pick a zero value txout, but they're actually spendable; and you should know if you have them. Listing also makes them available to tools like dust-b-gone.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 0d40469393..f0ee834913 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1481,7 +1481,7 @@ CAmount CWallet::GetImmatureWatchOnlyBalance() const
/**
* populate vCoins with vector of available COutputs.
*/
-void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl) const
+void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const CCoinControl *coinControl, bool fIncludeZeroValue) const
{
vCoins.clear();
@@ -1508,7 +1508,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
isminetype mine = IsMine(pcoin->vout[i]);
if (!(IsSpent(wtxid, i)) && mine != ISMINE_NO &&
- !IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0 &&
+ !IsLockedCoin((*it).first, i) && (pcoin->vout[i].nValue > 0 || fIncludeZeroValue) &&
(!coinControl || !coinControl->HasSelected() || coinControl->IsSelected((*it).first, i)))
vCoins.push_back(COutput(pcoin, i, nDepth, (mine & ISMINE_SPENDABLE) != ISMINE_NO));
}