X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fkeysinterface.rs;h=daee746bed7687553b50bb018e6182223c486aa0;hb=4909d3cd6a05dfcba39fe08e6d8f539944c8ef66;hp=44f347abc12e133ec8d735daf1e9de6a3ce15f87;hpb=7159d1546ae92281a7e0533813a6e7558f16354a;p=rust-lightning diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 44f347ab..daee746b 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -9,11 +9,11 @@ use bitcoin::network::constants::Network; use bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey, ChildNumber}; use bitcoin::util::bip143; -use bitcoin_hashes::{Hash, HashEngine}; -use bitcoin_hashes::sha256::HashEngine as Sha256State; -use bitcoin_hashes::sha256::Hash as Sha256; -use bitcoin_hashes::sha256d::Hash as Sha256dHash; -use bitcoin_hashes::hash160::Hash as Hash160; +use bitcoin::hashes::{Hash, HashEngine}; +use bitcoin::hashes::sha256::HashEngine as Sha256State; +use bitcoin::hashes::sha256::Hash as Sha256; +use bitcoin::hashes::sha256d::Hash as Sha256dHash; +use bitcoin::hashes::hash160::Hash as Hash160; use secp256k1::key::{SecretKey, PublicKey}; use secp256k1::{Secp256k1, Signature, Signing}; @@ -184,11 +184,11 @@ pub trait KeysInterface: Send + Sync { /// Readable/Writable to serialize out a unique reference to this set of keys so /// that you can serialize the full ChannelManager object. /// -/// (TODO: We shouldn't require that, and should have an API to get them at deser time, due mostly -/// to the possibility of reentrancy issues by calling the user's code during our deserialization -/// routine). -/// TODO: We should remove Clone by instead requesting a new ChannelKeys copy when we create -/// ChannelMonitors instead of expecting to clone the one out of the Channel into the monitors. +// (TODO: We shouldn't require that, and should have an API to get them at deser time, due mostly +// to the possibility of reentrancy issues by calling the user's code during our deserialization +// routine). +// TODO: We should remove Clone by instead requesting a new ChannelKeys copy when we create +// ChannelMonitors instead of expecting to clone the one out of the Channel into the monitors. pub trait ChannelKeys : Send+Clone { /// Gets the private key for the anchor tx fn funding_key<'a>(&'a self) -> &'a SecretKey; @@ -209,18 +209,18 @@ pub trait ChannelKeys : Send+Clone { /// Create a signature for a remote commitment transaction and associated HTLC transactions. /// /// Note that if signing fails or is rejected, the channel will be force-closed. - /// - /// TODO: Document the things someone using this interface should enforce before signing. - /// TODO: Add more input vars to enable better checking (preferably removing commitment_tx and - /// making the callee generate it via some util function we expose)! + // + // TODO: Document the things someone using this interface should enforce before signing. + // TODO: Add more input vars to enable better checking (preferably removing commitment_tx and + // making the callee generate it via some util function we expose)! fn sign_remote_commitment(&self, feerate_per_kw: u64, commitment_tx: &Transaction, keys: &TxCreationKeys, htlcs: &[&HTLCOutputInCommitment], to_self_delay: u16, secp_ctx: &Secp256k1) -> Result<(Signature, Vec), ()>; /// Create a signature for a local commitment transaction. This will only ever be called with /// the same local_commitment_tx (or a copy thereof), though there are currently no guarantees /// that it will not be called multiple times. - /// - /// TODO: Document the things someone using this interface should enforce before signing. - /// TODO: Add more input vars to enable better checking (preferably removing commitment_tx and + // + // TODO: Document the things someone using this interface should enforce before signing. + // TODO: Add more input vars to enable better checking (preferably removing commitment_tx and fn sign_local_commitment(&self, local_commitment_tx: &LocalCommitmentTransaction, secp_ctx: &Secp256k1) -> Result; /// Same as sign_local_commitment, but exists only for tests to get access to local commitment