From f29350f33c8b08395d78f153bf22639a7776d005 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 11 Sep 2023 18:43:04 -0500 Subject: [PATCH] multi: Remove a bunch of dup words in comments. --- cmd/miner/cpuminer.go | 8 ++++---- gui/gui.go | 4 ++-- pool/chainstate.go | 10 +++++----- pool/hub.go | 2 +- pool/message.go | 13 ++++++------- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/cmd/miner/cpuminer.go b/cmd/miner/cpuminer.go index 53f190f1..4d077538 100644 --- a/cmd/miner/cpuminer.go +++ b/cmd/miner/cpuminer.go @@ -1,5 +1,5 @@ // Copyright (c) 2014-2016 The btcsuite developers -// Copyright (c) 2015-2021 The Decred developers +// Copyright (c) 2015-2023 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -185,9 +185,9 @@ func (m *CPUMiner) solveBlock(ctx context.Context, headerB []byte, target *big.R } } -// solve is the main work horse of generateblocks. It attempts to solve -// blocks while detecting when it is performing stale work. When a -// a block is solved it is sent via the work channel. +// solve is the main work horse of generateblocks. It attempts to solve blocks +// while detecting when it is performing stale work. When a block is solved it +// is sent via the work channel. func (m *CPUMiner) solve(ctx context.Context) { for { m.miner.workMtx.RLock() diff --git a/gui/gui.go b/gui/gui.go index 231009e3..aeeaee82 100644 --- a/gui/gui.go +++ b/gui/gui.go @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2021 The Decred developers +// Copyright (c) 2020-2023 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -86,7 +86,7 @@ type Config struct { FetchCacheChannel func() chan pool.CacheUpdateEvent } -// GUI represents the the mining pool user interface. +// GUI represents the mining pool user interface. type GUI struct { cfg *Config limiter *pool.RateLimiter diff --git a/pool/chainstate.go b/pool/chainstate.go index 26d4bca7..03ce5da4 100644 --- a/pool/chainstate.go +++ b/pool/chainstate.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 The Decred developers +// Copyright (c) 2021-2023 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -66,7 +66,7 @@ type ChainState struct { currentWorkMtx sync.RWMutex } -// NewChainState creates a a chain state. +// NewChainState creates a chain state. func NewChainState(sCfg *ChainStateConfig) *ChainState { return &ChainState{ cfg: sCfg, @@ -307,7 +307,7 @@ func (cs *ChainState) handleChainUpdates(ctx context.Context) { work, err := cs.cfg.db.fetchAcceptedWork(parentID) if err != nil { // If the parent of the connected block is not an accepted - // work of the the pool, ignore it. + // work of the pool, ignore it. if errors.Is(err, errs.ValueNotFound) { log.Tracef("Block #%d (%s) is not an accepted "+ "work of the pool", parentHeight, parentHash) @@ -434,7 +434,7 @@ func (cs *ChainState) handleChainUpdates(ctx context.Context) { } // If the parent of the disconnected block is not an accepted - // work of the the pool, ignore it. + // work of the pool, ignore it. } if confirmedWork != nil { @@ -462,7 +462,7 @@ func (cs *ChainState) handleChainUpdates(ctx context.Context) { work, err := cs.cfg.db.fetchAcceptedWork(id) if err != nil { // If the disconnected block is not an accepted - // work of the the pool, ignore it. + // work of the pool, ignore it. if errors.Is(err, errs.ValueNotFound) { close(msg.Done) continue diff --git a/pool/hub.go b/pool/hub.go index b9c1d2c9..cde39cae 100644 --- a/pool/hub.go +++ b/pool/hub.go @@ -38,7 +38,7 @@ import ( const ( // MaxReorgLimit is an estimated maximum chain reorganization limit. - // That is, it is highly improbable for the the chain to reorg beyond six + // That is, it is highly improbable for the chain to reorg beyond six // blocks from the chain tip. MaxReorgLimit = 6 diff --git a/pool/message.go b/pool/message.go index a5e4887f..ac786c5a 100644 --- a/pool/message.go +++ b/pool/message.go @@ -627,10 +627,9 @@ func GenerateSolvedBlockHeader(headerE string, extraNonce1E string, copy(headerEB[296:304], []byte(extraNonce2E)) // The Antiminer DR3 and DR5 return a 12-byte entraNonce comprised of the - // the extraNonce1 and extraNonce2 regardless of the extraNonce2Size - // specified in the mining.subscribe message. The nTime and nonce values - // submitted are big endian, they have to be reversed before block header - // reconstruction. + // extraNonce1 and extraNonce2 regardless of the extraNonce2Size specified + // in the mining.subscribe message. The nTime and nonce values submitted are + // big endian, they have to be reversed before block header reconstruction. case AntminerDR3, AntminerDR5: nTimeERev, err := hexReversed(nTimeE) if err != nil { @@ -667,9 +666,9 @@ func GenerateSolvedBlockHeader(headerE string, extraNonce1E string, // The Whatsminer D1 does not respect the extraNonce2Size specified in the // mining.subscribe response sent to it. The 8-byte extranonce submitted is - // is for the extraNonce1 and extraNonce2. The nTime and nonce values - // submitted are big endian, they have to be reversed to little endian - // before header reconstruction. + // for the extraNonce1 and extraNonce2. The nTime and nonce values submitted + // are big endian, they have to be reversed to little endian before header + // reconstruction. case WhatsminerD1: nTimeERev, err := hexReversed(nTimeE) if err != nil {