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

Function param_bitcoin_address

common/json_param.c:799–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797}
798
799struct 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
825struct command_result *param_psbt(struct command *cmd,
826 const char *name,

Callers

nothing calls this directly

Calls 3

abortFunction · 0.85
command_failFunction · 0.50

Tested by

no test coverage detected