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 (!pwalletMain->GetKeyFromPool(account.vchPubKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
- pwalletMain->SetAddressBookName(CBitcoinAddress(account.vchPubKey.GetID()), strAccount);
+ pwalletMain->SetAddressBookName(account.vchPubKey.GetID(), strAccount);
walletdb.WriteAccount(strAccount, account);
}
return DB_LOAD_OK;
}
+bool CWallet::SetAddressBookName(const CTxDestination& address, const string& strName)
+{
+ return SetAddressBookName(CBitcoinAddress(address), strName);
+}
+
bool CWallet::SetAddressBookName(const CBitcoinAddress& address, const string& strName)
{
std::map<CBitcoinAddress, string>::iterator mi = mapAddressBook.find(address);
DBErrors ZapWalletTx();
+ bool SetAddressBookName(const CTxDestination& address, const std::string& strName);
+
bool SetAddressBookName(const CBitcoinAddress& address, const std::string& strName);
bool DelAddressBookName(const CBitcoinAddress& address);