Remove unused includes.
[novacoin.git] / src / init.cpp
index 2f237c0..8fec3c6 100644 (file)
@@ -900,8 +900,17 @@ bool AppInit2()
         if (!pwalletMain->GetKeyFromPool(newDefaultKey, false))
             strErrors << _("Cannot initialize keypool") << "\n";
         pwalletMain->SetDefaultKey(newDefaultKey);
-        if (!pwalletMain->SetAddressBookName(CBitcoinAddress(pwalletMain->vchDefaultKey.GetID()), ""))
+        if (!pwalletMain->SetAddressBookName(pwalletMain->vchDefaultKey.GetID(), ""))
             strErrors << _("Cannot write default address") << "\n";
+
+        if (fTestNet || GetTime() < SMALLDATA_SWITCH_TIME) {
+            CMalleableKeyView keyView = pwalletMain->GenerateNewMalleableKey();
+            CMalleableKey mKey;
+            if (!pwalletMain->GetMalleableKey(keyView, mKey))
+                strErrors << _("Unable to generate new malleable key");
+            if (!pwalletMain->SetAddressBookName(CBitcoinAddress(keyView.GetMalleablePubKey()), ""))
+                strErrors << _("Cannot write default address") << "\n";
+        }
     }
 
     printf("%s", strErrors.str().c_str());