* 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
| 806 | * Returns string containing the human readable segment of bech32 address |
| 807 | */ |
| 808 | static 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 | |
| 822 | enum address_parse_result |
| 823 | json_to_address_scriptpubkey(const tal_t *ctx, |
no test coverage detected