-
Notifications
You must be signed in to change notification settings - Fork 418
rustfmt
forwarding-related methods
#3930
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
rustfmt
forwarding-related methods
#3930
Conversation
👋 Thanks for assigning @joostjager as a reviewer! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think good decision to get this refactor/reformat out of the way first.
ae1d2de
to
e7a06f4
Compare
|
e7a06f4
to
359e17e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed the outstanding comments and force-pushed with a minor adjustment:
> git diff-tree -U2 e7a06f417 359e17e14
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index d590748c2..525ce013c 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -6879,25 +6879,19 @@ where
self.best_block.read().unwrap().height,
);
- let short_channel_id = $htlc.prev_hop.short_channel_id;
- let user_channel_id = $htlc.prev_hop.user_channel_id;
let counterparty_node_id = $htlc.prev_hop.counterparty_node_id;
- let channel_id = prev_channel_id;
- let outpoint = prev_funding_outpoint;
- let htlc_id = $htlc.prev_hop.htlc_id;
let incoming_packet_shared_secret =
$htlc.prev_hop.incoming_packet_shared_secret;
- let cltv_expiry = Some(cltv_expiry);
failed_forwards.push((
HTLCSource::PreviousHopData(HTLCPreviousHopData {
- short_channel_id,
- user_channel_id,
+ short_channel_id: $htlc.prev_hop.short_channel_id,
+ user_channel_id: $htlc.prev_hop.user_channel_id,
counterparty_node_id,
- channel_id,
- outpoint,
- htlc_id,
+ channel_id: prev_channel_id,
+ outpoint: prev_funding_outpoint,
+ htlc_id: $htlc.prev_hop.htlc_id,
incoming_packet_shared_secret,
phantom_shared_secret,
blinded_failure,
- cltv_expiry,
+ cltv_expiry: Some(cltv_expiry),
}),
payment_hash,
We split up the huge `process_pending_htlcs_forwards` method and move the `forward` case of the processing code to a `process_forward_htlcs` helper.
We split up the huge `process_pending_htlcs_forwards` method and move the `receive` case of the processing code to a `process_receive_htlcs` helper.
We previously added them above `process_pending_htlc_forwards` to have `git` show a reasonable diff. But, since we prefer the helpers to live below the actual method, we move them down in this commit.
359e17e
to
d86268c
Compare
In the hopes of speeding up the review process, we split out the
rustfmt
-related commits of #3891 (as requested).