From 75ecbfd32190ef158c32a2df8a253d386c8d8312 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Wed, 6 Nov 2019 13:31:13 +0100 Subject: [PATCH] cnct: unexport ResolverKit quit field --- contractcourt/briefcase.go | 2 +- contractcourt/channel_arbitrator.go | 10 +++++----- contractcourt/commit_sweep_resolver.go | 10 +++++----- contractcourt/contract_resolvers.go | 2 +- contractcourt/htlc_incoming_contest_resolver.go | 6 +++--- contractcourt/htlc_outgoing_contest_resolver.go | 4 ++-- contractcourt/htlc_success_resolver.go | 6 +++--- contractcourt/htlc_timeout_resolver.go | 6 +++--- 8 files changed, 23 insertions(+), 23 deletions(-) diff --git a/contractcourt/briefcase.go b/contractcourt/briefcase.go index 466742a50..88a743ffe 100644 --- a/contractcourt/briefcase.go +++ b/contractcourt/briefcase.go @@ -516,7 +516,7 @@ func (b *boltArbitratorLog) FetchUnresolvedContracts() ([]ContractResolver, erro return fmt.Errorf("unknown resolver type: %v", resType) } - resKit.Quit = make(chan struct{}) + resKit.quit = make(chan struct{}) res.AttachResolverKit(resKit) contracts = append(contracts, res) return nil diff --git a/contractcourt/channel_arbitrator.go b/contractcourt/channel_arbitrator.go index 3bd669027..dec845ee8 100644 --- a/contractcourt/channel_arbitrator.go +++ b/contractcourt/channel_arbitrator.go @@ -1733,7 +1733,7 @@ func (c *ChannelArbitrator) prepContractResolutions( continue } - resKit.Quit = make(chan struct{}) + resKit.quit = make(chan struct{}) resolver := &htlcSuccessResolver{ htlcResolution: resolution, broadcastHeight: height, @@ -1761,7 +1761,7 @@ func (c *ChannelArbitrator) prepContractResolutions( continue } - resKit.Quit = make(chan struct{}) + resKit.quit = make(chan struct{}) resolver := &htlcTimeoutResolver{ htlcResolution: resolution, broadcastHeight: height, @@ -1798,7 +1798,7 @@ func (c *ChannelArbitrator) prepContractResolutions( ChanID: c.cfg.ShortChanID, } - resKit.Quit = make(chan struct{}) + resKit.quit = make(chan struct{}) resolver := &htlcIncomingContestResolver{ htlcExpiry: htlc.RefundTimeout, circuitKey: circuitKey, @@ -1831,7 +1831,7 @@ func (c *ChannelArbitrator) prepContractResolutions( continue } - resKit.Quit = make(chan struct{}) + resKit.quit = make(chan struct{}) resolver := &htlcOutgoingContestResolver{ htlcTimeoutResolver: htlcTimeoutResolver{ htlcResolution: resolution, @@ -1850,7 +1850,7 @@ func (c *ChannelArbitrator) prepContractResolutions( // a resolver to sweep our commitment output (but only if it wasn't // trimmed). if contractResolutions.CommitResolution != nil { - resKit.Quit = make(chan struct{}) + resKit.quit = make(chan struct{}) resolver := &commitSweepResolver{ commitResolution: *contractResolutions.CommitResolution, broadcastHeight: height, diff --git a/contractcourt/commit_sweep_resolver.go b/contractcourt/commit_sweep_resolver.go index 4e5712728..12d90fc59 100644 --- a/contractcourt/commit_sweep_resolver.go +++ b/contractcourt/commit_sweep_resolver.go @@ -80,7 +80,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) { return nil, errResolverShuttingDown } - case <-c.Quit: + case <-c.quit: return nil, errResolverShuttingDown } @@ -138,7 +138,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) { log.Infof("ChannelPoint(%v) commit tx is fully resolved by "+ "sweep tx: %v", c.chanPoint, sweepResult.Tx.TxHash()) - case <-c.Quit: + case <-c.quit: return nil, errResolverShuttingDown } @@ -180,7 +180,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) { log.Errorf("unable to Checkpoint: %v", err) return nil, err } - case <-c.Quit: + case <-c.quit: 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", c.chanPoint, confInfo.BlockHeight) - case <-c.Quit: + case <-c.quit: return nil, errResolverShuttingDown } @@ -221,7 +221,7 @@ func (c *commitSweepResolver) Resolve() (ContractResolver, error) { // // NOTE: Part of the ContractResolver interface. func (c *commitSweepResolver) Stop() { - close(c.Quit) + close(c.quit) } // IsResolved returns true if the stored state in the resolve is fully diff --git a/contractcourt/contract_resolvers.go b/contractcourt/contract_resolvers.go index d70f74e59..fc5b324da 100644 --- a/contractcourt/contract_resolvers.go +++ b/contractcourt/contract_resolvers.go @@ -77,7 +77,7 @@ type ResolverKit struct { // return a non-nil error upon success. Checkpoint func(ContractResolver) error - Quit chan struct{} + quit chan struct{} } var ( diff --git a/contractcourt/htlc_incoming_contest_resolver.go b/contractcourt/htlc_incoming_contest_resolver.go index 2f3348e6e..a9fdd78a2 100644 --- a/contractcourt/htlc_incoming_contest_resolver.go +++ b/contractcourt/htlc_incoming_contest_resolver.go @@ -68,7 +68,7 @@ func (h *htlcIncomingContestResolver) Resolve() (ContractResolver, error) { return nil, errResolverShuttingDown } currentHeight = newBlock.Height - case <-h.Quit: + case <-h.quit: return nil, errResolverShuttingDown } @@ -239,7 +239,7 @@ func (h *htlcIncomingContestResolver) Resolve() (ContractResolver, error) { return nil, h.Checkpoint(h) } - case <-h.Quit: + case <-h.quit: return nil, errResolverShuttingDown } } @@ -271,7 +271,7 @@ func (h *htlcIncomingContestResolver) report() *ContractReport { // // NOTE: Part of the ContractResolver interface. func (h *htlcIncomingContestResolver) Stop() { - close(h.Quit) + close(h.quit) } // IsResolved returns true if the stored state in the resolve is fully diff --git a/contractcourt/htlc_outgoing_contest_resolver.go b/contractcourt/htlc_outgoing_contest_resolver.go index 789558a67..ed092ccaf 100644 --- a/contractcourt/htlc_outgoing_contest_resolver.go +++ b/contractcourt/htlc_outgoing_contest_resolver.go @@ -130,7 +130,7 @@ func (h *htlcOutgoingContestResolver) Resolve() (ContractResolver, error) { // claimed. return h.claimCleanUp(commitSpend) - case <-h.Quit: + case <-h.quit: return nil, fmt.Errorf("resolver canceled") } } @@ -162,7 +162,7 @@ func (h *htlcOutgoingContestResolver) report() *ContractReport { // // NOTE: Part of the ContractResolver interface. func (h *htlcOutgoingContestResolver) Stop() { - close(h.Quit) + close(h.quit) } // IsResolved returns true if the stored state in the resolve is fully diff --git a/contractcourt/htlc_success_resolver.go b/contractcourt/htlc_success_resolver.go index d1c8716cb..6d6d58e23 100644 --- a/contractcourt/htlc_success_resolver.go +++ b/contractcourt/htlc_success_resolver.go @@ -173,7 +173,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) { return nil, errResolverShuttingDown } - case <-h.Quit: + case <-h.quit: return nil, errResolverShuttingDown } @@ -238,7 +238,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) { return nil, errResolverShuttingDown } - case <-h.Quit: + case <-h.quit: return nil, errResolverShuttingDown } @@ -251,7 +251,7 @@ func (h *htlcSuccessResolver) Resolve() (ContractResolver, error) { // // NOTE: Part of the ContractResolver interface. func (h *htlcSuccessResolver) Stop() { - close(h.Quit) + close(h.quit) } // IsResolved returns true if the stored state in the resolve is fully diff --git a/contractcourt/htlc_timeout_resolver.go b/contractcourt/htlc_timeout_resolver.go index 9d1c92d72..2907aea66 100644 --- a/contractcourt/htlc_timeout_resolver.go +++ b/contractcourt/htlc_timeout_resolver.go @@ -274,7 +274,7 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) { return errResolverShuttingDown } - case <-h.Quit: + case <-h.quit: return errResolverShuttingDown } @@ -312,7 +312,7 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) { return nil, errResolverShuttingDown } - case <-h.Quit: + case <-h.quit: return nil, errResolverShuttingDown } @@ -365,7 +365,7 @@ func (h *htlcTimeoutResolver) Resolve() (ContractResolver, error) { // // NOTE: Part of the ContractResolver interface. func (h *htlcTimeoutResolver) Stop() { - close(h.Quit) + close(h.quit) } // IsResolved returns true if the stored state in the resolve is fully