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

Function bitcoin_tx_output_set_amount

bitcoin/tx.c:289–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum,
290 struct amount_sat amount)
291{
292 u64 satoshis = amount.satoshis; /* Raw: low-level helper */
293 struct wally_tx_output *output = &tx->wtx->outputs[outnum];
294 assert(outnum < tx->wtx->num_outputs);
295 if (chainparams->is_elements) {
296 int ret = wally_tx_confidential_value_from_satoshi(
297 satoshis, output->value, output->value_len);
298 assert(ret == WALLY_OK);
299 } else {
300 output->satoshi = satoshis;
301 }
302 wally_psbt_output_set_amount(&tx->psbt->outputs[outnum], satoshis);
303}
304
305u8 *bitcoin_tx_output_get_witscript(const tal_t *ctx, const struct bitcoin_tx *tx,
306 int outnum)

Callers 6

grind_htlc_tx_feeFunction · 0.85
set_htlc_timeout_feeFunction · 0.85
bitcoin_tx_add_outputFunction · 0.85
penalty_tx_createFunction · 0.85
onchaind_tx_unsignedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected