[Wallet] Watch-only fixes

This commit is contained in:
Cozz Lovan
2014-07-26 21:05:11 +02:00
parent 29f96e8bc6
commit ccca27a788
10 changed files with 70 additions and 13 deletions

View File

@@ -114,8 +114,6 @@ Value importprivkey(const Array& params, bool fHelp)
CPubKey pubkey = key.GetPubKey();
CKeyID vchAddress = pubkey.GetID();
{
LOCK2(cs_main, pwalletMain->cs_wallet);
pwalletMain->MarkDirty();
pwalletMain->SetAddressBook(vchAddress, strLabel, "receive");
@@ -181,7 +179,8 @@ Value importaddress(const Array& params, bool fHelp)
fRescan = params[2].get_bool();
{
LOCK2(cs_main, pwalletMain->cs_wallet);
if (::IsMine(*pwalletMain, script) == ISMINE_SPENDABLE)
throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the private key for this address or script");
// add to address book or update label
if (address.IsValid())