Skip to content

Commit

Permalink
Merge bitcoin#17677: Activate watchonly wallet behavior for LegacySPK…
Browse files Browse the repository at this point in the history
…M only

e1e1442 Activate no-privkey -> ISMINE_WATCH_ONLY behavior for LegacySPKM only (Gregory Sanders)

Pull request description:

  Slight cleanup following bitcoin#16944

  This should allow future scriptpubkeymans to transparently work, since the current plan is to have ismine always be spendable.

ACKs for top commit:
  achow101:
    ACK e1e1442
  Sjors:
    Code review ACK e1e1442
  meshcollider:
    Code review ACK e1e1442

Tree-SHA512: c0a86587d33b8b1646494a5cb0bf8681ee4a88e6913918157746943a0996b501903e0e6ee954cf04154c1e0faee0cbb375c74ca789f46ba9244eb5296632b042
  • Loading branch information
meshcollider committed Jan 7, 2020
2 parents 7ea3b85 + e1e1442 commit cab3859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2183,8 +2183,8 @@ std::map<CTxDestination, std::vector<COutput>> CWallet::ListCoins(interfaces::Ch

std::vector<COutPoint> lockedCoins;
ListLockedCoins(lockedCoins);
// Include watch-only for wallets without private keys
const bool include_watch_only = IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
// Include watch-only for LegacyScriptPubKeyMan wallets without private keys
const bool include_watch_only = GetLegacyScriptPubKeyMan() && IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
const isminetype is_mine_filter = include_watch_only ? ISMINE_WATCH_ONLY : ISMINE_SPENDABLE;
for (const COutPoint& output : lockedCoins) {
auto it = mapWallet.find(output.hash);
Expand Down

0 comments on commit cab3859

Please sign in to comment.