contractcourt/channel_arbitrator: handle breach channel at startup

Earlier the channel arbitrator would fail to recognize channels pending
close that were in the breached state. This lead to the state machine
not progressing correctly, and in some cases crashing since we would
attempt to force close an already closed channel.

A test TestChannelArbitratorForceCloseBreachedChannel is added to
exercise one of these scenarios.
This commit is contained in:
Johan T. Halseth
2019-09-17 10:29:36 +02:00
parent 26b7ec1b94
commit ce9f7faff2
2 changed files with 120 additions and 0 deletions

View File

@@ -357,6 +357,9 @@ func (c *ChannelArbitrator) Start() error {
case channeldb.CooperativeClose:
trigger = coopCloseTrigger
case channeldb.BreachClose:
trigger = breachCloseTrigger
case channeldb.LocalForceClose:
trigger = localCloseTrigger