Skip to content

Commit 90521f3

Browse files
committed
Persist LSPS2 get_info responses
Reuse opening fee offers while they remain valid and match the configured LSP token. This avoids repeated LSPS2 round trips across node restarts while retaining a fresh-response fallback. Evict cached offers when a buy request fails so a retry fetches updated parameters. This commit was created with assistance from OpenAI Codex.
1 parent 1cc60c8 commit 90521f3

3 files changed

Lines changed: 538 additions & 18 deletions

File tree

src/io/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ pub(crate) const PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";
3333
pub(crate) const PENDING_PAYMENT_INFO_PERSISTENCE_PRIMARY_NAMESPACE: &str = "pending_payments";
3434
pub(crate) const PENDING_PAYMENT_INFO_PERSISTENCE_SECONDARY_NAMESPACE: &str = "";
3535

36+
/// LSPS2 client `get_info` responses will be cached under this prefix.
37+
pub(crate) const LSPS2_GET_INFO_CACHE_PRIMARY_NAMESPACE: &str = "lsps2_get_info";
38+
pub(crate) const LSPS2_GET_INFO_CACHE_SECONDARY_NAMESPACE: &str = "";
39+
3640
/// The node metrics will be persisted under this key.
3741
pub(crate) const NODE_METRICS_PRIMARY_NAMESPACE: &str = "";
3842
pub(crate) const NODE_METRICS_SECONDARY_NAMESPACE: &str = "";

0 commit comments

Comments
 (0)