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

Function wally_txid

bitcoin/tx.c:474–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474void wally_txid(const struct wally_tx *wtx, struct bitcoin_txid *txid)
475{
476 u8 *arr;
477 size_t len, written;
478 int res;
479
480 /* Never use BIP141 form for txid */
481 res = wally_tx_get_length(wtx, 0, &len);
482 assert(res == WALLY_OK);
483 arr = tal_arr(NULL, u8, len);
484 res = wally_tx_to_bytes(wtx, 0, arr, len, &written);
485 assert(len == written);
486
487 sha256_double(&txid->shad, arr, len);
488 tal_free(arr);
489}
490
491/* We used to have beautiful, optimal code which fed the tx parts directly
492 * into sha256_update(). But that was before libwally; but now we don't have

Callers 8

tx_parts_from_wally_txFunction · 0.85
bitcoin_txidFunction · 0.85
psbt_txidFunction · 0.85
sendpsbt_doneFunction · 0.85
wallet_transaction_addFunction · 0.85
handle_tx_broadcastFunction · 0.85
send_funding_txFunction · 0.85

Calls 2

tal_freeFunction · 0.85
sha256_doubleClass · 0.70

Tested by

no test coverage detected