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

Function bitcoin_tx_check

bitcoin/tx.c:268–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266}
267
268bool bitcoin_tx_check(const struct bitcoin_tx *tx)
269{
270 u8 *newtx;
271 size_t written;
272 int flags = WALLY_TX_FLAG_USE_WITNESS;
273
274 if (wally_tx_get_length(tx->wtx, flags, &written) != WALLY_OK)
275 return false;
276
277 newtx = tal_arr(tmpctx, u8, written);
278 if (wally_tx_to_bytes(tx->wtx, flags, newtx, written, &written) !=
279 WALLY_OK)
280 return false;
281
282 if (written != tal_bytelen(newtx))
283 return false;
284
285 tal_free(newtx);
286 return true;
287}
288
289void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum,
290 struct amount_sat amount)

Callers 6

bitcoin_tx_finalizeFunction · 0.85
commit_txFunction · 0.85
initial_commit_txFunction · 0.85
htlc_txFunction · 0.85
create_close_txFunction · 0.85
funding_txFunction · 0.85

Calls 2

tal_bytelenFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected