mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 02:54:37 +00:00
DB-persisted, balance-versioned refund idempotency replacing the in-process refund-token cache. Every credit (cashu topup, Lightning topup, new-key) bumps ApiKey.balance_version atomically; /refund re-serves a stored token only at the current version and only if unredeemed. Covers the Lightning-topup path and multi-worker, which the in-process cache missed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>