aboutsummaryrefslogtreecommitdiff
path: root/src/rpcwallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2014-02-28 15:16:25 -0500
committerGavin Andresen <[email protected]>2014-02-28 15:16:25 -0500
commitf60e49d49c72908356d70d05ae30c6e63be2192d (patch)
tree3fdc2c60417664b6b13005b06085d99472cd250b /src/rpcwallet.cpp
parentMerge pull request #3750 from gavinandresen/osx_minversion (diff)
parentRemove CWalletTx::vfSpent (diff)
downloaddiscoin-f60e49d49c72908356d70d05ae30c6e63be2192d.tar.xz
discoin-f60e49d49c72908356d70d05ae30c6e63be2192d.zip
Merge pull request #3694 from gavinandresen/vfspent
Remove CWalletTx::vfSpent
Diffstat (limited to 'src/rpcwallet.cpp')
-rw-r--r--src/rpcwallet.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp
index 7b605af58..d3b6c349a 100644
--- a/src/rpcwallet.cpp
+++ b/src/rpcwallet.cpp
@@ -560,7 +560,7 @@ int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMi
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
- if (!IsFinalTx(wtx))
+ if (!IsFinalTx(wtx) || wtx.GetBlocksToMaturity() > 0 || wtx.GetDepthInMainChain() < 0)
continue;
int64_t nReceived, nSent, nFee;
@@ -1324,13 +1324,14 @@ Value listaccounts(const Array& params, bool fHelp)
string strSentAccount;
list<pair<CTxDestination, int64_t> > listReceived;
list<pair<CTxDestination, int64_t> > listSent;
- if (wtx.GetBlocksToMaturity() > 0)
+ int nDepth = wtx.GetDepthInMainChain();
+ if (wtx.GetBlocksToMaturity() > 0 || nDepth < 0)
continue;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
mapAccountBalances[strSentAccount] -= nFee;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent)
mapAccountBalances[strSentAccount] -= s.second;
- if (wtx.GetDepthInMainChain() >= nMinDepth)
+ if (nDepth >= nMinDepth)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& r, listReceived)
if (pwalletMain->mapAddressBook.count(r.first))