aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2019-01-02 20:53:35 +0000
committerAdam Soltys <[email protected]>2019-02-05 20:53:45 -0800
commitb1121c424a450a2bab4f6bd514a8bb9c85242d81 (patch)
tree0d3fc533c1d35ed3ab74d2ecabd5e890766b0881
parent498fd370b536eacc08505ed4b4ac2b3360a46ea4 (diff)
downloadcoinos-server-b1121c424a450a2bab4f6bd514a8bb9c85242d81.tar.gz
coinos-server-b1121c424a450a2bab4f6bd514a8bb9c85242d81.zip
check rate before emitting
-rw-r--r--index.js5
1 files 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,