From b1121c424a450a2bab4f6bd514a8bb9c85242d81 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 2 Jan 2019 20:53:35 +0000 Subject: check rate before emitting --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 15beede5..4369bf0c 100644 --- a/index.js +++ b/index.js @@ -80,7 +80,8 @@ const l = console.log }) socket.sockets.on('connect', async socket => { - socket.emit('rate', app.get('rates').ask) + if (app.get('rates')) + socket.emit('rate', app.get('rates').ask) socket.on('getuser', async (data, callback) => { callback(await db.User.findOne({ where: { @@ -218,7 +219,7 @@ const l = console.log l('block', block.getHash().toString('hex')) await db.User.findAll({ - attributes: ['id', 'pending'], + attributes: ['id', 'balance', 'pending'], where: { pending: { [Sequelize.Op.ne]: null, -- cgit v1.2.3