Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elements"
version = "0.12.0"
version = "0.12.1"
authors = ["Andrew Poelstra <apoelstra@blockstream.com>"]
description = "Library with support for de/serialization, parsing and executing on data structures and network messages related to Elements"
license = "CC0-1.0"
Expand All @@ -24,4 +24,4 @@ optional = true

[dev-dependencies]
rand = "0.6.5"
serde_json = "1"
serde_json = "<=1.0.44"
8 changes: 8 additions & 0 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,8 +596,16 @@ impl Transaction {
self.lock_time.consensus_encode(&mut enc).unwrap();
bitcoin::Txid::from_engine(enc)
}

/// Get the witness txid of the transaction.
pub fn wtxid(&self) -> bitcoin::Wtxid {
let mut enc = Txid::engine();
self.consensus_encode(&mut enc).unwrap();
bitcoin::Wtxid::from_engine(enc)
}
}

//TODO(stevenroose) remove this, it's incorrect
impl BitcoinHash<Txid> for Transaction {
/// To get a transaction's txid, which is usually what you want, use the `txid` method.
fn bitcoin_hash(&self) -> Txid {
Expand Down