diff options
| author | Pieter Wuille <[email protected]> | 2011-06-25 14:57:32 +0200 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2011-07-08 15:46:47 +0200 |
| commit | acd6501610817eee0bd1c8ea9c591f043affbaec (patch) | |
| tree | e2b05a5d0bc1a0b890b2b1d6a16713967143ff95 /src/db.cpp | |
| parent | Merge pull request #383 from sipa/syncdefault (diff) | |
| download | discoin-acd6501610817eee0bd1c8ea9c591f043affbaec.tar.xz discoin-acd6501610817eee0bd1c8ea9c591f043affbaec.zip | |
Prepare codebase for Encrypted Keys.
Diffstat (limited to 'src/db.cpp')
| -rw-r--r-- | src/db.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/db.cpp b/src/db.cpp index f044355a3..c479a452c 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -685,7 +685,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet) //// todo: shouldn't we catch exceptions and try to recover and continue? CRITICAL_BLOCK(pwallet->cs_mapWallet) - CRITICAL_BLOCK(pwallet->cs_mapKeys) + CRITICAL_BLOCK(pwallet->cs_KeyStore) { // Get cursor Dbc* pcursor = GetCursor(); @@ -765,14 +765,20 @@ bool CWalletDB::LoadWallet(CWallet* pwallet) { vector<unsigned char> vchPubKey; ssKey >> vchPubKey; - CWalletKey wkey; + CKey key; if (strType == "key") - ssValue >> wkey.vchPrivKey; + { + CPrivKey pkey; + ssValue >> pkey; + key.SetPrivKey(pkey); + } else + { + CWalletKey wkey; ssValue >> wkey; - - pwallet->mapKeys[vchPubKey] = wkey.vchPrivKey; - mapPubKeys[Hash160(vchPubKey)] = vchPubKey; + key.SetPrivKey(wkey.vchPrivKey); + } + pwallet->LoadKey(key); } else if (strType == "defaultkey") { |