Relicense as dual Apache-2.0 + MIT
[rust-lightning] / lightning / src / chain / transaction.rs
index df45d786bd73d1f3321816e89f0bc24799233fc3..c4917313f2988045a79c656945f76ddaffb75398 100644 (file)
@@ -1,6 +1,15 @@
+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
+// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
 //! Contains simple structs describing parts of transactions on the chain.
 
-use bitcoin::hashes::sha256d::Hash as Sha256dHash;
+use bitcoin::hash_types::Txid;
 use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
 
 /// A reference to a transaction output.
@@ -10,17 +19,12 @@ use bitcoin::blockdata::transaction::OutPoint as BitcoinOutPoint;
 #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
 pub struct OutPoint {
        /// The referenced transaction's txid.
-       pub txid: Sha256dHash,
+       pub txid: Txid,
        /// The index of the referenced output in its transaction's vout.
        pub index: u16,
 }
 
 impl OutPoint {
-       /// Creates a new `OutPoint` from the txid and the index.
-       pub fn new(txid: Sha256dHash, index: u16) -> OutPoint {
-               OutPoint { txid, index }
-       }
-
        /// Convert an `OutPoint` to a lightning channel id.
        pub fn to_channel_id(&self) -> [u8; 32] {
                let mut res = [0; 32];