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

Function segwit_addr_net_decode

common/json_param.c:808–820  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

806 * Returns string containing the human readable segment of bech32 address
807 */
808static const char *segwit_addr_net_decode(int *witness_version,
809 uint8_t *witness_program,
810 size_t *witness_program_len,
811 const char *addrz,
812 const struct chainparams *chainparams)
813{
814 if (segwit_addr_decode(witness_version, witness_program,
815 witness_program_len, chainparams->onchain_hrp,
816 addrz))
817 return chainparams->onchain_hrp;
818 else
819 return NULL;
820}
821
822enum address_parse_result
823json_to_address_scriptpubkey(const tal_t *ctx,

Callers 1

Calls 1

segwit_addr_decodeFunction · 0.70

Tested by

no test coverage detected