aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 2ee918fdab..ba5018639a 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -124,7 +124,6 @@ public:
bool CWallet::EncryptWallet(const string& strWalletPassphrase)
{
- CRITICAL_BLOCK(cs_mapPubKeys)
CRITICAL_BLOCK(cs_KeyStore)
CRITICAL_BLOCK(cs_vMasterKey)
CRITICAL_BLOCK(cs_pwalletdbEncryption)
@@ -439,10 +438,8 @@ void CWalletTx::GetAmounts(int64& nGeneratedImmature, int64& nGeneratedMature, l
string address;
uint160 hash160;
vector<unsigned char> vchPubKey;
- if (ExtractHash160(txout.scriptPubKey, hash160))
+ if (ExtractHash160(txout.scriptPubKey, pwallet, hash160))
address = Hash160ToAddress(hash160);
- else if (ExtractPubKey(txout.scriptPubKey, NULL, vchPubKey))
- address = PubKeyToAddress(vchPubKey);
else
{
printf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n",
@@ -1136,7 +1133,7 @@ int CWallet::LoadWallet(bool& fFirstRunRet)
return nLoadWalletRet;
fFirstRunRet = vchDefaultKey.empty();
- if (!HaveKey(vchDefaultKey))
+ if (!HaveKey(Hash160(vchDefaultKey)))
{
// Create new keyUser and set as default key
RandAddSeedPerfmon();
@@ -1263,7 +1260,7 @@ void CWallet::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
setKeyPool.erase(setKeyPool.begin());
if (!walletdb.ReadPool(nIndex, keypool))
throw runtime_error("ReserveKeyFromKeyPool() : read failed");
- if (!HaveKey(keypool.vchPubKey))
+ if (!HaveKey(Hash160(keypool.vchPubKey)))
throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
assert(!keypool.vchPubKey.empty());
printf("keypool reserve %"PRI64d"\n", nIndex);