Mirror of xmrcheckout commit eb15c52. Same two bugs, same fix.
1. _build_payload now emits amount (fiat), currency, and amount_crypto so Medusa's capture workflow captures the right value instead of 0 (which leaves payments authorized forever).
2. get_status() no longer calls set_daemon without an open wallet (was flooding logs with RPC -13). _daemon_height() probe is sufficient for daemon reachability.
3. Silenced monero.backends.jsonrpc.wallet logger for expected transient close_wallet errors.
Ports xmrcheckout upstream features (7 commits since 655d037):
- SystemStatus model for reconciler heartbeat tracking
- Monero connectivity caching in system status
- Health status endpoints in routes
- Hardened reconciler status updates with SQLAlchemyError handling
- Status schema additions
Adapted for Wownero: 3-decimal precision (0.001 WOW) in amount rounding.
- Advisory lock: wrap per-invoice processing in try/finally so lock is
ALWAYS released, even on exception. Previously, any error between lock
acquisition and release would leak the lock, causing the invoice to be
silently skipped forever on subsequent cycles.
- Error logging: wallet RPC errors now logged at ERROR level (was DEBUG),
making silent reconciliation failures visible in production logs.
- Transfer protection: don't delete stored transfers when wallet-rpc
returns an empty response (transient RPC glitch). Only prune when we
actually got transfer data back.
- Wallet restore height: new wallets generated from keys now look back
~2 days (1440 blocks) instead of starting at current height. Prevents
missing payments that arrived before the wallet was first opened on a
given wallet-rpc instance.
- Decimal formatting: _format_xmr_fixed() now strips trailing zeros
instead of always showing 12 decimal places.
- Invoice amount rounding: fiat-converted amounts now use ROUND_UP with
3 decimal places (was ROUND_DOWN with 12), preventing undercharging.
- Webhook retries: BTCPay webhook delivery now retries up to 3 times
with 1s/2s backoff on 5xx or network errors. Timeout increased 5s→10s.
Failures logged at ERROR level (was WARNING/DEBUG).
- POST/GET/DELETE /api/admin/users endpoints
- Admin UI at /admin with login, user list, create/delete
- Auth via ADMIN_API_KEY env var (separate from tenant auth)
- Tenants remain scoped to their own store only