mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-12 07:08:24 +01:00
contractcourt/chain_watcher: handleKnownRemoteState
Similar to what we did for the local state handling, we extract handling all known remote states we can act on (breach, current, pending state) into its own method. Since we want to handle the case where we lost state (both in case of local and remote close) last, we don't rely on the remote state number to check which commit we are looking at, but match on TXIDs directly.
This commit is contained in:
@@ -163,9 +163,9 @@ var (
|
||||
// channel.
|
||||
ErrChanBorked = fmt.Errorf("cannot mutate borked channel")
|
||||
|
||||
// errLogEntryNotFound is returned when we cannot find a log entry at
|
||||
// ErrLogEntryNotFound is returned when we cannot find a log entry at
|
||||
// the height requested in the revocation log.
|
||||
errLogEntryNotFound = fmt.Errorf("log entry not found")
|
||||
ErrLogEntryNotFound = fmt.Errorf("log entry not found")
|
||||
|
||||
// errHeightNotFound is returned when a query for channel balances at
|
||||
// a height that we have not reached yet is made.
|
||||
@@ -3469,7 +3469,7 @@ func fetchChannelLogEntry(log kvdb.RBucket,
|
||||
logEntrykey := makeLogKey(updateNum)
|
||||
commitBytes := log.Get(logEntrykey[:])
|
||||
if commitBytes == nil {
|
||||
return ChannelCommitment{}, errLogEntryNotFound
|
||||
return ChannelCommitment{}, ErrLogEntryNotFound
|
||||
}
|
||||
|
||||
commitReader := bytes.NewReader(commitBytes)
|
||||
|
||||
Reference in New Issue
Block a user