fix: small channel report fix

This commit is contained in:
AP 2020-01-23 07:43:47 +01:00
parent 13006ac3e3
commit 53365e47f1

View File

@ -25,6 +25,10 @@ export const getChannelReport = {
try { try {
const channels: GetChannelsProps = await getChannels({ lnd }); const channels: GetChannelsProps = await getChannels({ lnd });
if (channels.channels.length <= 0) {
return;
}
const maxOutgoing = Math.max.apply( const maxOutgoing = Math.max.apply(
Math, Math,
channels.channels.map(o => { channels.channels.map(o => {
@ -53,7 +57,7 @@ export const getChannelReport = {
maxOut: maxOutgoing, maxOut: maxOutgoing,
}; };
} catch (error) { } catch (error) {
logger.error('Error getting channel fees: %o', error); logger.error('Error getting channel report: %o', error);
throw new Error(getErrorMsg(error)); throw new Error(getErrorMsg(error));
} }
}, },