aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/register.js6
-rw-r--r--routes/payments.js2
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/register.js b/lib/register.js
index 71b8e17d..9f8f927e 100644
--- a/lib/register.js
+++ b/lib/register.js
@@ -46,12 +46,6 @@ export default async (user, ip, requireChallenge) => {
user.otpsecret = authenticator.generateSecret();
user.migrated = true;
- let d = ip.split(".");
- ip = ((+d[0] * 256 + +d[1]) * 256 + +d[2]) * 256 + +d[3];
- if (Number.isInteger(ip)) {
- user.ip = ip;
- }
-
await s(`user:${id}`, user);
await s(`user:${username}`, id);
await s(`user:${pubkey}`, id);
diff --git a/routes/payments.js b/routes/payments.js
index 73ffa1df..8857b355 100644
--- a/routes/payments.js
+++ b/routes/payments.js
@@ -185,7 +185,7 @@ export default {
async pot({ params: { name } }, res) {
let amount = await g(`pot:${name}`);
- if (!amount) return bail(res, "pot not found");
+ if (typeof amount === 'undefined') return bail(res, "pot not found");
let payments = (await db.lRange(`pot:${name}:payments`, 0, -1)) || [];
payments = await Promise.all(payments.map(hash => g(`payment:${hash}`)));