Skip to content

Make HTLCDescriptor writeable #2571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lightning/src/events/bump_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ pub struct ChannelDerivationParameters {
pub transaction_parameters: ChannelTransactionParameters,
}

impl_writeable_tlv_based!(ChannelDerivationParameters, {
(0, value_satoshis, required),
(2, keys_id, required),
(4, transaction_parameters, required),
});

/// A descriptor used to sign for a commitment transaction's anchor output.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct AnchorDescriptor {
Expand Down Expand Up @@ -139,6 +145,16 @@ pub struct HTLCDescriptor {
pub counterparty_sig: Signature
}

impl_writeable_tlv_based!(HTLCDescriptor, {
(0, channel_derivation_parameters, required),
(2, commitment_txid, required),
(4, per_commitment_number, required),
(6, per_commitment_point, required),
(8, htlc, required),
(10, preimage, option),
(12, counterparty_sig, required),
});

impl HTLCDescriptor {
/// Returns the outpoint of the HTLC output in the commitment transaction. This is the outpoint
/// being spent by the HTLC input in the HTLC transaction.
Expand Down