Skip to content
This repository was archived by the owner on Aug 18, 2021. It is now read-only.

Commit

Permalink
fix for getaddresses RPC call, including of watch-only addresses on d…
Browse files Browse the repository at this point in the history
…emand
  • Loading branch information
miodragpop committed Jul 10, 2019
1 parent 9f718f6 commit a4d7754
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3994,8 +3994,16 @@ set<CTxDestination> CWallet::GetAddresses(bool include_watch_only)
CTxDestination address;
if(!IsMine(txin)) /* If this input isn't mine, ignore it */
continue;

if(!ExtractDestination(mapWallet[txin.prevout.hash].vout[txin.prevout.n].scriptPubKey, address))
continue;

bool is_watch_only = (pwalletMain ? ::IsMine(*pwalletMain, address) : ISMINE_NO) & ISMINE_WATCH_ONLY;

if (!include_watch_only && is_watch_only)
continue;


t_addresses.insert(address);
any_mine = true;
}
Expand All @@ -4010,6 +4018,12 @@ set<CTxDestination> CWallet::GetAddresses(bool include_watch_only)
CTxDestination txoutAddr;
if(!ExtractDestination(txout.scriptPubKey, txoutAddr))
continue;

bool is_watch_only = (pwalletMain ? ::IsMine(*pwalletMain, txoutAddr) : ISMINE_NO) & ISMINE_WATCH_ONLY;

if (!include_watch_only && is_watch_only)
continue;

t_addresses.insert(txoutAddr);
}

Expand Down

0 comments on commit a4d7754

Please sign in to comment.