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
2019-11-06 13:16:50 +01:00
parent 75ecbfd321
commit ff63a680a1
11 changed files with 107 additions and 88 deletions

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
})