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

Function bitcoin_tx_check

bitcoin/tx.c:228–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228bool bitcoin_tx_check(const struct bitcoin_tx *tx)
229{
230 u8 *newtx;
231 size_t written;
232 int flags = WALLY_TX_FLAG_USE_WITNESS;
233
234 if (wally_tx_get_length(tx->wtx, flags, &written) != WALLY_OK)
235 return false;
236
237 newtx = tal_arr(tmpctx, u8, written);
238 if (wally_tx_to_bytes(tx->wtx, flags, newtx, written, &written) !=
239 WALLY_OK)
240 return false;
241
242 if (written != tal_bytelen(newtx))
243 return false;
244
245 tal_free(newtx);
246 return true;
247}
248
249void bitcoin_tx_output_set_amount(struct bitcoin_tx *tx, int outnum,
250 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