Skip to content
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

refactor: last_update_message should not be none #188

Merged
merged 1 commit into from
Sep 24, 2024
Merged
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
4 changes: 2 additions & 2 deletions src/fiber/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub struct ChannelUpdateInfo {
/// Mostly redundant with the data we store in fields explicitly.
/// Everything else is useful only for sending out for initial routing sync.
/// Not stored if contains excess data to prevent DoS.
pub last_update_message: Option<ChannelUpdate>,
pub last_update_message: ChannelUpdate,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -350,7 +350,7 @@ where
htlc_minimum_value: update.tlc_minimum_value,
htlc_maximum_value: update.tlc_maximum_value,
fee_rate: update.tlc_fee_proportional_millionths as u64,
last_update_message: Some(update.clone()),
last_update_message: update.clone(),
});

self.store.insert_channel(channel.to_owned());
Expand Down
4 changes: 2 additions & 2 deletions src/fiber/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -906,12 +906,12 @@ where
channel_info
.one_to_two
.as_ref()
.and_then(|u| u.last_update_message.clone())
.map(|u| u.last_update_message.clone())
} else {
channel_info
.two_to_one
.as_ref()
.and_then(|u| u.last_update_message.clone())
.map(|u| u.last_update_message.clone())
};
match update {
Some(update) => Ok(FiberBroadcastMessage::ChannelUpdate(update)),
Expand Down
Loading