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:
yyforyongyu
2024-06-26 07:41:51 +08:00
parent d2e81a19fd
commit 819c15fa0b
4 changed files with 113 additions and 30 deletions

View File

@@ -146,6 +146,9 @@ func (i *htlcResolverTestContext) resolve() {
i.resolverResultChan = make(chan resolveResult, 1)
go func() {
err := i.resolver.Launch()
require.NoError(i.t, err)
nextResolver, err := i.resolver.Resolve()
i.resolverResultChan <- resolveResult{
nextResolver: nextResolver,