check_refresh_static_invoices: remove duration param
What changed, and why it matters
This is a small internal code cleanup in the Lightning Dev Kit library. It removes an unnecessary 'duration' argument from a private helper function and instead computes that value inside the function. There is no security-relevant change visible in the diff.
No security action needed. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors check_refresh_static_invoices in lightning/src/offers/flow.rs to remove the duration_since_epoch: Duration parameter. The caller previously passed duration_since_epoch, and now the callee obtains it via self.duration_since_epoch(). The change is purely structural (‘Makes the next commit a cleaner code move’) and does not alter logic, validation, or trust boundaries.
Changed components
lightning/src/offers/flow.rsInspect captured patch +4 / −9
diff --git a/lightning/src/offers/flow.rs b/lightning/src/offers/flow.rs
index 57baac9..66bd582 100644
--- a/lightning/src/offers/flow.rs
+++ b/lightning/src/offers/flow.rs
@@ -1293,13 +1293,7 @@ where
core::mem::drop(cache);
if timer_tick_occurred {
- self.check_refresh_static_invoices(
- peers,
- usable_channels,
- duration_since_epoch,
- entropy,
- router,
- );
+ self.check_refresh_static_invoices(peers, usable_channels, entropy, router);
}
Ok(())
@@ -1309,12 +1303,13 @@ where
/// server, based on the offers provided by the cache.
#[cfg(async_payments)]
fn check_refresh_static_invoices<ES: Deref, R: Deref>(
- &self, peers: Vec<MessageForwardNode>, usable_channels: Vec<ChannelDetails>,
- duration_since_epoch: Duration, entropy: ES, router: R,
+ &self, peers: Vec<MessageForwardNode>, usable_channels: Vec<ChannelDetails>, entropy: ES,
+ router: R,
) where
ES::Target: EntropySource,
R::Target: Router,
{
+ let duration_since_epoch = self.duration_since_epoch();
let mut serve_static_invoice_msgs = Vec::new();
{
let cache = self.async_receive_offer_cache.lock().unwrap();
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.