MCPcopy Create free account
hub / github.com/ElementsProject/lightning / segwit_addr_net_decode

Function segwit_addr_net_decode

common/json_param.c:706–718  ·  view source on GitHub ↗

* segwit_addr_net_decode - Try to decode a Bech32 address and detect * testnet/mainnet/regtest/signet * * This processes the address and returns a string if it is a Bech32 * address specified by BIP173. The string is set whether it is * testnet or signet (both "tb"), mainnet ("bc"), regtest ("bcrt") * It does not check, witness version and program size restrictions. * * Out: witness_vers

Source from the content-addressed store, hash-verified

704 * Returns string containing the human readable segment of bech32 address
705 */
706static const char *segwit_addr_net_decode(int *witness_version,
707 uint8_t *witness_program,
708 size_t *witness_program_len,
709 const char *addrz,
710 const struct chainparams *chainparams)
711{
712 if (segwit_addr_decode(witness_version, witness_program,
713 witness_program_len, chainparams->onchain_hrp,
714 addrz))
715 return chainparams->onchain_hrp;
716 else
717 return NULL;
718}
719
720enum address_parse_result
721json_to_address_scriptpubkey(const tal_t *ctx,

Callers 1

Calls 1

segwit_addr_decodeFunction · 0.70

Tested by

no test coverage detected