|
|
@ -656,6 +656,7 @@ bool CWalletDB::LoadWallet()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
vchDefaultKey.clear();
|
|
|
|
vchDefaultKey.clear();
|
|
|
|
int nFileVersion = 0;
|
|
|
|
int nFileVersion = 0;
|
|
|
|
|
|
|
|
vector<uint256> vWalletUpgrade;
|
|
|
|
|
|
|
|
|
|
|
|
// Modify defaults
|
|
|
|
// Modify defaults
|
|
|
|
#ifndef __WXMSW__
|
|
|
|
#ifndef __WXMSW__
|
|
|
@ -705,6 +706,25 @@ bool CWalletDB::LoadWallet()
|
|
|
|
if (wtx.GetHash() != hash)
|
|
|
|
if (wtx.GetHash() != hash)
|
|
|
|
printf("Error in wallet.dat, hash mismatch\n");
|
|
|
|
printf("Error in wallet.dat, hash mismatch\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Undo serialize changes in 31600
|
|
|
|
|
|
|
|
if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!ssValue.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
char fTmp;
|
|
|
|
|
|
|
|
char fUnused;
|
|
|
|
|
|
|
|
ssValue >> fTmp >> fUnused >> wtx.strFromAccount;
|
|
|
|
|
|
|
|
printf("LoadWallet() upgrading tx ver=%d %d '%s' %s\n", wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount.c_str(), hash.ToString().c_str());
|
|
|
|
|
|
|
|
wtx.fTimeReceivedIsTxTime = fTmp;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("LoadWallet() repairing tx ver=%d %s\n", wtx.fTimeReceivedIsTxTime, hash.ToString().c_str());
|
|
|
|
|
|
|
|
wtx.fTimeReceivedIsTxTime = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
vWalletUpgrade.push_back(hash);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//// debug print
|
|
|
|
//// debug print
|
|
|
|
//printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str());
|
|
|
|
//printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str());
|
|
|
|
//printf(" %12I64d %s %s %s\n",
|
|
|
|
//printf(" %12I64d %s %s %s\n",
|
|
|
@ -774,6 +794,9 @@ bool CWalletDB::LoadWallet()
|
|
|
|
pcursor->close();
|
|
|
|
pcursor->close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach(uint256 hash, vWalletUpgrade)
|
|
|
|
|
|
|
|
WriteTx(hash, mapWallet[hash]);
|
|
|
|
|
|
|
|
|
|
|
|
printf("nFileVersion = %d\n", nFileVersion);
|
|
|
|
printf("nFileVersion = %d\n", nFileVersion);
|
|
|
|
printf("fGenerateBitcoins = %d\n", fGenerateBitcoins);
|
|
|
|
printf("fGenerateBitcoins = %d\n", fGenerateBitcoins);
|
|
|
|
printf("nTransactionFee = %"PRI64d"\n", nTransactionFee);
|
|
|
|
printf("nTransactionFee = %"PRI64d"\n", nTransactionFee);
|
|
|
@ -794,6 +817,7 @@ bool CWalletDB::LoadWallet()
|
|
|
|
WriteVersion(VERSION);
|
|
|
|
WriteVersion(VERSION);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|