cnct: unexport ResolverKit quit field

This commit is contained in:
Joost Jager 2019-11-06 13:31:13 +01:00
parent ee14eaec5f
commit 75ecbfd321
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
8 changed files with 23 additions and 23 deletions

View File

@ -516,7 +516,7 @@ func (b *boltArbitratorLog) FetchUnresolvedContracts() ([]ContractResolver, erro
return fmt.Errorf("unknown resolver type: %v", resType) return fmt.Errorf("unknown resolver type: %v", resType)
} }
resKit.Quit = make(chan struct{}) resKit.quit = make(chan struct{})
res.AttachResolverKit(resKit) res.AttachResolverKit(resKit)
contracts = append(contracts, res) contracts = append(contracts, res)
return nil return nil

View File

@ -1733,7 +1733,7 @@ func (c *ChannelArbitrator) prepContractResolutions(
continue continue
} }
resKit.Quit = make(chan struct{}) resKit.quit = make(chan struct{})
resolver := &htlcSuccessResolver{ resolver := &htlcSuccessResolver{
htlcResolution: resolution, htlcResolution: resolution,
broadcastHeight: height, broadcastHeight: height,
@ -1761,7 +1761,7 @@ func (c *ChannelArbitrator) prepContractResolutions(
continue continue
} }
resKit.Quit = make(chan struct{}) resKit.quit = make(chan struct{})
resolver := &htlcTimeoutResolver{ resolver := &htlcTimeoutResolver{
htlcResolution: resolution, htlcResolution: resolution,
broadcastHeight: height, broadcastHeight: height,
@ -1798,7 +1798,7 @@ func (c *ChannelArbitrator) prepContractResolutions(
ChanID: c.cfg.ShortChanID, ChanID: c.cfg.ShortChanID,
} }
resKit.Quit = make(chan struct{}) resKit.quit = make(chan struct{})
resolver := &htlcIncomingContestResolver{ resolver := &htlcIncomingContestResolver{
htlcExpiry: htlc.RefundTimeout, htlcExpiry: htlc.RefundTimeout,
circuitKey: circuitKey, circuitKey: circuitKey,
@ -1831,7 +1831,7 @@ func (c *ChannelArbitrator) prepContractResolutions(
continue continue
} }
resKit.Quit = make(chan struct{}) resKit.quit = make(chan struct{})
resolver := &htlcOutgoingContestResolver{ resolver := &htlcOutgoingContestResolver{
htlcTimeoutResolver: htlcTimeoutResolver{ htlcTimeoutResolver: htlcTimeoutResolver{
htlcResolution: resolution, htlcResolution: resolution,
@ -1850,7 +1850,7 @@ func (c *ChannelArbitrator) prepContractResolutions(
// a resolver to sweep our commitment output (but only if it wasn't // a resolver to sweep our commitment output (but only if it wasn't
// trimmed). // trimmed).
if contractResolutions.CommitResolution != nil { if contractResolutions.CommitResolution != nil {
resKit.Quit = make(chan struct{}) resKit.quit = make(chan struct{})
resolver := &commitSweepResolver{ resolver := &commitSweepResolver{
commitResolution: *contractResolutions.CommitResolution, commitResolution: *contractResolutions.CommitResolution,
broadcastHeight: height, broadcastHeight: height,

View File

@ -80,7 +80,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
case <-c.Quit: case <-c.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -138,7 +138,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
log.Infof("ChannelPoint(%v) commit tx is fully resolved by "+ log.Infof("ChannelPoint(%v) commit tx is fully resolved by "+
"sweep tx: %v", c.chanPoint, sweepResult.Tx.TxHash()) "sweep tx: %v", c.chanPoint, sweepResult.Tx.TxHash())
case <-c.Quit: case <-c.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -180,7 +180,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
log.Errorf("unable to Checkpoint: %v", err) log.Errorf("unable to Checkpoint: %v", err)
return nil, err return nil, err
} }
case <-c.Quit: case <-c.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -206,7 +206,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
log.Infof("ChannelPoint(%v) commit tx is fully resolved, at height: %v", log.Infof("ChannelPoint(%v) commit tx is fully resolved, at height: %v",
c.chanPoint, confInfo.BlockHeight) c.chanPoint, confInfo.BlockHeight)
case <-c.Quit: case <-c.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -221,7 +221,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) {
// //
// NOTE: Part of the ContractResolver interface. // NOTE: Part of the ContractResolver interface.
func (c *commitSweepResolver) Stop() { func (c *commitSweepResolver) Stop() {
close(c.Quit) close(c.quit)
} }
// IsResolved returns true if the stored state in the resolve is fully // IsResolved returns true if the stored state in the resolve is fully

View File

@ -77,7 +77,7 @@ type ResolverKit struct {
// return a non-nil error upon success. // return a non-nil error upon success.
Checkpoint func(ContractResolver) error Checkpoint func(ContractResolver) error
Quit chan struct{} quit chan struct{}
} }
var ( var (

View File

@ -68,7 +68,7 @@ func (h *htlcIncomingContestResolver) Resolve() (ContractResolver, error) {
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
currentHeight = newBlock.Height currentHeight = newBlock.Height
case <-h.Quit: case <-h.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -239,7 +239,7 @@ func (h *htlcIncomingContestResolver) Resolve() (ContractResolver, error) {
return nil, h.Checkpoint(h) return nil, h.Checkpoint(h)
} }
case <-h.Quit: case <-h.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
} }
@ -271,7 +271,7 @@ func (h *htlcIncomingContestResolver) report() *ContractReport {
// //
// NOTE: Part of the ContractResolver interface. // NOTE: Part of the ContractResolver interface.
func (h *htlcIncomingContestResolver) Stop() { func (h *htlcIncomingContestResolver) Stop() {
close(h.Quit) close(h.quit)
} }
// IsResolved returns true if the stored state in the resolve is fully // IsResolved returns true if the stored state in the resolve is fully

View File

@ -130,7 +130,7 @@ func (h *htlcOutgoingContestResolver) Resolve() (ContractResolver, error) {
// claimed. // claimed.
return h.claimCleanUp(commitSpend) return h.claimCleanUp(commitSpend)
case <-h.Quit: case <-h.quit:
return nil, fmt.Errorf("resolver canceled") return nil, fmt.Errorf("resolver canceled")
} }
} }
@ -162,7 +162,7 @@ func (h *htlcOutgoingContestResolver) report() *ContractReport {
// //
// NOTE: Part of the ContractResolver interface. // NOTE: Part of the ContractResolver interface.
func (h *htlcOutgoingContestResolver) Stop() { func (h *htlcOutgoingContestResolver) Stop() {
close(h.Quit) close(h.quit)
} }
// IsResolved returns true if the stored state in the resolve is fully // IsResolved returns true if the stored state in the resolve is fully

View File

@ -173,7 +173,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) {
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
case <-h.Quit: case <-h.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -238,7 +238,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) {
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
case <-h.Quit: case <-h.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -251,7 +251,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) {
// //
// NOTE: Part of the ContractResolver interface. // NOTE: Part of the ContractResolver interface.
func (h *htlcSuccessResolver) Stop() { func (h *htlcSuccessResolver) Stop() {
close(h.Quit) close(h.quit)
} }
// IsResolved returns true if the stored state in the resolve is fully // IsResolved returns true if the stored state in the resolve is fully

View File

@ -274,7 +274,7 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) {
return errResolverShuttingDown return errResolverShuttingDown
} }
case <-h.Quit: case <-h.quit:
return errResolverShuttingDown return errResolverShuttingDown
} }
@ -312,7 +312,7 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) {
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
case <-h.Quit: case <-h.quit:
return nil, errResolverShuttingDown return nil, errResolverShuttingDown
} }
@ -365,7 +365,7 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) {
// //
// NOTE: Part of the ContractResolver interface. // NOTE: Part of the ContractResolver interface.
func (h *htlcTimeoutResolver) Stop() { func (h *htlcTimeoutResolver) Stop() {
close(h.Quit) close(h.quit)
} }
// IsResolved returns true if the stored state in the resolve is fully // IsResolved returns true if the stored state in the resolve is fully