diff options
| author | Adam Soltys <[email protected]> | 2023-01-31 20:03:04 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-31 20:03:04 -0800 |
| commit | 2eb199b8609b0976b4800815edcf73aa3da4b464 (patch) | |
| tree | 62c567a3f506afba9a592731abd7bc2a63ab0b97 /lib | |
| parent | 283ffc9d8442ecbbc85c0c40167cc03f20f64a40 (diff) | |
| download | coinos-server-2eb199b8609b0976b4800815edcf73aa3da4b464.tar.gz coinos-server-2eb199b8609b0976b4800815edcf73aa3da4b464.zip | |
account migration
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/payments.js | 2 | ||||
| -rw-r--r-- | lib/register.js | 1 | ||||
| -rw-r--r-- | lib/utils.js | 20 |
3 files changed, 22 insertions, 1 deletions
diff --git a/lib/payments.js b/lib/payments.js index d0593447..cc8747d7 100644 --- a/lib/payments.js +++ b/lib/payments.js @@ -34,7 +34,7 @@ export let debit = async ( if (!amount || amount < 0) fail("Amount must be greater than zero"); - let ourfee = Math.round(amount * config.fee); + let ourfee = type === types.internal ? 0 : Math.round(amount * config.fee); await t(`balance:${uid}`, async (balance, db) => { await t(`credit:${type}:${uid}`, async (credit, db) => { let covered = Math.min(credit, ourfee) || 0; diff --git a/lib/register.js b/lib/register.js index e8b826e3..a3ebfc86 100644 --- a/lib/register.js +++ b/lib/register.js @@ -44,6 +44,7 @@ export default async (user, ip, requireChallenge) => { user.fiat = false; user.otpsecret = authenticator.generateSecret(); user.balance = 0; + user.migrated = true; let d = ip.split("."); ip = ((+d[0] * 256 + +d[1]) * 256 + +d[2]) * 256 + +d[3]; diff --git a/lib/utils.js b/lib/utils.js index e58f7d1f..8291d173 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -38,3 +38,23 @@ export const bip21 = (address, { amount, memo, tip }) => { return url; }; + +export const fields = [ + "cipher", + "pubkey", + "password", + "username", + "salt", + "currency", + "currencies", + "fiat", + "otpsecret", + "balance", + "ip", + "pin", + "display", + "haspin", + "profile", + "prompt", + "banner" +]; |
