lnwallet: in closeObserver if commitment is is ours, exit early

This commit is contained in:
Olaoluwa Osuntokun 2017-05-15 18:13:10 -07:00
parent d2585ae6e5
commit 80598dff11
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
1 changed files with 9 additions and 0 deletions

View File

@ -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