SIGN IN SIGN UP

Merge bitcoin/bitcoin#36207: kernel: add wtxid accessor

43bba1ed74f8301fe1ec8e3751cdc93d07b89e82 kernel: expose transaction witness presence (KY-U)
31224d0680775adec17a3878c92afe4b67a73987 kernel: expose transaction wtxid (KY-U)

Pull request description:

  While the kernel API provides access to a transactions's txid, it does not expose its wtxid. Clients therefore have to hash the transaction's witness serialization themselves, even though `CTransaction` already calculates and caches this value in `m_witness_hash`.

  Expose the wtxid through a C API handle and corresponding C++ view and owning wrappers. Mirror the existing txid operations for copying, destruction, comparison and byte serialization.

  Also expose `CTransaction::HasWitness()`, allowing clients to determine whether a transaction contains witness data without having to inspect each input themselves.

  Tests cover legacy transactions, where txid and wtxid bytes match, and witness transactions, where they differ.

ACKs for top commit:
  stickies-v:
    re-ACK 43bba1ed74f8301fe1ec8e3751cdc93d07b89e82
  sedited:
    ACK 43bba1ed74f8301fe1ec8e3751cdc93d07b89e82

Tree-SHA512: d7bb7f590878fefb05f834f3076b990e1447f226e33da4499e4ae6ab32880f03a8fdee5f4cef60db6aecb77cd0eb3f820fafe603c31bb9cfcd950acece3f4f03
M
merge-script committed
de394ad3b739585a67b5830fafc866ac174f1fb7