]> 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>
Thu, 28 May 2020 08:21:47 +0000 (04:21 -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 654ba71ef7d644245f3604ded5ab6975e94282bf..b7ef55ca7ec40312e5d868fc8ded33d544f1b662 100644 (file)
@@ -83,20 +83,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
@@ -125,7 +118,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)?;
@@ -152,7 +145,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 e7e575a988a86c1dfd690f6e5694791b70881838..5db9d17141ce28244d005780a304ca5b2a8b0948 100644 (file)
@@ -2199,7 +2199,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 3e4eaaa03837757f271672974ce5bc878fa6a1de..28a5f8a578e9890be370d3135cb97f16f7b97a1b 100644 (file)
@@ -4274,7 +4274,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 5a6002d8594201f8d0a30b0c32dde75d0d03fc1f..196ba9ea9ea73c19c3b07fdd58d6681fdecd8a88 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)?;
                        }
                }