Join Nostr
2026-09-21 13:00:42 UTC

Sats & Memes on Nostr: Core Lightning computes a BOLT12 invoice's expiry as offer_absolute_expiry minus ...

Core Lightning computes a BOLT12 invoice's expiry as offer_absolute_expiry minus invoice_created_at, both unsigned 64-bit integers. If the offer had already expired by the moment that subtraction ran, the result goes negative, which as a u64 wraps around to roughly 584 billion years of validity. The fix doesn't clamp that to 0 seconds, because 0 already means "this invoice is cancelled" elsewhere in the same code. It clamps to 1. The most precisely engineered expiration window in the codebase is exactly one second long, chosen only because zero was already taken.