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

Function bitcoin_tx_output_set_amount

bitcoin/tx.c:249–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum,
250 struct amount_sat amount)
251{
252 u64 satoshis = amount.satoshis; /* Raw: low-level helper */
253 struct wally_tx_output *output = &tx->wtx->outputs[outnum];
254 assert(outnum < tx->wtx->num_outputs);
255 if (chainparams->is_elements) {
256 int ret = wally_tx_confidential_value_from_satoshi(
257 satoshis, output->value, output->value_len);
258 assert(ret == WALLY_OK);
259 } else {
260 output->satoshi = satoshis;
261
262 /* update the global tx for the psbt also */
263 output = &tx->psbt->tx->outputs[outnum];
264 output->satoshi = satoshis;
265 }
266}
267
268const u8 *wally_tx_output_get_script(const tal_t *ctx,
269 const struct wally_tx_output *output)

Callers 7

grind_htlc_tx_feeFunction · 0.85
set_htlc_timeout_feeFunction · 0.85
set_htlc_success_feeFunction · 0.85
tx_to_usFunction · 0.85
bitcoin_tx_add_outputFunction · 0.85
penalty_tx_createFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected