Merge pull request #197 from shocknet/fix/backup-stream
fix function name, more log fix
This commit is contained in:
commit
330bb58e92
2 changed files with 24 additions and 3 deletions
|
|
@ -654,7 +654,7 @@ module.exports = async (
|
|||
'Channel backup LND locked, new registration in 60 seconds'
|
||||
)
|
||||
process.nextTick(() =>
|
||||
setTimeout(() => onNewTransaction(socket, subID), 60000)
|
||||
setTimeout(() => onNewChannelBackup(), 60000)
|
||||
)
|
||||
break
|
||||
}
|
||||
|
|
@ -668,10 +668,13 @@ module.exports = async (
|
|||
'Channel backup LND disconnected, sockets reconnecting in 30 seconds...'
|
||||
)
|
||||
process.nextTick(() =>
|
||||
setTimeout(() => onNewTransaction(socket, subID), 30000)
|
||||
setTimeout(() => onNewChannelBackup(), 30000)
|
||||
)
|
||||
break
|
||||
}
|
||||
default: {
|
||||
logger.error('[event:transaction:new] UNKNOWN LND error')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,6 +134,12 @@ module.exports = (
|
|||
logger.info('[event:invoice:new] stream ok')
|
||||
break
|
||||
}
|
||||
case 1: {
|
||||
logger.info(
|
||||
'[event:invoice:new] stream canceled, probably socket disconnected'
|
||||
)
|
||||
break
|
||||
}
|
||||
case 2: {
|
||||
logger.warn('[event:invoice:new] got UNKNOWN error status')
|
||||
break
|
||||
|
|
@ -161,6 +167,9 @@ module.exports = (
|
|||
)
|
||||
break
|
||||
}
|
||||
default: {
|
||||
logger.error('[event:invoice:new] UNKNOWN LND error')
|
||||
}
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
|
|
@ -184,12 +193,18 @@ module.exports = (
|
|||
logger.error('New transactions stream error:' + subID, err)
|
||||
})
|
||||
stream.on('status', status => {
|
||||
logger.error('New transactions stream status:' + subID, status)
|
||||
logger.info('New transactions stream status:' + subID, status)
|
||||
switch (status.code) {
|
||||
case 0: {
|
||||
logger.info('[event:transaction:new] stream ok')
|
||||
break
|
||||
}
|
||||
case 1: {
|
||||
logger.info(
|
||||
'[event:transaction:new] stream canceled, probably socket disconnected'
|
||||
)
|
||||
break
|
||||
}
|
||||
case 2: {
|
||||
//Happens to fire when the grpc client lose access to macaroon file
|
||||
logger.warn('[event:transaction:new] got UNKNOWN error status')
|
||||
|
|
@ -218,6 +233,9 @@ module.exports = (
|
|||
)
|
||||
break
|
||||
}
|
||||
default: {
|
||||
logger.error('[event:transaction:new] UNKNOWN LND error')
|
||||
}
|
||||
}
|
||||
})
|
||||
return () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue