Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,493 Lines • ▼ Show 20 Lines | static UniValue listunspent(const Config &config, | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
const bool avoid_reuse = pwallet->IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE); | const bool avoid_reuse = pwallet->IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE); | ||||
for (const COutput &out : vecOutputs) { | for (const COutput &out : vecOutputs) { | ||||
CTxDestination address; | CTxDestination address; | ||||
const CScript &scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey; | const CScript &scriptPubKey = out.tx->tx->vout[out.i].scriptPubKey; | ||||
bool fValidAddress = ExtractDestination(scriptPubKey, address); | bool fValidAddress = ExtractDestination(scriptPubKey, address); | ||||
bool reused = avoid_reuse && pwallet->IsUsedDestination(address); | bool reused = | ||||
avoid_reuse && pwallet->IsUsedDestination(out.tx->GetId(), out.i); | |||||
if (destinations.size() && | if (destinations.size() && | ||||
(!fValidAddress || !destinations.count(address))) { | (!fValidAddress || !destinations.count(address))) { | ||||
continue; | continue; | ||||
} | } | ||||
UniValue entry(UniValue::VOBJ); | UniValue entry(UniValue::VOBJ); | ||||
entry.pushKV("txid", out.tx->GetId().GetHex()); | entry.pushKV("txid", out.tx->GetId().GetHex()); | ||||
▲ Show 20 Lines • Show All 1,288 Lines • Show Last 20 Lines |