bitcoin/BRWallet.c
// chain position of first tx output address that appears in chain
chain position of first tx output address that appears in chain
chain position of first tx output address that appears in chain
inline static size_t _txChainIndex(const BRTransaction *tx, const UInt160 *chain)
{
    const uint8_t *pkh;
    for (size_t i = array_count(chain); i > 0; i--) {
        for (size_t j = 0; j < tx->outCount; j++) {
            pkh = BRScriptPKH(tx->outputs[j].script, tx->outputs[j].scriptLen);
            if (pkh && _pkhEq(pkh, &chain[i - 1])) return i - 1;
        }
    }
    return -1;
}
inline static size_t _txChainIndex ( const BRTransaction * tx , const UInt160 * chain ) { const uint8_t * pkh ; for ( size_t i = array_count ( chain ) ; i > 0 ; i -- ) { for ( size_t j = 0 ; j < tx -> outCount ; j ++ ) { pkh = BRScriptPKH ( tx -> outputs [ j ] . script , tx -> outputs [ j ] . scriptLen ) ; if ( pkh && _pkhEq ( pkh , & chain [ i - 1 ] ) ) return i - 1 ; } } return -1 ; }
chain position of first tx output address that appears in chain
chain position of first tx output address that appears in chain