Skip to content

Test for BOLT 2 requirements for update_add_htlc message #291

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

Closed
Show file tree
Hide file tree
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
12 changes: 10 additions & 2 deletions src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ pub(super) struct Channel {
// update_fee() during ChannelState::AwaitingRemoteRevoke.
holding_cell_update_fee: Option<u64>,
next_local_htlc_id: u64,
#[cfg(test)]
pub next_remote_htlc_id: u64,
#[cfg(not(test))]
next_remote_htlc_id: u64,
channel_update_count: u32,
feerate_per_kw: u64,
Expand Down Expand Up @@ -307,6 +310,9 @@ pub(super) struct Channel {
pub(super) our_dust_limit_satoshis: u64,
#[cfg(not(test))]
our_dust_limit_satoshis: u64,
#[cfg(test)]
pub(super) their_max_htlc_value_in_flight_msat: u64,
#[cfg(not(test))]
their_max_htlc_value_in_flight_msat: u64,
//get_our_max_htlc_value_in_flight_msat(): u64,
/// minimum channel reserve for **self** to maintain - set by them.
Expand All @@ -316,6 +322,9 @@ pub(super) struct Channel {
our_htlc_minimum_msat: u64,
their_to_self_delay: u16,
//implied by BREAKDOWN_TIMEOUT: our_to_self_delay: u16,
#[cfg(test)]
pub their_max_accepted_htlcs: u16,
#[cfg(not(test))]
their_max_accepted_htlcs: u16,
//implied by OUR_MAX_HTLCS: our_max_accepted_htlcs: u16,
minimum_depth: u32,
Expand All @@ -337,7 +346,7 @@ pub(super) struct Channel {
logger: Arc<Logger>,
}

const OUR_MAX_HTLCS: u16 = 50; //TODO
pub const OUR_MAX_HTLCS: u16 = 50; //TODO
/// Confirmation count threshold at which we close a channel. Ideally we'd keep the channel around
/// on ice until the funding transaction gets more confirmations, but the LN protocol doesn't
/// really allow for this, so instead we're stuck closing it out at that point.
Expand Down Expand Up @@ -1597,7 +1606,6 @@ impl Channel {
cltv_expiry: msg.cltv_expiry,
state: InboundHTLCState::RemoteAnnounced(pending_forward_state),
});

Ok(())
}

Expand Down
Loading