]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Remove useless build warnings
authorAntoine Riard <ariard@student.42.fr>
Wed, 6 May 2020 01:42:51 +0000 (21:42 -0400)
committerAntoine Riard <ariard@student.42.fr>
Tue, 12 May 2020 21:41:33 +0000 (17:41 -0400)
lightning/src/chain/keysinterface.rs
lightning/src/ln/channelmonitor.rs
lightning/src/ln/functional_tests.rs
lightning/src/util/enforcing_trait_impls.rs
lightning/src/util/macro_logger.rs

index 2ba6eca3daac525056017179902d644629ae9ac3..6e111980b5e90ba83ecba63d6ee786fb5f39a43c 100644 (file)
@@ -7,7 +7,6 @@ use bitcoin::blockdata::script::{Script, Builder};
 use bitcoin::blockdata::opcodes;
 use bitcoin::network::constants::Network;
 use bitcoin::util::bip32::{ExtendedPrivKey, ExtendedPubKey, ChildNumber};
-use bitcoin::util::address::Address;
 use bitcoin::util::bip143;
 
 use bitcoin::hashes::{Hash, HashEngine};
@@ -86,20 +85,13 @@ pub enum SpendableOutputDescriptor {
                /// The remote_revocation_pubkey used to derive witnessScript
                remote_revocation_pubkey: PublicKey
        },
-       // TODO: Note that because key is now static and exactly what is provided by us, we should drop
-       // this in favor of StaticOutput:
-       /// An output to a P2WPKH, spendable exclusively by the given private key.
+       /// An output to a P2WPKH, spendable exclusively by our payment key.
        /// The witness in the spending input, is, thus, simply:
        /// <BIP 143 signature> <payment key>
        ///
        /// These are generally the result of our counterparty having broadcast the current state,
        /// allowing us to claim the non-HTLC-encumbered outputs immediately.
-       ///
-       /// To derive the payment key corresponding to the channel state, you must pass the
-       /// channel's payment_base_key and the provided per_commitment_point to
-       /// chan_utils::derive_private_key. The resulting key should be used to sign the spending
-       /// transaction.
-       DynamicOutputP2WPKH {
+       StaticOutputRemotePayment {
                /// The outpoint which is spendable
                outpoint: OutPoint,
                /// The output which is reference by the given outpoint
@@ -128,7 +120,7 @@ impl Writeable for SpendableOutputDescriptor {
                                key_derivation_params.1.write(writer)?;
                                remote_revocation_pubkey.write(writer)?;
                        },
-                       &SpendableOutputDescriptor::DynamicOutputP2WPKH { ref outpoint, ref output, ref key_derivation_params } => {
+                       &SpendableOutputDescriptor::StaticOutputRemotePayment { ref outpoint, ref output, ref key_derivation_params } => {
                                2u8.write(writer)?;
                                outpoint.write(writer)?;
                                output.write(writer)?;
@@ -155,7 +147,7 @@ impl Readable for SpendableOutputDescriptor {
                                key_derivation_params: (Readable::read(reader)?, Readable::read(reader)?),
                                remote_revocation_pubkey: Readable::read(reader)?,
                        }),
-                       2u8 => Ok(SpendableOutputDescriptor::DynamicOutputP2WPKH {
+                       2u8 => Ok(SpendableOutputDescriptor::StaticOutputRemotePayment {
                                outpoint: Readable::read(reader)?,
                                output: Readable::read(reader)?,
                                key_derivation_params: (Readable::read(reader)?, Readable::read(reader)?),
index d4d70691ea08a3855da19dd8171a1afd1bfcb4ab..638992864b15dbcf23e5110f8d6e3ca01a3163af 100644 (file)
@@ -2188,7 +2188,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
                                        break;
                                }
                        } else if self.remote_payment_script == outp.script_pubkey {
-                               spendable_output = Some(SpendableOutputDescriptor::DynamicOutputP2WPKH {
+                               spendable_output = Some(SpendableOutputDescriptor::StaticOutputRemotePayment {
                                        outpoint: BitcoinOutPoint { txid: tx.txid(), vout: i as u32 },
                                        output: outp.clone(),
                                        key_derivation_params: self.keys.key_derivation_params(),
index b62847a450e3b73a79e6b08608211ab6026e36c7..3a45547ac95a631d3bc951aac247cdfeab35bee6 100644 (file)
@@ -4097,7 +4097,7 @@ macro_rules! check_spendable_outputs {
                                        Event::SpendableOutputs { ref outputs } => {
                                                for outp in outputs {
                                                        match *outp {
-                                                               SpendableOutputDescriptor::DynamicOutputP2WPKH { ref outpoint, ref output, ref key_derivation_params } => {
+                                                               SpendableOutputDescriptor::StaticOutputRemotePayment { ref outpoint, ref output, ref key_derivation_params } => {
                                                                        let input = TxIn {
                                                                                previous_output: outpoint.clone(),
                                                                                script_sig: Script::new(),
index 59a8b5cff8f51c8e9f6b92d7aaa2aed9a050a646..9a1b3ccf983b7493a172e95a58f8be2971e8d0bd 100644 (file)
@@ -1,13 +1,11 @@
 use ln::chan_utils::{HTLCOutputInCommitment, TxCreationKeys, ChannelPublicKeys, LocalCommitmentTransaction};
 use ln::{chan_utils, msgs};
-use ln::channelmanager::PaymentPreimage;
 use chain::keysinterface::{ChannelKeys, InMemoryChannelKeys};
 
 use std::cmp;
 use std::sync::{Mutex, Arc};
 
 use bitcoin::blockdata::transaction::Transaction;
-use bitcoin::blockdata::script::Script;
 use bitcoin::util::bip143;
 
 use bitcoin::secp256k1;
index b94540446339d421fec525597d653878a647f621..c736428623ce40c0a53c89952b7e0ee7014b7236 100644 (file)
@@ -132,7 +132,7 @@ impl<'a> std::fmt::Display for DebugSpendable<'a> {
                        &SpendableOutputDescriptor::DynamicOutputP2WSH { ref outpoint, .. } => {
                                write!(f, "DynamicOutputP2WSH {}:{} marked for spending", outpoint.txid, outpoint.vout)?;
                        }
-                       &SpendableOutputDescriptor::DynamicOutputP2WPKH { ref outpoint, .. } => {
+                       &SpendableOutputDescriptor::StaticOutputRemotePayment { ref outpoint, .. } => {
                                write!(f, "DynamicOutputP2WPKH {}:{} marked for spending", outpoint.txid, outpoint.vout)?;
                        }
                }