X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fchain%2Ftransaction.rs;h=d0fd8c62112469ec8ede0856c6436a5d10c784e7;hb=HEAD;hp=00728b45033a53844ba94451d4d6907475b1d419;hpb=98e5c5e4d3a2de38dad49fc276ded75933fdb67f;p=rust-lightning diff --git a/src/chain/transaction.rs b/src/chain/transaction.rs deleted file mode 100644 index 00728b45..00000000 --- a/src/chain/transaction.rs +++ /dev/null @@ -1,24 +0,0 @@ -use bitcoin::util::hash::Sha256dHash; -use bitcoin::util::uint::Uint256; - -/// A reference to a transaction output. -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] -pub struct OutPoint { - /// The referenced transaction's txid. - pub txid: Sha256dHash, - /// The index of the referenced output in its transaction's vout. - pub index: u16, -} - -impl OutPoint { - /// Creates a new `OutPoint` from the txid an 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) -> Uint256 { - // TODO: or le? - self.txid.into_be() ^ Uint256::from_u64(self.index as u64).unwrap() - } -}