lnd.xprv/contractcourt
Johan T. Halseth 75df58c68b
contractcourt: move responsibility for closing force closes to chanArb
This commit moves the responsibility for closing local and remote force
closes in the database from the chain watcher to the channel arbitrator.

We do this because we previously would close the channel in the
database, before sending the event to the channel arbitrator. This could
lead to a situation where the channel was marked closed, but the channel
arbitrator didn't receive the event before shutdown. As we don't listen
for chain events for channels that are closed, those channels would be
stuck in the pending close state forever, as the channel arbitrator
state machine wouldn't progress.

We fix this by letting the ChannelArbitrator close the channel in the
database. After the contract resolutions are logged (in the state
callback before transitioning to StateContractClosed) we mark the
channel closed in the database. This way we make sure that it is marked
closed only if the resolutions have been successfully persisted.
2018-08-23 00:03:21 +02:00
..
briefcase_test.go multi: sort import paths with gofmt 2018-08-02 18:20:49 -07:00
briefcase.go multi: sort import paths with gofmt 2018-08-02 18:20:49 -07:00
chain_arbitrator_test.go contractcourt: add new ChainArbitrator struct as central coordinator of package 2018-01-22 19:19:36 -08:00
chain_arbitrator.go contractcourt/[channel|chain]_arbitrator: define MarkChannelClosed 2018-08-22 23:51:04 +02:00
chain_watcher_test.go multi: update to latest RegisterBlockEpochNtfn interface 2018-08-10 01:08:57 -07:00
chain_watcher.go contractcourt: move responsibility for closing force closes to chanArb 2018-08-23 00:03:21 +02:00
channel_arbitrator_test.go contractcourt: move responsibility for closing force closes to chanArb 2018-08-23 00:03:21 +02:00
channel_arbitrator.go contractcourt: move responsibility for closing force closes to chanArb 2018-08-23 00:03:21 +02:00
contract_resolvers_test.go contractcourt: add complete ContractResolver implementations 2018-01-22 19:19:36 -08:00
contract_resolvers.go contractcourt/contract_resolvers: correct off-by-one HTLC expiry 2018-08-14 09:15:48 +02:00
log.go contractcourt: create new package, add logger 2018-01-22 19:19:34 -08:00