[Wallet] Watch-only fixes
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user