Skip to content

#2803 nits #3187

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 2 commits into from
Jul 17, 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
8 changes: 4 additions & 4 deletions lightning/src/routing/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -801,9 +801,9 @@ where
//
// We do this by using `repr(C)`, which forces the struct to be laid out in memory the way we write
// it (ensuring `last_update_message` hangs off the end and no fields are reordered after it), and
// `align(32)`, ensuring the struct starts either at the start, or in the middle, of a 64b x86-64
// cache line. This ensures the beginning fields (which are 31 bytes) all sit in the same cache
// line.
// `align(32)`, ensuring the struct starts either at the start, or in the middle, of an x86-64
// 64-byte cache line. This ensures the beginning fields (which are 31 bytes) all sit in the same
// cache line.
#[repr(C, align(32))]
#[derive(Clone, Debug, PartialEq, Eq)]
/// Details about one direction of a channel as received within a [`ChannelUpdate`].
Expand Down Expand Up @@ -894,7 +894,7 @@ impl Readable for ChannelUpdateInfo {
//
// Sadly, this is not possible, however we can still do okay - all of the fields before
// `one_to_two` and `two_to_one` are just under 128 bytes long, so we can ensure they sit on
// adjacent cache lines (which are generally fetched together in x86_64 processors).
// adjacent cache lines (which are often fetched together in x86-64 processors).
//
// This leaves only the two directional channel info structs on separate cache lines.
//
Expand Down
6 changes: 3 additions & 3 deletions lightning/src/routing/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2433,10 +2433,10 @@ where L::Target: Logger {

#[allow(unused_comparisons)] // $next_hops_path_htlc_minimum_msat is 0 in some calls so rustc complains
let may_overpay_to_meet_path_minimum_msat =
((amount_to_transfer_over_msat < htlc_minimum_msat &&
(amount_to_transfer_over_msat < htlc_minimum_msat &&
recommended_value_msat >= htlc_minimum_msat) ||
(amount_to_transfer_over_msat < $next_hops_path_htlc_minimum_msat &&
recommended_value_msat >= $next_hops_path_htlc_minimum_msat));
(amount_to_transfer_over_msat < $next_hops_path_htlc_minimum_msat &&
recommended_value_msat >= $next_hops_path_htlc_minimum_msat);

let payment_failed_on_this_channel = match scid_opt {
Some(scid) => payment_params.previously_failed_channels.contains(&scid),
Expand Down
Loading