From 83b368d20eb41c5967a93ba16e1dbd0381df3704 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Tue, 16 Jan 2018 21:19:04 +0100 Subject: [PATCH] lnwallet/channel: use remoteACKedIndex instead of logIndex in availableBalance --- lnwallet/channel.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 23f383b8..6c2b8712 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -4948,7 +4948,8 @@ func (lc *LightningChannel) availableBalance() (lnwire.MilliSatoshi, int64) { // Next we'll grab the current set of log updates that are still active // and haven't been garbage collected. - htlcView := lc.fetchHTLCView(lc.remoteUpdateLog.logIndex, + remoteACKedIndex := lc.localCommitChain.tip().theirMessageIndex + htlcView := lc.fetchHTLCView(remoteACKedIndex, lc.localUpdateLog.logIndex) feePerKw := lc.channelState.LocalCommitment.FeePerKw dustLimit := lc.channelState.LocalChanCfg.DustLimit