Skip to content

-mininput fails to ignore some outputs #311

@dooglus

Description

@dooglus

I used mininput=0.01 in clam.conf to ignore outputs smaller than 0.01 CLAM, then sent myself a transaction paying me multiple outputs, some larger than 0.01 and some smaller.

When I listunspent, I only see the larger outputs, but when I getbalance I see the sum of all outputs, not only the larger ones.

It seems the solution is to move the threshold test up a level:

diff --git a/src/wallet.h b/src/wallet.h
index 6386b1c..1b98045 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -242,7 +242,7 @@ public:
     int64_t GetDebit(const CTxIn& txin) const;
     bool IsMine(const CTxOut& txout) const
     {
-        return ::IsMine(*this, txout.scriptPubKey);
+        return txout.nValue >= nMinimumInputValue && ::IsMine(*this, txout.scriptPubKey);
     }
     int64_t GetCredit(const CTxOut& txout) const
     {
@@ -260,7 +260,7 @@ public:
     bool IsMine(const CTransaction& tx) const
     {
         BOOST_FOREACH(const CTxOut& txout, tx.vout)
-            if (IsMine(txout) && txout.nValue >= nMinimumInputValue)
+            if (IsMine(txout))
                 return true;
         return false;
     }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions