diff options
| author | Adam Soltys <[email protected]> | 2018-04-07 05:47:41 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2018-04-07 05:47:43 +0000 |
| commit | 9b5ed5e197c6c08cd7cce7e2d2c7d37c835f1aec (patch) | |
| tree | 8a1544a74aa034945b9a3ffa1bb83a81d3be4a6b | |
| parent | e81b3a4d0207d5afb44d6161740a36507b93949d (diff) | |
| download | coinos-server-9b5ed5e197c6c08cd7cce7e2d2c7d37c835f1aec.tar.gz coinos-server-9b5ed5e197c6c08cd7cce7e2d2c7d37c835f1aec.zip | |
use bid price
| -rw-r--r-- | index.js | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -240,7 +240,11 @@ const l = console.log if (msg.startsWith('Multiple')) { busypeers.push(peer) peer = lna.channelpeers.find(p => !busypeers.includes(p)) - return openchannel(peer, amount) + if (peer) { + return openchannel(peer, amount) + } else { + return res.status(500).send('All peers are busy, couldn\'t open a channel, wait a few blocks and try again') + } } if (msg.startsWith('not enough')) { @@ -303,7 +307,7 @@ const l = console.log amount: -total, user_id: req.user.id, hash, - rate: app.get('rates').ask, + rate: app.get('rates').bid, currency: 'CAD', }) @@ -355,7 +359,7 @@ const l = console.log amount: -total, user_id: req.user.id, hash: txid, - rate: app.get('rates').ask, + rate: app.get('rates').bid, currency: 'CAD', }) @@ -418,7 +422,7 @@ const l = console.log } }) - if (!user) throw new Error('User not found') + if (!user) return res.status(401).end() let result = await bcrypt.compare(req.body.password, user.password) if (result) { |
