cnct: instantiate quit channels inside resolvers

Removes a bug-prone construction that existed previously where the quit
channel was replaced just-in-time.
This commit is contained in:
Joost Jager committed 2019-11-07 13:10:35 +01:00
1 parent 75ecbfd321
commit ff63a680a1
11 files changed
+107 -88

No files matched your search

+2 -3
View File
@@ -440,7 +440,7 @@ func (b *boltArbitratorLog) CommitState(s ArbitratorState) error {
//
// NOTE: Part of the ContractResolver interface.
func (b *boltArbitratorLog) FetchUnresolvedContracts() ([]ContractResolver, error) {
resKit := ResolverKit{
resolverCfg := ResolverConfig{
ChannelArbitratorConfig: b.cfg,
Checkpoint: b.checkpointContract,
}
@@ -516,8 +516,7 @@ func (b *boltArbitratorLog) FetchUnresolvedContracts() ([]ContractResolver, erro
return fmt.Errorf("unknown resolver type: %v", resType)
}
resKit.quit = make(chan struct{})
res.AttachResolverKit(resKit)
res.AttachConfig(resolverCfg)
contracts = append(contracts, res)
return nil
})