aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
diff options
context:
space:
mode:
authorJaSK <temp@temp.temp>2014-06-19 15:24:17 +0200
committerJaSK <temp@temp.temp>2014-07-02 15:48:39 +0200
commit80dda36a07d09f99be861fa5271d0da5bd4f07dc (patch)
tree0ffa87d19657848e874dceed4c0c4df40b98f1b2 /src/wallet.h
parentd5087d1ba08142bdf135333a0da08ef0f5fc7ef0 (diff)
removed default argument values for ismine filter
Diffstat (limited to 'src/wallet.h')
-rw-r--r--src/wallet.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/wallet.h b/src/wallet.h
index b44b73568b..ac90de3c9c 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -288,12 +288,12 @@ public:
std::set<CTxDestination> GetAccountAddresses(std::string strAccount) const;
isminetype IsMine(const CTxIn& txin) const;
- int64_t GetDebit(const CTxIn& txin, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const;
+ int64_t GetDebit(const CTxIn& txin, const isminefilter& filter) const;
isminetype IsMine(const CTxOut& txout) const
{
return ::IsMine(*this, txout.scriptPubKey);
}
- int64_t GetCredit(const CTxOut& txout, const isminefilter& filter=(MINE_WATCH_ONLY|MINE_SPENDABLE)) const
+ int64_t GetCredit(const CTxOut& txout, const isminefilter& filter) const
{
if (!MoneyRange(txout.nValue))
throw std::runtime_error("CWallet::GetCredit() : value out of range");
@@ -313,9 +313,9 @@ public:
return true;
return false;
}
- bool IsFromMe(const CTransaction& tx) const
+ bool IsFromMe(const CTransaction& tx) const // should probably be renamed to IsRelevantToMe
{
- return (GetDebit(tx) > 0);
+ return (GetDebit(tx, MINE_SPENDABLE|MINE_WATCH_ONLY) > 0);
}
bool IsConflicting(const CTransaction& tx) const
{
@@ -324,7 +324,7 @@ public:
return true;
return false;
}
- int64_t GetDebit(const CTransaction& tx, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const
+ int64_t GetDebit(const CTransaction& tx, const isminefilter& filter) const
{
int64_t nDebit = 0;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
@@ -335,7 +335,7 @@ public:
}
return nDebit;
}
- int64_t GetCredit(const CTransaction& tx, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const
+ int64_t GetCredit(const CTransaction& tx, const isminefilter& filter) const
{
int64_t nCredit = 0;
BOOST_FOREACH(const CTxOut& txout, tx.vout)
@@ -614,7 +614,8 @@ public:
MarkDirty();
}
- int64_t GetDebit(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const
+ // filter decides which addresses will count towards the debit
+ int64_t GetDebit(const isminefilter& filter) const
{
if (vin.empty())
return 0;
@@ -654,7 +655,7 @@ public:
// GetBalance can assume transactions in mapWallet won't change
if (fUseCache && fCreditCached)
return nCreditCached;
- nCreditCached = pwallet->GetCredit(*this);
+ nCreditCached = pwallet->GetCredit(*this, MINE_SPENDABLE|MINE_WATCH_ONLY);
fCreditCached = true;
return nCreditCached;
}
@@ -756,12 +757,12 @@ public:
}
void GetAmounts(std::list<std::pair<CTxDestination, int64_t> >& listReceived,
- std::list<std::pair<CTxDestination, int64_t> >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const;
+ std::list<std::pair<CTxDestination, int64_t> >& listSent, int64_t& nFee, std::string& strSentAccount, const isminefilter& filter) const;
void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived,
- int64_t& nSent, int64_t& nFee, const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const;
+ int64_t& nSent, int64_t& nFee, const isminefilter& filter) const;
- bool IsFromMe(const isminefilter& filter=(MINE_SPENDABLE|MINE_WATCH_ONLY)) const
+ bool IsFromMe(const isminefilter& filter) const
{
return (GetDebit(filter) > 0);
}
@@ -776,7 +777,7 @@ public:
return true;
if (nDepth < 0)
return false;
- if (!bSpendZeroConfChange || !IsFromMe()) // using wtx's cached debit
+ if (!bSpendZeroConfChange || !IsFromMe(MINE_SPENDABLE|MINE_WATCH_ONLY)) // using wtx's cached debit
return false;
// Trusted if all inputs are from us and are in the mempool: