diff options
| author | Adam Soltys <[email protected]> | 2026-06-04 18:19:25 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-04 18:19:25 -0700 |
| commit | 0154bb060fad7650cd8b825a30a5d88e7018bf8d (patch) | |
| tree | 4a9153ec5adfbf26a95f3bb5d19d8cf133a8639e /scripts | |
| parent | bd1ece38e42751575ac2e03a5c795b5b109653ac (diff) | |
| download | coinos-server-0154bb060fad7650cd8b825a30a5d88e7018bf8d.tar.gz coinos-server-0154bb060fad7650cd8b825a30a5d88e7018bf8d.zip | |
nwc: fix make_invoice timestamps (ms -> seconds) breaking NWC clients
generate() stores `created` in milliseconds (Date.now()), but the NWC
make_invoice response returned it directly as created_at and computed
expires_at = created_at + expiry. NWC timestamps are Unix SECONDS (NIP-47),
so clients parsed a ~1.78e12 expires_at that overflowed their date types —
e.g. ptcpay's .NET DateTimeOffset, whose max is 253402300799 (issue #84:
"creating lightning invoices via NWC fails ... Valid values are between
-62135596800 and 253402300799"). Convert created to seconds before use.
The other NWC handlers were already correct (lookup_invoice reads seconds
straight from cln; list_transactions divides p.created by 1000). Only
make_invoice leaked milliseconds.
Fixes #84
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
