| 797 | } |
| 798 | |
| 799 | struct command_result *param_bitcoin_address(struct command *cmd, |
| 800 | const char *name, |
| 801 | const char *buffer, |
| 802 | const jsmntok_t *tok, |
| 803 | const u8 **scriptpubkey) |
| 804 | { |
| 805 | /* Parse address. */ |
| 806 | switch (json_to_address_scriptpubkey(cmd, |
| 807 | chainparams, |
| 808 | buffer, tok, |
| 809 | scriptpubkey)) { |
| 810 | case ADDRESS_PARSE_UNRECOGNIZED: |
| 811 | return command_fail(cmd, LIGHTNINGD, |
| 812 | "Could not parse destination address, " |
| 813 | "%s should be a valid address", |
| 814 | name ? name : "address field"); |
| 815 | case ADDRESS_PARSE_WRONG_NETWORK: |
| 816 | return command_fail(cmd, LIGHTNINGD, |
| 817 | "Destination address is not on network %s", |
| 818 | chainparams->network_name); |
| 819 | case ADDRESS_PARSE_SUCCESS: |
| 820 | return NULL; |
| 821 | } |
| 822 | abort(); |
| 823 | } |
| 824 | |
| 825 | struct command_result *param_psbt(struct command *cmd, |
| 826 | const char *name, |
nothing calls this directly
no test coverage detected