| 1106 | } |
| 1107 | |
| 1108 | static struct command_result *signpsbt(struct command *cmd, |
| 1109 | struct splice_cmd *splice_cmd) |
| 1110 | { |
| 1111 | struct out_req *req; |
| 1112 | size_t num_to_be_signed; |
| 1113 | |
| 1114 | req = jsonrpc_request_start(cmd, "signpsbt", |
| 1115 | signpsbt_get_result, splice_error, |
| 1116 | splice_cmd); |
| 1117 | |
| 1118 | /* Use input markers to identify which inputs |
| 1119 | * are ours, only sign those */ |
| 1120 | json_array_start(req->js, "signonly"); |
| 1121 | num_to_be_signed = 0; |
| 1122 | for (size_t i = 0; i < splice_cmd->psbt->num_inputs; i++) { |
| 1123 | if (psbt_input_is_ours(&splice_cmd->psbt->inputs[i])) { |
| 1124 | json_add_num(req->js, NULL, i); |
| 1125 | num_to_be_signed++; |
| 1126 | } |
| 1127 | } |
| 1128 | json_array_end(req->js); |
| 1129 | |
| 1130 | json_add_psbt(req->js, "psbt", splice_cmd->psbt); |
| 1131 | |
| 1132 | /* If we have no inputs to be signed, skip ahead */ |
| 1133 | if (!num_to_be_signed) { |
| 1134 | splice_cmd->wallet_inputs_to_signed = 0; |
| 1135 | return continue_splice(splice_cmd->cmd, splice_cmd); |
| 1136 | } |
| 1137 | |
| 1138 | return send_outreq(req); |
| 1139 | } |
| 1140 | |
| 1141 | static struct splice_script_result *requires_our_sigs(struct splice_cmd *splice_cmd, |
| 1142 | size_t *index, |
no test coverage detected