Skip to content

Commit a61258b

Browse files
committed
Fix doc errors and warnings.
1 parent b7a6e7f commit a61258b

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ pub enum SpendableOutputDescriptor {
143143
/// These may include outputs from a transaction punishing our counterparty or claiming an HTLC
144144
/// on-chain using the payment preimage or after it has timed out.
145145
///
146-
/// [`get_shutdown_scriptpubkey`]: KeysInterface::get_shutdown_scriptpubkey
147-
/// [`get_destination_script`]: KeysInterface::get_shutdown_scriptpubkey
146+
/// [`get_shutdown_scriptpubkey`]: SignerProvider::get_shutdown_scriptpubkey
147+
/// [`get_destination_script`]: SignerProvider::get_shutdown_scriptpubkey
148148
StaticOutput {
149149
/// The outpoint which is spendable.
150150
outpoint: OutPoint,
@@ -1021,7 +1021,6 @@ impl KeysManager {
10211021
match ExtendedPrivKey::new_master(Network::Testnet, seed) {
10221022
Ok(master_key) => {
10231023
let node_secret = master_key.ckd_priv(&secp_ctx, ChildNumber::from_hardened_idx(0).unwrap()).expect("Your RNG is busted").private_key;
1024-
let node_id = PublicKey::from_secret_key(&secp_ctx, &node_secret);
10251024
let destination_script = match master_key.ckd_priv(&secp_ctx, ChildNumber::from_hardened_idx(1).unwrap()) {
10261025
Ok(destination_key) => {
10271026
let wpubkey_hash = WPubkeyHash::hash(&ExtendedPubKey::from_priv(&secp_ctx, &destination_key).to_pub().to_bytes());
@@ -1408,7 +1407,6 @@ impl PhantomKeysManager {
14081407
let inner = KeysManager::new(seed, starting_time_secs, starting_time_nanos);
14091408
let (inbound_key, phantom_key) = hkdf_extract_expand_twice(b"LDK Inbound and Phantom Payment Key Expansion", cross_node_seed);
14101409
let phantom_secret = SecretKey::from_slice(&phantom_key).unwrap();
1411-
let phantom_node_id = PublicKey::from_secret_key(&inner.secp_ctx, &phantom_secret);
14121410
Self {
14131411
inner,
14141412
inbound_payment_key: KeyMaterial(inbound_key),

lightning/src/ln/inbound_payment.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const AMT_MSAT_LEN: usize = 8;
3535
const METHOD_TYPE_OFFSET: usize = 5;
3636

3737
/// A set of keys that were HKDF-expanded from an initial call to
38-
/// [`KeysInterface::get_inbound_payment_key_material`].
38+
/// [`NodeSigner::get_inbound_payment_key_material`].
3939
///
40-
/// [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
40+
/// [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
4141
pub struct ExpandedKey {
4242
/// The key used to encrypt the bytes containing the payment metadata (i.e. the amount and
4343
/// expiry, included for payment verification on decryption).
@@ -84,7 +84,7 @@ impl Method {
8484
/// `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without
8585
/// a `ChannelManager`.
8686
///
87-
/// `keys` is generated by calling [`KeysInterface::get_inbound_payment_key_material`] and then
87+
/// `keys` is generated by calling [`NodeSigner::get_inbound_payment_key_material`] and then
8888
/// calling [`ExpandedKey::new`] with its result. It is recommended to cache this value and not
8989
/// regenerate it for each new inbound payment.
9090
///
@@ -176,7 +176,7 @@ fn construct_payment_secret(iv_bytes: &[u8; IV_LEN], metadata_bytes: &[u8; METAD
176176
///
177177
/// The metadata is constructed as:
178178
/// payment method (3 bits) || payment amount (8 bytes - 3 bits) || expiry (8 bytes)
179-
/// and encrypted using a key derived from [`KeysInterface::get_inbound_payment_key_material`].
179+
/// and encrypted using a key derived from [`NodeSigner::get_inbound_payment_key_material`].
180180
///
181181
/// Then on payment receipt, we verify in this method that the payment preimage and payment secret
182182
/// match what was constructed.
@@ -197,7 +197,7 @@ fn construct_payment_secret(iv_bytes: &[u8; IV_LEN], metadata_bytes: &[u8; METAD
197197
///
198198
/// See [`ExpandedKey`] docs for more info on the individual keys used.
199199
///
200-
/// [`KeysInterface::get_inbound_payment_key_material`]: crate::chain::keysinterface::KeysInterface::get_inbound_payment_key_material
200+
/// [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
201201
/// [`create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
202202
/// [`create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
203203
pub(super) fn verify<L: Deref>(payment_hash: PaymentHash, payment_data: &msgs::FinalOnionHopData, highest_seen_timestamp: u64, keys: &ExpandedKey, logger: &L) -> Result<Option<PaymentPreimage>, ()>

lightning/src/util/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ pub struct ChannelHandshakeConfig {
120120
/// any attacker who is able to take control of a channel can just as easily send the funds via
121121
/// lightning payments, so we never require that our counterparties support this option.
122122
///
123-
/// The upfront key committed is provided from [`KeysInterface::get_shutdown_scriptpubkey`].
123+
/// The upfront key committed is provided from [`SignerProvider::get_shutdown_scriptpubkey`].
124124
///
125125
/// Default value: true.
126126
///
127-
/// [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
127+
/// [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
128128
pub commit_upfront_shutdown_pubkey: bool,
129129

130130
/// The Proportion of the channel value to configure as counterparty's channel reserve,

lightning/src/util/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ pub enum APIError {
5555
/// [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
5656
/// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
5757
MonitorUpdateInProgress,
58-
/// [`KeysInterface::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
58+
/// [`SignerProvider::get_shutdown_scriptpubkey`] returned a shutdown scriptpubkey incompatible
5959
/// with the channel counterparty as negotiated in [`InitFeatures`].
6060
///
6161
/// Using a SegWit v0 script should resolve this issue. If you cannot, you won't be able to open
6262
/// a channel or cooperatively close one with this peer (and will have to force-close instead).
6363
///
64-
/// [`KeysInterface::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::KeysInterface::get_shutdown_scriptpubkey
64+
/// [`SignerProvider::get_shutdown_scriptpubkey`]: crate::chain::keysinterface::SignerProvider::get_shutdown_scriptpubkey
6565
/// [`InitFeatures`]: crate::ln::features::InitFeatures
6666
IncompatibleShutdownScript {
6767
/// The incompatible shutdown script.

lightning/src/util/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ impl TestKeysInterface {
689689
}
690690
}
691691

692-
/// Sets an expectation that [`keysinterface::KeysInterface::get_shutdown_scriptpubkey`] is
692+
/// Sets an expectation that [`keysinterface::SignerProvider::get_shutdown_scriptpubkey`] is
693693
/// called.
694694
pub fn expect(&self, expectation: OnGetShutdownScriptpubkey) -> &Self {
695695
self.expectations.lock().unwrap()
@@ -737,7 +737,7 @@ impl Drop for TestKeysInterface {
737737
}
738738
}
739739

740-
/// An expectation that [`keysinterface::KeysInterface::get_shutdown_scriptpubkey`] was called and
740+
/// An expectation that [`keysinterface::SignerProvider::get_shutdown_scriptpubkey`] was called and
741741
/// returns a [`ShutdownScript`].
742742
pub struct OnGetShutdownScriptpubkey {
743743
/// A shutdown script used to close a channel.

0 commit comments

Comments
 (0)