#include "headers.h"
#include "db.h"
-#include "cryptopp/sha.h"
#include "crypter.h"
using namespace std;
else
return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, vchCryptedSecret);
}
+ return false;
}
bool CWallet::Unlock(const string& strWalletPassphrase)
Lock();
}
+ if (Resilver(strWalletFile))
+ CWalletDB(strWalletFile, "r+").WriteSetting("fIsResilvered", true);
+
return true;
}
return true;
}
+// Add a transaction to the wallet, or update it.
+// pblock is optional, but should be provided if the transaction is known to be in a block.
+// If fUpdate is true, existing transactions will be updated.
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
{
uint256 hash = tx.GetHash();
return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);
}
+// Scan the block chain (starting in pindexStart) for transactions
+// from or to us. If fUpdate is true, found transactions that already
+// exist in the wallet will be updated.
int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
{
int ret = 0;
int64 CWallet::GetUnconfirmedBalance() const
{
int64 nTotal = 0;
- CRITICAL_BLOCK(cs_mapWallet)
+ CRITICAL_BLOCK(cs_wallet)
{
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it)
{
return false;
fFirstRunRet = false;
int nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this);
+ if (nLoadWalletRet == DB_NEED_RESILVER)
+ {
+ if (Resilver(strWalletFile))
+ CWalletDB(strWalletFile, "r+").WriteSetting("fIsResilvered", true);
+ nLoadWalletRet = DB_LOAD_OK;
+ }
+
if (nLoadWalletRet != DB_LOAD_OK)
return nLoadWalletRet;
fFirstRunRet = vchDefaultKey.empty();