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

Function psbt_input_set_signature

bitcoin/psbt.c:266–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266bool 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
289void psbt_input_set_wit_utxo(struct wally_psbt *psbt, size_t in,
290 const u8 *scriptPubkey, struct amount_sat amt)

Callers 4

migrate_last_tx_to_psbtFunction · 0.85
handle_peer_commit_sigFunction · 0.85

Calls 4

signature_to_derFunction · 0.85
tal_wally_startFunction · 0.85
tal_wally_endFunction · 0.85
pubkey_to_derFunction · 0.70

Tested by

no test coverage detected