From 80598dff11afe8a335054bf97912d5fe9b4f5a84 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 15 May 2017 18:13:10 -0700 Subject: [PATCH] lnwallet: in closeObserver if commitment is is ours, exit early --- lnwallet/channel.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 627f0677..6b570211 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -983,6 +983,15 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven // state...!!! commitTxBroadcast := commitSpend.SpendingTx + // If this is our commitment transaction, then we can exit here as we + // don't have any further processing we need to do (we can't cheat + // ourselves :p). + commitmentHash := lc.channelState.OurCommitTx.TxHash() + isOurCommitment := commitSpend.SpenderTxHash.IsEqual(&commitmentHash) + if isOurCommitment { + return + } + // Decode the state hint encoded within the commitment transaction to // determine if this is a revoked state or not. obsfucator := lc.channelState.StateHintObsfucator