Skip to content

Commit

Permalink
Fix disabled channel flags
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Jan 6, 2025
1 parent 94a6ce5 commit d63f40c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/fiber/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3564,6 +3564,13 @@ impl ChannelActorState {
Some(self.generate_channel_update(network).await)
}

fn get_channel_update_channel_flags(&self) -> u32 {
self.public_channel_info
.as_ref()
.and_then(|info: &PublicChannelInfo| (!info.enabled).then_some(CHANNEL_DISABLED_FLAG))
.unwrap_or(0)
}

pub fn get_unsigned_channel_update_message(&self) -> Option<ChannelUpdate> {
let local_is_node1 = self.local_is_node1();
let message_flags = if local_is_node1 { 0 } else { 1 };
Expand All @@ -3572,7 +3579,7 @@ impl ChannelActorState {
self.must_get_funding_transaction_outpoint(),
now_timestamp_as_millis_u64(),
message_flags,
0,
self.get_channel_update_channel_flags(),
self.local_tlc_info.tlc_expiry_delta,
self.local_tlc_info.tlc_min_value,
self.local_tlc_info.tlc_fee_proportional_millionths,
Expand Down

0 comments on commit d63f40c

Please sign in to comment.