bitcoin/BRWallet.c
// non-threadsafe version of BRWalletContainsTransaction()
non-threadsafe version of BRWalletContainsTransaction()
non - threadsafe version of BRWalletContainsTransaction ()
static int _BRWalletContainsTx(BRWallet *wallet, const BRTransaction *tx)
{
    int r = 0;
    const uint8_t *pkh;
    for (size_t i = 0; ! r && i < tx->outCount; i++) {
        pkh = BRScriptPKH(tx->outputs[i].script, tx->outputs[i].scriptLen);
        if (pkh && BRSetContains(wallet->allPKH, pkh)) r = 1;
    }
    for (size_t i = 0; ! r && i < tx->inCount; i++) {
        BRTransaction *t = BRSetGet(wallet->allTx, &tx->inputs[i].txHash);
        uint32_t n = tx->inputs[i].index;
        pkh = (t && n < t->outCount) ? BRScriptPKH(t->outputs[n].script, t->outputs[n].scriptLen) : NULL;
        if (pkh && BRSetContains(wallet->allPKH, pkh)) r = 1;
    }
    return r;
}
static int _BRWalletContainsTx ( BRWallet * wallet , const BRTransaction * tx ) { int r = 0 ; const uint8_t * pkh ; for ( size_t i = 0 ; ! r && i < tx -> outCount ; i ++ ) { pkh = BRScriptPKH ( tx -> outputs [ i ] . script , tx -> outputs [ i ] . scriptLen ) ; if ( pkh && BRSetContains ( wallet -> allPKH , pkh ) ) r = 1 ; } for ( size_t i = 0 ; ! r && i < tx -> inCount ; i ++ ) { BRTransaction * t = BRSetGet ( wallet -> allTx , & tx -> inputs [ i ] . txHash ) ; uint32_t n = tx -> inputs [ i ] . index ; pkh = ( t && n < t -> outCount ) ? BRScriptPKH ( t -> outputs [ n ] . script , t -> outputs [ n ] . scriptLen ) : NULL ; if ( pkh && BRSetContains ( wallet -> allPKH , pkh ) ) r = 1 ; } return r ; }
non-threadsafe version of BRWalletContainsTransaction()
non - threadsafe version of BRWalletContainsTransaction ()