Skip to content

Commit f725d06

Browse files
committed
Drop the unused PaymentKey type
935a716 added new wrappers for the various channel keys, including a payment_key. However, the `payment_key` has been unused in lightning since the introduction (and broad requiring) of the `static_remotekey` feature. Thus, we simply remove it (and an incredibly stale TODO) here.
1 parent f0dd276 commit f725d06

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

lightning/src/ln/channel.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,8 +1568,6 @@ impl<SP: Deref> ChannelContext<SP> where SP::Target: SignerProvider {
15681568
/// will sign and send to our counterparty.
15691569
/// If an Err is returned, it is a ChannelError::Close (for get_funding_created)
15701570
fn build_remote_transaction_keys(&self) -> TxCreationKeys {
1571-
//TODO: Ensure that the payment_key derived here ends up in the library users' wallet as we
1572-
//may see payments to it!
15731571
let revocation_basepoint = &self.get_holder_pubkeys().revocation_basepoint;
15741572
let htlc_basepoint = &self.get_holder_pubkeys().htlc_basepoint;
15751573
let counterparty_pubkeys = self.get_counterparty_pubkeys();

lightning/src/ln/channel_keys.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,6 @@ impl DelayedPaymentKey {
111111
}
112112
key_read_write!(DelayedPaymentKey);
113113

114-
/// Master key used in conjunction with per_commitment_point to generate a [localpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
115-
/// Also used to generate a commitment number in a commitment transaction or as a Payment Key for a remote node (not us) in an anchor output if `option_static_remotekey` is enabled.
116-
/// Shared by both nodes in a channel establishment message flow.
117-
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash)]
118-
pub struct PaymentBasepoint(pub PublicKey);
119-
basepoint_impl!(PaymentBasepoint);
120-
key_read_write!(PaymentBasepoint);
121-
122-
123-
/// [localpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#localpubkey-local_htlcpubkey-remote_htlcpubkey-local_delayedpubkey-and-remote_delayedpubkey-derivation) is a child key of a payment basepoint,
124-
/// that enables a secure hash-lock for off-chain payments without risk of funds getting stuck or stolen. A payment key is normally shared with a counterparty so that it can generate
125-
/// a commitment transaction's to_remote ouput, which our node can claim in case the counterparty force closes the channel.
126-
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
127-
pub struct PaymentKey(pub PublicKey);
128-
129-
impl PaymentKey {
130-
key_impl!(PaymentBasepoint, "localpubkey");
131-
}
132-
key_read_write!(PaymentKey);
133-
134114
/// Master key used in conjunction with per_commitment_point to generate [htlcpubkey](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation) for the latest state of a channel.
135115
#[derive(PartialEq, Eq, Clone, Copy, Debug, Hash)]
136116
pub struct HtlcBasepoint(pub PublicKey);

0 commit comments

Comments
 (0)