aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-06 15:59:28 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-06 15:59:28 +0000
commit865c3a23832e36d50cb873d38c976032b027b5d3 (patch)
tree66450fd4f6ccfe8eda984494aa36201c453bb4ec /main.h
parentf03304a9c79a6cc6096ed501ad38702fd012e7f7 (diff)
downloadbitcoin-865c3a23832e36d50cb873d38c976032b027b5d3.tar.xz
fix wallet.dat compatibility problem if you downgrade from 0.3.17 and then upgrade again
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@196 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.h')
-rw-r--r--main.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/main.h b/main.h
index cca233896e..b221e62a7e 100644
--- a/main.h
+++ b/main.h
@@ -751,11 +751,10 @@ 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;
- char fTimeReceivedIsTxTime;
- char fUnused;
string strFromAccount;
// memory only
@@ -792,11 +791,10 @@ public:
vtxPrev.clear();
mapValue.clear();
vOrderForm.clear();
+ fTimeReceivedIsTxTime = false;
nTimeReceived = 0;
fFromMe = false;
fSpent = false;
- fTimeReceivedIsTxTime = false;
- fUnused = false;
strFromAccount.clear();
fDebitCached = false;
fCreditCached = false;
@@ -811,24 +809,23 @@ public:
IMPLEMENT_SERIALIZE
(
+ CWalletTx* pthis = const_cast<CWalletTx*>(this);
if (fRead)
- const_cast<CWalletTx*>(this)->Init();
+ pthis->Init();
nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion, ser_action);
READWRITE(vtxPrev);
+
+ pthis->mapValue["fromaccount"] = pthis->strFromAccount;
READWRITE(mapValue);
+ pthis->strFromAccount = pthis->mapValue["fromaccount"];
+ pthis->mapValue.erase("fromaccount");
+ pthis->mapValue.erase("version");
+
READWRITE(vOrderForm);
- READWRITE(nVersion);
- if (fRead && nVersion < 100)
- const_cast<CWalletTx*>(this)->fTimeReceivedIsTxTime = nVersion;
+ READWRITE(fTimeReceivedIsTxTime);
READWRITE(nTimeReceived);
READWRITE(fFromMe);
READWRITE(fSpent);
- if (nVersion >= 31404)
- {
- READWRITE(fTimeReceivedIsTxTime);
- READWRITE(fUnused);
- READWRITE(strFromAccount);
- }
)
int64 GetDebit() const