Skip to content

Commit d714f96

Browse files
committed
feat: get Wtxid from a transaction
Espcially when considering the peer-to-peer network, most transactions are managed by their `Wtxid`, which includes the witness data.
1 parent 04756c0 commit d714f96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bdk-ffi/src/bitcoin.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,11 @@ impl Transaction {
308308
Arc::new(Txid(self.0.compute_txid()))
309309
}
310310

311+
/// Compute the Wtxid, which includes the witness in the transaction hash.
312+
pub fn compute_wtxid(&self) -> Arc<Wtxid> {
313+
Arc::new(Wtxid(self.0.compute_wtxid()))
314+
}
315+
311316
/// Returns the weight of this transaction, as defined by BIP-141.
312317
///
313318
/// > Transaction weight is defined as Base transaction size * 3 + Total transaction size (ie.

0 commit comments

Comments
 (0)