aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authorgavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-11-22 15:53:20 +0000
committergavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-11-22 15:53:20 +0000
commite4ff4e6898d378b1a3e83791034a7af455fde3ab (patch)
tree339254cbc95cee74dba7da48d255e4989a6097c6 /main.h
parent298a7714943dc3f1ebc582ed2426d3b71fb68466 (diff)
downloadbitcoin-e4ff4e6898d378b1a3e83791034a7af455fde3ab.tar.xz
Depracate "label" API, replacing with account
New RPC methods: move, sendfrom Change to getbalance (now takes optional [account] argument) Renamed methods with "label" in their names. sendtoaddress returns hexadecimal transaction ID instead of "sent". git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@188 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.h')
-rw-r--r--main.h92
1 files changed, 87 insertions, 5 deletions
diff --git a/main.h b/main.h
index 7d1145b5ff..dda5f730c7 100644
--- a/main.h
+++ b/main.h
@@ -717,11 +717,12 @@ public:
vector<CMerkleTx> vtxPrev;
map<string, string> mapValue;
vector<pair<string, string> > vOrderForm;
- unsigned int fTimeReceivedIsTxTime;
unsigned int nTimeReceived; // time received by this node
char fFromMe;
char fSpent;
- //// probably need to sign the order info so know it came from payer
+ char fTimeReceivedIsTxTime;
+ char fUnused;
+ string strFromAccount;
// memory only
mutable char fDebitCached;
@@ -752,10 +753,11 @@ public:
void Init()
{
- fTimeReceivedIsTxTime = false;
nTimeReceived = 0;
fFromMe = false;
fSpent = false;
+ fTimeReceivedIsTxTime = false;
+ fUnused = false;
fDebitCached = false;
fCreditCached = false;
nDebitCached = 0;
@@ -767,14 +769,21 @@ public:
IMPLEMENT_SERIALIZE
(
nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion, ser_action);
- nVersion = this->nVersion;
READWRITE(vtxPrev);
READWRITE(mapValue);
READWRITE(vOrderForm);
- READWRITE(fTimeReceivedIsTxTime);
+ READWRITE(nVersion);
+ if (fRead && nVersion < 100)
+ const_cast<CWalletTx*>(this)->fTimeReceivedIsTxTime = nVersion;
READWRITE(nTimeReceived);
READWRITE(fFromMe);
READWRITE(fSpent);
+ if (nVersion >= 31404)
+ {
+ READWRITE(fTimeReceivedIsTxTime);
+ READWRITE(fUnused);
+ READWRITE(strFromAccount);
+ }
)
int64 GetDebit() const
@@ -1537,6 +1546,79 @@ public:
//
+// Account information.
+// Stored in wallet with key "acc"+string account name
+//
+class CAccount
+{
+public:
+ vector<unsigned char> vchPubKey;
+
+ CAccount()
+ {
+ SetNull();
+ }
+
+ void SetNull()
+ {
+ vchPubKey.clear();
+ }
+
+ IMPLEMENT_SERIALIZE
+ (
+ if (!(nType & SER_GETHASH))
+ READWRITE(nVersion);
+ READWRITE(vchPubKey);
+ )
+};
+
+
+
+//
+// Internal transfers.
+// Database key is acentry<account><counter>
+//
+class CAccountingEntry
+{
+public:
+ int64 nCreditDebit;
+ int64 nTime;
+ string strOtherAccount;
+ string strComment;
+
+ CAccountingEntry()
+ {
+ SetNull();
+ }
+
+ void SetNull()
+ {
+ nCreditDebit = 0;
+ nTime = 0;
+ strOtherAccount.clear();
+ strComment.clear();
+ }
+
+ IMPLEMENT_SERIALIZE
+ (
+ if (!(nType & SER_GETHASH))
+ READWRITE(nVersion);
+ READWRITE(nCreditDebit);
+ READWRITE(nTime);
+ READWRITE(strOtherAccount);
+ READWRITE(strComment);
+ )
+};
+
+
+
+
+
+
+
+
+
+//
// Alert messages are broadcast as a vector of signed data. Unserializing may
// not read the entire buffer if the alert is for a newer version, but older
// versions can still relay the original data.