bitcoin/BRWallet.c
// returns the first unused external address (legacy pay-to-pubkey-hash)
returns the first unused external address (legacy pay-to-pubkey-hash)
returns the first unused external address ( legacy pay - to - pubkey - hash )
BRAddress BRWalletLegacyAddress(BRWallet *wallet)
{
    BRAddress addr = BR_ADDRESS_NONE;
    uint8_t script[] = { OP_DUP, OP_HASH160, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                         0, 0, 0, 0, 0, 0, 0, 0, 0, OP_EQUALVERIFY, OP_CHECKSIG };
    BRWalletUnusedAddrs(wallet, &addr, 1, 0);
    if (BRAddressHash160(&script[3], wallet->addrParams, addr.s)) {
        BRAddressFromScriptPubKey(addr.s, sizeof(addr), wallet->addrParams, script, sizeof(script));
    }
    return addr;
}
BRAddress BRWalletLegacyAddress ( BRWallet * wallet ) { BRAddress addr = BR_ADDRESS_NONE ; uint8_t script [ ] = { OP_DUP , OP_HASH160 , 20 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , OP_EQUALVERIFY , OP_CHECKSIG } ; BRWalletUnusedAddrs ( wallet , & addr , 1 , 0 ) ; if ( BRAddressHash160 ( & script [ 3 ] , wallet -> addrParams , addr . s ) ) { BRAddressFromScriptPubKey ( addr . s , sizeof ( addr ) , wallet -> addrParams , script , sizeof ( script ) ) ; } return addr ; }
returns the first unused external address (legacy pay-to-pubkey-hash)
returns the first unused external address ( legacy pay - to - pubkey - hash )