From: Antoine Riard Date: Wed, 6 May 2020 01:42:51 +0000 (-0400) Subject: Remove useless build warnings X-Git-Tag: v0.0.12~62^2~3 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=22daecb8e494122af8617f716014cae9dca38b9b;p=rust-lightning Remove useless build warnings --- diff --git a/lightning/src/chain/keysinterface.rs b/lightning/src/chain/keysinterface.rs index 654ba71ef..b7ef55ca7 100644 --- a/lightning/src/chain/keysinterface.rs +++ b/lightning/src/chain/keysinterface.rs @@ -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: /// /// /// 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)?), diff --git a/lightning/src/ln/channelmonitor.rs b/lightning/src/ln/channelmonitor.rs index e7e575a98..5db9d1714 100644 --- a/lightning/src/ln/channelmonitor.rs +++ b/lightning/src/ln/channelmonitor.rs @@ -2199,7 +2199,7 @@ impl ChannelMonitor { 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(), diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index 3e4eaaa03..28a5f8a57 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -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(), diff --git a/lightning/src/util/enforcing_trait_impls.rs b/lightning/src/util/enforcing_trait_impls.rs index 59a8b5cff..9a1b3ccf9 100644 --- a/lightning/src/util/enforcing_trait_impls.rs +++ b/lightning/src/util/enforcing_trait_impls.rs @@ -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; diff --git a/lightning/src/util/macro_logger.rs b/lightning/src/util/macro_logger.rs index 5a6002d85..196ba9ea9 100644 --- a/lightning/src/util/macro_logger.rs +++ b/lightning/src/util/macro_logger.rs @@ -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)?; } }