| 264 | } |
| 265 | |
| 266 | bool psbt_input_set_signature(struct wally_psbt *psbt, size_t in, |
| 267 | const struct pubkey *pubkey, |
| 268 | const struct bitcoin_signature *sig) |
| 269 | { |
| 270 | u8 pk_der[PUBKEY_CMPR_LEN]; |
| 271 | u8 sig_der[73]; |
| 272 | size_t sig_len; |
| 273 | bool ok; |
| 274 | |
| 275 | assert(in < psbt->num_inputs); |
| 276 | |
| 277 | /* we serialize the compressed version of the key, wally likes this */ |
| 278 | pubkey_to_der(pk_der, pubkey); |
| 279 | sig_len = signature_to_der(sig_der, sig); |
| 280 | tal_wally_start(); |
| 281 | wally_psbt_input_set_sighash(&psbt->inputs[in], sig->sighash_type); |
| 282 | ok = wally_psbt_input_add_signature(&psbt->inputs[in], |
| 283 | pk_der, sizeof(pk_der), |
| 284 | sig_der, sig_len) == WALLY_OK; |
| 285 | tal_wally_end(psbt); |
| 286 | return ok; |
| 287 | } |
| 288 | |
| 289 | void psbt_input_set_wit_utxo(struct wally_psbt *psbt, size_t in, |
| 290 | const u8 *scriptPubkey, struct amount_sat amt) |
no test coverage detected