lnwallet: when handling possible channel breach, only log if contract breach

This commit is contained in:
Olaoluwa Osuntokun 2017-07-30 12:50:39 -07:00
parent e56258917e
commit 4c9bd9dc54
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -1157,12 +1157,6 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven
} }
lc.RUnlock() lc.RUnlock()
lc.Lock()
defer lc.Unlock()
walletLog.Warnf("Unprompted commitment broadcast for ChannelPoint(%v) "+
"detected!", lc.channelState.ChanID)
// Otherwise, the remote party might have broadcast a prior revoked // Otherwise, the remote party might have broadcast a prior revoked
// state...!!! // state...!!!
commitTxBroadcast := commitSpend.SpendingTx commitTxBroadcast := commitSpend.SpendingTx
@ -1176,6 +1170,12 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven
return return
} }
lc.Lock()
defer lc.Unlock()
walletLog.Warnf("Unprompted commitment broadcast for ChannelPoint(%v) "+
"detected!", lc.channelState.FundingOutpoint)
// Decode the state hint encoded within the commitment transaction to // Decode the state hint encoded within the commitment transaction to
// determine if this is a revoked state or not. // determine if this is a revoked state or not.
obsfucator := lc.stateHintObsfucator obsfucator := lc.stateHintObsfucator
@ -1203,6 +1203,7 @@ func (lc *LightningChannel) closeObserver(channelCloseNtfn *chainntnfs.SpendEven
// As we've detected that the channel has been closed, // As we've detected that the channel has been closed,
// immediately delete the state from disk, creating a close // immediately delete the state from disk, creating a close
// summary for future usage by related sub-systems. // summary for future usage by related sub-systems.
//
// TODO(roasbeef): include HTLC's // TODO(roasbeef): include HTLC's
// * and time-locked balance, NEED TO??? // * and time-locked balance, NEED TO???
closeSummary := channeldb.ChannelCloseSummary{ closeSummary := channeldb.ChannelCloseSummary{