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

Function wally_txid

bitcoin/tx.c:486–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

484}
485
486void wally_txid(const struct wally_tx *wtx, struct bitcoin_txid *txid)
487{
488 u8 *arr;
489 size_t len, written;
490 int res;
491
492 /* Never use BIP141 form for txid */
493 res = wally_tx_get_length(wtx, 0, &len);
494 assert(res == WALLY_OK);
495 arr = tal_arr(NULL, u8, len);
496 res = wally_tx_to_bytes(wtx, 0, arr, len, &written);
497 assert(len == written);
498
499 sha256_double(&txid->shad, arr, len);
500 tal_free(arr);
501}
502
503/* We used to have beautiful, optimal code which fed the tx parts directly
504 * 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
sendpsbt_doneFunction · 0.85
json_dev_finalizepsbtFunction · 0.85
got_utxoFunction · 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