Skip to main content

fee_encoded_expiration

Function fee_encoded_expiration 

Source
pub fn fee_encoded_expiration(fee_msats: u64) -> u64
Expand description

Encode a gateway fee into an incoming-contract expiration.

Incoming contracts created for lnurl receives store the gateway fee here instead of a real timestamp: the receiving client never sees the invoice for these contracts, so this is the only way for it to recover the fee and report the invoice amount in its payment events. A real expiration is not needed as these contracts are discovered via the contract stream rather than awaited per-invoice, and the funding-time validation only requires the expiration to lie in the future, which the resulting near-u64::MAX value satisfies.