remove old socket
This commit is contained in:
parent
85033effa4
commit
adb8cead88
1 changed files with 0 additions and 29 deletions
|
|
@ -257,35 +257,6 @@ module.exports = (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
io.of('default').on('connection', socket => {
|
|
||||||
logger.info(`io.onconnection`)
|
|
||||||
logger.info('socket.handshake', socket.handshake)
|
|
||||||
|
|
||||||
const isLNDSocket = !!socket.handshake.query.IS_LND_SOCKET
|
|
||||||
const isNotificationsSocket = !!socket.handshake.query
|
|
||||||
.IS_NOTIFICATIONS_SOCKET
|
|
||||||
|
|
||||||
logger.info('New socket client connected (id=' + socket.id + ').')
|
|
||||||
|
|
||||||
if (!isLNDSocket) {
|
|
||||||
// let's not allow this
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isLNDSocket) {
|
|
||||||
const subID = Math.floor(Math.random() * 1000).toString()
|
|
||||||
const isNotifications = isNotificationsSocket ? 'notifications' : ''
|
|
||||||
logger.info('[LND] New LND Socket created:' + isNotifications + subID)
|
|
||||||
const cancelInvoiceStream = onNewInvoice(socket, subID)
|
|
||||||
const cancelTransactionStream = onNewTransaction(socket, subID)
|
|
||||||
socket.on('disconnect', () => {
|
|
||||||
logger.info('LND socket disconnected:' + isNotifications + subID)
|
|
||||||
cancelInvoiceStream()
|
|
||||||
cancelTransactionStream()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
io.of('gun').on('connect', socket => {
|
io.of('gun').on('connect', socket => {
|
||||||
// TODO: off()
|
// TODO: off()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue