src/omnicore/wallettxbuilder.cpp
/** Locks all available coins that are not in the set of destinations. */
Locks all available coins that are not in the set of destinations.
Locks all available coins that are not in the set of destinations .
static void LockUnrelatedCoins(
        interfaces::Wallet* iWallet,
        const std::set<CTxDestination>& destinations,
        std::vector<COutPoint>& retLockedCoins)
{
    if (!iWallet) {
        return;
    }
    std::vector<COutput> vCoins;
    iWallet->availableCoins(vCoins, false, nullptr, 0);
    for (COutput& output : vCoins) {
        CTxDestination address;
        const CScript& scriptPubKey = output.tx->tx->vout[output.i].scriptPubKey;
        bool fValidAddress = ExtractDestination(scriptPubKey, address);
        if (fValidAddress && destinations.count(address)) {
            continue;
        }
        COutPoint outpointLocked(output.tx->GetHash(), output.i);
        iWallet->lockCoin(outpointLocked);
        retLockedCoins.push_back(outpointLocked);
    }
}
static void LockUnrelatedCoins ( interfaces :: Wallet * iWallet , const std :: set < CTxDestination > & destinations , std :: vector < COutPoint > & retLockedCoins ) { if ( ! iWallet ) { return ; } std :: vector < COutput > vCoins ; iWallet -> availableCoins ( vCoins , false , nullptr , 0 ) ; for ( COutput & output : vCoins ) { CTxDestination address ; const CScript & scriptPubKey = output . tx -> tx -> vout [ output . i ] . scriptPubKey ; bool fValidAddress = ExtractDestination ( scriptPubKey , address ) ; if ( fValidAddress && destinations . count ( address ) ) { continue ; } COutPoint outpointLocked ( output . tx -> GetHash ( ) , output . i ) ; iWallet -> lockCoin ( outpointLocked ) ; retLockedCoins . push_back ( outpointLocked ) ; } }
Locks all available coins that are not in the set of destinations.
Locks all available coins that are not in the set of destinations .
// NOTE: require: LOCK2(cs_main, pwallet->cs_wallet); // lock any other output // don't lock specified coins, but any other