fix: reconcile missed manual capture authorizations #13

Merged
thesimplekid merged 1 commit from fix/5-reconcile-held-payments into main 2026-10-09 14:21:16 +00:00
Owner

Funded manual-capture payments previously disappeared from Satsettle when their best-effort claimable event was missed. The engine now scans authenticated, paginated LDK payment records at startup, after reconnection, during recovery, and periodically while running.

The reconciler accepts only pending inbound BOLT11 records matching a hold owned by this store and its exact node configuration. It subtracts skimmed fees, applies existing underpayment/expiry/decision checks, and journals rejection retries. It never automatically claims a payment. Recovered authorizations retain observation order and an unknown deadline; a later event can fill the deadline without duplicating or reordering them. Both background tasks stop on close/drop. Node macaroons now require ListPayments.

Validation: formatting and Clippy pass. All 49 unit, protocol integration and documentation tests pass in the x86_64 Linux Nix checks. The new regression covers offline funding over multiple history pages, a fee-reduced underpayment, late duplicate events, explicit claim/reject, and lost events on a live connection. Existing failed/expired hold and reconnect tests also pass. Real-node regtest coverage is tracked separately in #8; aarch64 was not checked.

Stacked on #12; this diff contains only the issue #5 fix.

Closes #5.

Funded manual-capture payments previously disappeared from Satsettle when their best-effort claimable event was missed. The engine now scans authenticated, paginated LDK payment records at startup, after reconnection, during recovery, and periodically while running. The reconciler accepts only pending inbound BOLT11 records matching a hold owned by this store and its exact node configuration. It subtracts skimmed fees, applies existing underpayment/expiry/decision checks, and journals rejection retries. It never automatically claims a payment. Recovered authorizations retain observation order and an unknown deadline; a later event can fill the deadline without duplicating or reordering them. Both background tasks stop on close/drop. Node macaroons now require `ListPayments`. Validation: formatting and Clippy pass. All 49 unit, protocol integration and documentation tests pass in the x86_64 Linux Nix checks. The new regression covers offline funding over multiple history pages, a fee-reduced underpayment, late duplicate events, explicit claim/reject, and lost events on a live connection. Existing failed/expired hold and reconnect tests also pass. Real-node regtest coverage is tracked separately in #8; aarch64 was not checked. Stacked on #12; this diff contains only the issue #5 fix. Closes #5.
fix: reconcile missed manual capture authorizations
Some checks failed
Checks / format (pull_request) Failing after 2s
Checks / checks (pull_request) Failing after 1s
Checks / cdk-compatible (pull_request) Failing after 5s
Checks / format (push) Has been cancelled
Checks / checks (push) Has been cancelled
Checks / cdk-compatible (push) Has been cancelled
1feeb33d8f
Scan paginated LDK payment records at startup, reconnect and periodically
so pending owned holds survive lost events. Keep the application claim
decision explicit and preserve durable observation order on late events.

Subtract skimmed fees, reject ineligible holds through the existing journal,
and leave claim deadlines unknown until supplied by an event.

Closes #5.
thesimplekid changed target branch from fix/4-cashu-receipt-evidence to main 2026-10-09 14:21:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thesimplekid/satsettle!13
No description provided.