mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
contractcourt: break launchResolvers
into two steps
In this commit, we break the old `launchResolvers` into two steps - step one is to launch the resolvers synchronously, and step two is to actually waiting for the resolvers to be resolved. This is critical as in the following commit we will require the resolvers to be launched at the same blockbeat when a force close event is sent by the chain watcher.
This commit is contained in:
@@ -37,6 +37,17 @@ type ContractResolver interface {
|
||||
// resides within.
|
||||
ResolverKey() []byte
|
||||
|
||||
// Launch starts the resolver by constructing an input and offering it
|
||||
// to the sweeper. Once offered, it's expected to monitor the sweeping
|
||||
// result in a goroutine invoked by calling Resolve.
|
||||
//
|
||||
// NOTE: We can call `Resolve` inside a goroutine at the end of this
|
||||
// method to avoid calling it in the ChannelArbitrator. However, there
|
||||
// are some DB-related operations such as SwapContract/ResolveContract
|
||||
// which need to be done inside the resolvers instead, which needs a
|
||||
// deeper refactoring.
|
||||
Launch() error
|
||||
|
||||
// Resolve instructs the contract resolver to resolve the output
|
||||
// on-chain. Once the output has been *fully* resolved, the function
|
||||
// should return immediately with a nil ContractResolver value for the
|
||||
|
Reference in New Issue
Block a user