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

Function json_setpsbtversion

wallet/walletrpc.c:909–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907AUTODATA(json_command, &signpsbt_command);
908
909static struct command_result *json_setpsbtversion(struct command *cmd,
910 const char *buffer,
911 const jsmntok_t *obj UNNEEDED,
912 const jsmntok_t *params)
913{
914 struct json_stream *response;
915 unsigned int *version;
916 struct wally_psbt *psbt;
917
918 if (!param_check(cmd, buffer, params,
919 p_req("psbt", param_psbt, &psbt),
920 p_req("version", param_number, &version),
921 NULL))
922 return command_param_failed();
923
924 if (!psbt_set_version(psbt, *version)) {
925 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
926 "Could not set PSBT version");
927 }
928 if (command_check_only(cmd))
929 return command_check_done(cmd);
930
931 response = json_stream_success(cmd);
932 json_add_psbt(response, "psbt", psbt);
933
934 return command_success(cmd, response);
935}
936
937static const struct json_command setpsbtversion_command = {
938 "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