mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
contractcourt: add new ChannelArbitrator struct
In this commit, we add the primary struct of the package with a full implementation. The duty of the ChannelArbitrator is to watch the set of active contracts on a comment transaction and act accordingly if any of their redemption criteria have been met. Potential criteria include: an HTLC about to time out, and HTLC about to time out that we know the preiamge to, or the remote party going to chain (forcing us to resolve all pending contracts on chain). The primary goroutine of this struct implements a persistent state machine in order to ensure that mid contract resolution, we’re able to properly survive restarts without losing our place, or forgetting about a pending contract. A ChannelArbitrator will stay alive until all contracts have been fully resolved. This means that outside sub-systems no longer need to worry about remembering to mark a channel as fully resolved, as it’s the job of the ChannelArbitrator to do this task.
This commit is contained in:
parent
71009438b6
commit
d64ffcb6c8
1514
contractcourt/channel_arbitrator.go
Normal file
1514
contractcourt/channel_arbitrator.go
Normal file
File diff suppressed because it is too large
Load Diff
1
contractcourt/channel_arbitrator_test.go
Normal file
1
contractcourt/channel_arbitrator_test.go
Normal file
@ -0,0 +1 @@
|
||||
package contractcourt
|
Loading…
Reference in New Issue
Block a user