aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorgavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-16 01:06:03 +0000
committergavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-16 01:06:03 +0000
commit809ee795927f0b9110a5b6e83845f42e3394451d (patch)
treea906fe04ac63e46d82793d893b8aa69960de6df7 /main.h
parent629e37dde1fa93f6ce31544d1ebb5ee5c19052cb (diff)
downloadbitcoin-809ee795927f0b9110a5b6e83845f42e3394451d.tar.xz
New RPC command: listaccounts. New RPC setting -rpctimeout. And listtransactions '*'
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@203 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.h')
-rw-r--r--main.h36
1 files changed, 7 insertions, 29 deletions
diff --git a/main.h b/main.h
index 5934350f22..11a5862cb0 100644
--- a/main.h
+++ b/main.h
@@ -873,36 +873,11 @@ public:
return nChangeCached;
}
- void GetAccountAmounts(string strAccount, const set<CScript>& setPubKey,
- int64& nGenerated, int64& nReceived, int64& nSent, int64& nFee) const
- {
- nGenerated = nReceived = nSent = nFee = 0;
-
- // Generated blocks count to account ""
- if (IsCoinBase())
- {
- if (strAccount == "" && GetBlocksToMaturity() == 0)
- nGenerated = GetCredit();
- return;
- }
-
- // Received
- foreach(const CTxOut& txout, vout)
- if (setPubKey.count(txout.scriptPubKey))
- nReceived += txout.nValue;
+ void GetAmounts(int64& nGenerated, list<pair<string /* address */, int64> >& listReceived,
+ int64& nSent, int64& nFee, string& strSentAccount) const;
- // Sent
- if (strFromAccount == strAccount)
- {
- int64 nDebit = GetDebit();
- if (nDebit > 0)
- {
- int64 nValueOut = GetValueOut();
- nFee = nDebit - nValueOut;
- nSent = nValueOut - GetChange();
- }
- }
- }
+ void GetAccountAmounts(const string& strAccount, int64& nGenerated, int64& nReceived,
+ int64& nSent, int64& nFee) const;
bool IsFromMe() const
{
@@ -1695,6 +1670,7 @@ public:
class CAccountingEntry
{
public:
+ string strAccount;
int64 nCreditDebit;
int64 nTime;
string strOtherAccount;
@@ -1709,6 +1685,7 @@ public:
{
nCreditDebit = 0;
nTime = 0;
+ strAccount.clear();
strOtherAccount.clear();
strComment.clear();
}
@@ -1717,6 +1694,7 @@ public:
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
+ // Note: strAccount is serialized as part of the key, not here.
READWRITE(nCreditDebit);
READWRITE(nTime);
READWRITE(strOtherAccount);