mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
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. |
||
---|---|---|
.. | ||
briefcase.go | ||
briefcase_test.go | ||
chain_arbitrator.go | ||
chain_arbitrator_test.go | ||
chain_watcher.go | ||
chain_watcher_test.go | ||
channel_arbitrator.go | ||
channel_arbitrator_test.go | ||
contract_resolvers.go | ||
contract_resolvers_test.go | ||
log.go |