Skip to content

Commit

Permalink
multi: Remove a bunch of dup words in comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
davecgh authored and jholdstock committed Sep 12, 2023
1 parent 7ab7fb5 commit f29350f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
8 changes: 4 additions & 4 deletions cmd/miner/cpuminer.go
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions gui/gui.go
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions pool/chainstate.go
Original file line number Diff line number Diff line change
@@ -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.

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pool/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 6 additions & 7 deletions pool/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit f29350f

Please sign in to comment.