Compressed pubkeys
[novacoin.git] / src / db.cpp
index 7195e06..b3bbaca 100644 (file)
@@ -860,12 +860,14 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
                 {
                     CPrivKey pkey;
                     ssValue >> pkey;
+                    key.SetPubKey(vchPubKey);
                     key.SetPrivKey(pkey);
                 }
                 else
                 {
                     CWalletKey wkey;
                     ssValue >> wkey;
+                    key.SetPubKey(vchPubKey);
                     key.SetPrivKey(wkey.vchPrivKey);
                 }
                 if (!pwallet->LoadKey(key))
@@ -934,6 +936,15 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
                 if (nMinVersion > CLIENT_VERSION)
                     return DB_TOO_NEW;
             }
+            else if (strType == "cscript")
+            {
+                uint160 hash;
+                ssKey >> hash;
+                CScript script;
+                ssValue >> script;
+                if (!pwallet->LoadCScript(hash, script))
+                    return DB_CORRUPT;
+            }
         }
         pcursor->close();
     }