Commit Graph

52 Commits

Author SHA1 Message Date
Olaoluwa Osuntokun
62f951a969
contractcourt: extend the chainWatcher to be able to detect co-op closes
In this commit, we extend the chainWatcher to be able to automatically
detect co-op closes of the channel. With this change, it’s now fully
encompassed so able to detect all types of closes on-chain. We detect a
co-op close due to the sequence number being finalized, as well as
paying to us directly in a regular p2wkh-like output.
2018-01-22 19:19:52 -08:00
Olaoluwa Osuntokun
0e14ac2063
contractcourt: add new chainWatcher struct
In this commit, we add a new struct to the package, the chainWatcher.
The duty of this struct is to replace the functionality that was
previously implemented by the closeObserver of each channel. Rather
than the source of notification being tied to the lifetime of a
particular object, it’s now delegated to a persistent object that will
be around for the entire lifetime of the channel (until it’s closed).
This will serve to greatly simplify the code, and eliminate a large
class of bugs.
2018-01-22 19:19:48 -08:00