Watchonly balances are shown separately in gui.

This commit is contained in:
JaSK
2014-03-29 05:15:28 +01:00
parent 2935b21103
commit ffd40da361
14 changed files with 597 additions and 233 deletions

View File

@@ -158,12 +158,14 @@ Value importaddress(const Array& params, bool fHelp)
{
LOCK2(cs_main, pwalletMain->cs_wallet);
// add to address book or update label
pwalletMain->SetAddressBook(dest, strLabel, "receive");
// Don't throw error in case an address is already there
if (pwalletMain->HaveWatchOnly(dest))
return Value::null;
pwalletMain->MarkDirty();
pwalletMain->SetAddressBook(dest, strLabel, "receive");
if (!pwalletMain->AddWatchOnly(dest))
throw JSONRPCError(RPC_WALLET_ERROR, "Error adding address to wallet");