diff --git a/lib/lndclient/LndClient.ts b/lib/lndclient/LndClient.ts index df406b8ae..a86c4eca0 100644 --- a/lib/lndclient/LndClient.ts +++ b/lib/lndclient/LndClient.ts @@ -695,10 +695,12 @@ class LndClient extends SwapClient { let maxInbound = 0; let balance = 0; let inactiveBalance = 0; + let totalOutboundAmount = 0; channels.toObject().channelsList.forEach((channel) => { if (channel.active) { balance += channel.localBalance; const outbound = channel.localBalance - channel.localChanReserveSat; + totalOutboundAmount += outbound; if (maxOutbound < outbound) { maxOutbound = outbound; } @@ -714,7 +716,7 @@ class LndClient extends SwapClient { if (this._maxChannelOutboundAmount !== maxOutbound) { this._maxChannelOutboundAmount = maxOutbound; - this.logger.debug(`new channel outbound capacity: ${maxOutbound}`); + this.logger.debug(`new channel maximum outbound capacity: ${maxOutbound}`); } if (this._maxChannelInboundAmount !== maxInbound) { @@ -722,6 +724,11 @@ class LndClient extends SwapClient { this.logger.debug(`new channel inbound capacity: ${maxInbound}`); } + if (this._totalOutboundAmount !== totalOutboundAmount) { + this._totalOutboundAmount = totalOutboundAmount; + this.logger.debug(`new channel total outbound capacity: ${maxOutbound}`); + } + const pendingOpenBalance = pendingChannels.toObject().pendingOpenChannelsList. reduce((sum, pendingChannel) => sum + (pendingChannel.channel?.localBalance ?? 0), 0);