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:
Johan T. Halseth
2020-11-18 22:45:35 +01:00
parent acc45934f8
commit 743ea7be74
3 changed files with 131 additions and 77 deletions

View File

@@ -1485,7 +1485,7 @@ func TestBalanceAtHeight(t *testing.T) {
targetHeight: unknownHeight,
expectedLocalBalance: 0,
expectedRemoteBalance: 0,
expectedError: errLogEntryNotFound,
expectedError: ErrLogEntryNotFound,
},
{
name: "height not reached",