diff options
Diffstat (limited to 'lib/invoices.js')
| -rw-r--r-- | lib/invoices.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/invoices.js b/lib/invoices.js index 557d0de6..2f1225e7 100644 --- a/lib/invoices.js +++ b/lib/invoices.js @@ -37,8 +37,9 @@ export let generate = async ({ invoice, user, sender }) => { else if (sender) user = await getUser(sender.username); if (!user) fail("user not provided"); + let rates = await g('rates'); if (!currency) currency = user.currency; - if (!rate) rate = store.rates[currency]; + if (!rate) rate = rates[currency]; if (fiat) amount = Math.round((SATS * fiat) / rate); if (amount < 0) fail("invalid amount"); if (tip < 0) fail("invalid tip"); |
