ln/refactor: use amount_msat and counterparty_skimmed_fee_msat vars
What changed, and why it matters
This is a small code cleanup that replaces two computed expressions with variables already available in scope. It does not change behavior, fix a bug, or address any security issue.
No action needed; this is a non-functional refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors a struct initialization in channelmanager.rs to use pre-existing local variables amount_msat and counterparty_skimmed_fee_msat instead of recomputing the same values inline. The diff shows a pure substitution with no logic change.
Changed components
lightning/src/ln/channelmanager.rsInspect captured patch +2 / −7
diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs
index e333529..939e004 100644
--- a/lightning/src/ln/channelmanager.rs
+++ b/lightning/src/ln/channelmanager.rs
@@ -8445,13 +8445,8 @@ impl<
receiver_node_id: Some(receiver_node_id),
payment_hash,
purpose,
- amount_msat: claimable_payment
- .htlcs
- .iter()
- .map(|htlc| htlc.mpp_part.value)
- .sum(),
- counterparty_skimmed_fee_msat: claimable_payment
- .total_counterparty_skimmed_msat(),
+ amount_msat,
+ counterparty_skimmed_fee_msat,
receiving_channel_ids: claimable_payment.receiving_channel_ids(),
claim_deadline,
onion_fields: Some(claimable_payment.onion_fields.clone()),
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.