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

Function json_setpsbtversion

wallet/walletrpc.c:945–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

943AUTODATA(json_command, &signpsbt_command);
944
945static struct command_result *json_setpsbtversion(struct command *cmd,
946 const char *buffer,
947 const jsmntok_t *obj UNNEEDED,
948 const jsmntok_t *params)
949{
950 struct json_stream *response;
951 unsigned int *version;
952 struct wally_psbt *psbt;
953
954 if (!param_check(cmd, buffer, params,
955 p_req("psbt", param_psbt, &psbt),
956 p_req("version", param_number, &version),
957 NULL))
958 return command_param_failed();
959
960 if (!psbt_set_version(psbt, *version)) {
961 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
962 "Could not set PSBT version");
963 }
964 if (command_check_only(cmd))
965 return command_check_done(cmd);
966
967 response = json_stream_success(cmd);
968 json_add_psbt(response, "psbt", psbt);
969
970 return command_success(cmd, response);
971}
972
973static const struct json_command setpsbtversion_command = {
974 "setpsbtversion",

Callers

nothing calls this directly

Calls 9

param_checkFunction · 0.85
psbt_set_versionFunction · 0.85
json_add_psbtFunction · 0.85
command_param_failedFunction · 0.50
command_failFunction · 0.50
command_check_onlyFunction · 0.50
command_check_doneFunction · 0.50
json_stream_successFunction · 0.50
command_successFunction · 0.50

Tested by

no test coverage detected