From 7da2080a3dfbe0ca74ff9408f29e6006c0cf05d0 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 21 Apr 2021 17:37:50 -0400 Subject: [PATCH] lnwallet: use tail() instead of tip() in getUnsignedAckedUpdates The previous behavior would allow updates to be overwritten in some scenarios. Upon restart, this would lead to a missing settle/fail in the update logs. --- lnwallet/channel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 23518bfd..9e8c5410 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -3260,7 +3260,7 @@ func (lc *LightningChannel) getUnsignedAckedUpdates() []channeldb.LogUpdate { chanID := lnwire.NewChanIDFromOutPoint(&lc.channelState.FundingOutpoint) // Fetch the last remote update that we have signed for. - lastRemoteCommitted := lc.remoteCommitChain.tip().theirMessageIndex + lastRemoteCommitted := lc.remoteCommitChain.tail().theirMessageIndex // Fetch the last remote update that we have acked. lastLocalCommitted := lc.localCommitChain.tail().theirMessageIndex