Skip to content

Commit 6402932

Browse files
jholdstockdavecgh
authored andcommitted
multi: Fix godoc comment var/func names.
Ensure the godoc comment for all exported (and some private) funcs and vars have the correct names.
1 parent 396e54a commit 6402932

20 files changed

Lines changed: 65 additions & 66 deletions

File tree

blockchain/fullblocktests/error.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2022 The Decred developers
1+
// Copyright (c) 2022-2026 The Decred developers
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44

@@ -205,8 +205,8 @@ const (
205205
// have a valid missed sstx input as per the stake ticket database.
206206
ErrInvalidSSRtx = ErrorKind("ErrInvalidSSRtx")
207207

208-
// ErrInvalidRevNum indicates that the number of revocations from the header
209-
// was not the same as the number of SSRtx included in the block.
208+
// ErrRevocationsMismatch indicates that the number of revocations from the
209+
// header was not the same as the number of SSRtx included in the block.
210210
ErrRevocationsMismatch = ErrorKind("ErrRevocationsMismatch")
211211

212212
// ErrTicketCommitment indicates that a ticket commitment contains an amount
@@ -218,7 +218,7 @@ const (
218218
// commitments.
219219
ErrBadNumPayees = ErrorKind("ErrBadNumPayees")
220220

221-
// ErrBadPayeeScriptType indicates that either a vote or revocation
221+
// ErrMismatchedPayeeHash indicates that either a vote or revocation
222222
// transaction output that corresponds to a ticket commitment does not pay
223223
// to the hash required by the commitment.
224224
ErrMismatchedPayeeHash = ErrorKind("ErrMismatchedPayeeHash")

blockchain/stake/error.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2014 Conformal Systems LLC.
2-
// Copyright (c) 2015-2021 The Decred developers
2+
// Copyright (c) 2015-2026 The Decred developers
33
// Use of this source code is governed by an ISC
44
// license that can be found in the LICENSE file.
55

@@ -23,15 +23,15 @@ const (
2323
// ErrSStxNoOutputs indicates that a given SStx has no outputs.
2424
ErrSStxNoOutputs = ErrorKind("ErrSStxNoOutputs")
2525

26-
// ErrSStxInvalidInput indicates that an invalid output has been used as
27-
// an input for a SStx; only non-SStx tagged outputs may be used to
28-
// purchase stake tickets.
26+
// ErrSStxInvalidInputs indicates that an invalid output has been used as an
27+
// input for a SStx; only non-SStx tagged outputs may be used to purchase
28+
// stake tickets.
2929
// TODO: Add this into validate
3030
// Ensure that all inputs are not tagged SStx outputs of some sort,
3131
// along with checks to make sure they exist and are available.
3232
ErrSStxInvalidInputs = ErrorKind("ErrSStxInvalidInputs")
3333

34-
// ErrSStxInvalidOutput indicates that the output for an SStx tx is
34+
// ErrSStxInvalidOutputs indicates that the output for an SStx tx is
3535
// invalid; in particular, either the output was not tagged SStx or the
3636
// OP_RETURNs were missing or contained invalid addresses.
3737
ErrSStxInvalidOutputs = ErrorKind("ErrSStxInvalidOutputs")
@@ -79,8 +79,8 @@ const (
7979
// included as the first output.
8080
ErrSSGenNoReference = ErrorKind("ErrSSGenNoReference")
8181

82-
// ErrSSGenNoReference indicates that the OP_RETURN included as the
83-
// first output was corrupted in some way.
82+
// ErrSSGenBadReference indicates that the OP_RETURN included as the first
83+
// output was corrupted in some way.
8484
ErrSSGenBadReference = ErrorKind("ErrSSGenBadReference")
8585

8686
// ErrSSGenNoVotePush indicates that there is no vote bits OP_RETURN

blockchain/stake/internal/ticketdb/error.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015-2021 The Decred developers
1+
// Copyright (c) 2015-2026 The Decred developers
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44

@@ -15,8 +15,8 @@ const (
1515
// was took small.
1616
ErrUndoDataShortRead = ErrorKind("ErrUndoDataShortRead")
1717

18-
// ErrUndoDataNoEntries indicates that the data for undoing ticket data
19-
// in a serialized entry was corrupt.
18+
// ErrUndoDataCorrupt indicates that the data for undoing ticket data in a
19+
// serialized entry was corrupt.
2020
ErrUndoDataCorrupt = ErrorKind("ErrUndoDataCorrupt")
2121

2222
// ErrTicketHashesShortRead indicates that the given ticket hashes

config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2013-2016 The btcsuite developers
2-
// Copyright (c) 2015-2024 The Decred developers
2+
// Copyright (c) 2015-2026 The Decred developers
33
// Use of this source code is governed by an ISC
44
// license that can be found in the LICENSE file.
55

@@ -463,8 +463,9 @@ func newConfigParser(cfg *config, so *serviceOptions, options flags.Options) *fl
463463
return parser
464464
}
465465

466-
// createDefaultConfig copies the file sample-dcrd.conf to the given destination path,
467-
// and populates it with some randomly generated RPC username and password.
466+
// createDefaultConfigFile copies the file sample-dcrd.conf to the given
467+
// destination path, and populates it with some randomly generated RPC username
468+
// and password.
468469
func createDefaultConfigFile(destPath string, authType string) error {
469470
// Create the destination directory if it does not exist.
470471
err := os.MkdirAll(filepath.Dir(destPath), 0700)

crypto/rand/default.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 The Decred developers
1+
// Copyright (c) 2024-2026 The Decred developers
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44

@@ -147,8 +147,7 @@ func ShuffleSlice[S ~[]E, E any](s S) {
147147
})
148148
}
149149

150-
// Int returns a uniform random value in [0,max).
151-
// Panics if max <= 0.
150+
// BigInt returns a uniform random value in [0,max). Panics if max <= 0.
152151
func BigInt(max *big.Int) *big.Int {
153152
globalRand.Lock()
154153
defer globalRand.Unlock()

crypto/rand/uniform.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2024 The Decred developers
1+
// Copyright (c) 2024-2026 The Decred developers
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44
//
@@ -228,8 +228,7 @@ func (p *PRNG) Shuffle(n int, swap func(i, j int)) {
228228
}
229229
}
230230

231-
// Int returns a uniform random value in [0,max).
232-
// Panics if max <= 0.
231+
// BigInt returns a uniform random value in [0,max). Panics if max <= 0.
233232
func (p *PRNG) BigInt(max *big.Int) *big.Int {
234233
// Will never error with our reader.
235234
n, _ := rand.Int(p, max)

database/driver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2015-2016 The btcsuite developers
2-
// Copyright (c) 2016-2020 The Decred developers
2+
// Copyright (c) 2016-2026 The Decred developers
33
// Use of this source code is governed by an ISC
44
// license that can be found in the LICENSE file.
55

@@ -32,7 +32,7 @@ type Driver struct {
3232
UseLogger func(logger slog.Logger)
3333
}
3434

35-
// driverList holds all of the registered database backends.
35+
// drivers holds all of the registered database backends.
3636
var drivers = make(map[string]*Driver)
3737

3838
// RegisterDriver adds a backend database driver to available interfaces.

gcs/blockcf2/blockcf.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019-2022 The Decred developers
1+
// Copyright (c) 2019-2026 The Decred developers
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44

@@ -146,9 +146,9 @@ type commitmentConverter struct {
146146
allScripts []byte
147147
}
148148

149-
// commitmentToPaymentScript converts a commitment output script of a ticket
150-
// purchase to either a pay-to-pubkey-hash or a pay-to-script-hash script
151-
// according to the commitment.
149+
// paymentScript converts a commitment output script of a ticket purchase to
150+
// either a pay-to-pubkey-hash or a pay-to-script-hash script according to the
151+
// commitment.
152152
func (c *commitmentConverter) paymentScript(commitmentScript []byte) []byte {
153153
commitmentHash := extractTicketCommitHash(commitmentScript)
154154
if isTicketCommitP2SH(commitmentScript) {

internal/blockchain/error.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2014-2016 The btcsuite developers
2-
// Copyright (c) 2015-2023 The Decred developers
2+
// Copyright (c) 2015-2026 The Decred developers
33
// Use of this source code is governed by an ISC
44
// license that can be found in the LICENSE file.
55

@@ -300,7 +300,7 @@ const (
300300
// have a valid missed sstx input as per the stake ticket database.
301301
ErrInvalidSSRtx = ErrorKind("ErrInvalidSSRtx")
302302

303-
// ErrInvalidRevNum indicates that the number of revocations from the
303+
// ErrRevocationsMismatch indicates that the number of revocations from the
304304
// header was not the same as the number of SSRtx included in the block.
305305
ErrRevocationsMismatch = ErrorKind("ErrRevocationsMismatch")
306306

@@ -331,7 +331,7 @@ const (
331331
// to the same script type required by the commitment.
332332
ErrBadPayeeScriptType = ErrorKind("ErrBadPayeeScriptType")
333333

334-
// ErrBadPayeeScriptType indicates that either a vote or revocation
334+
// ErrMismatchedPayeeHash indicates that either a vote or revocation
335335
// transaction output that corresponds to a ticket commitment does not pay
336336
// to the hash required by the commitment.
337337
ErrMismatchedPayeeHash = ErrorKind("ErrMismatchedPayeeHash")

internal/blockchain/mediantime.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2013-2014 The btcsuite developers
2-
// Copyright (c) 2015-2016 The Decred developers
2+
// Copyright (c) 2015-2026 The Decred developers
33
// Use of this source code is governed by an ISC
44
// license that can be found in the LICENSE file.
55

@@ -13,9 +13,9 @@ import (
1313
)
1414

1515
const (
16-
// maxAllowedOffsetSeconds is the maximum number of seconds in either
17-
// direction that local clock will be adjusted. When the median time
18-
// of the network is outside of this range, no offset will be applied.
16+
// maxAllowedOffsetSecs is the maximum number of seconds in either direction
17+
// that local clock will be adjusted. When the median time of the network
18+
// is outside of this range, no offset will be applied.
1919
maxAllowedOffsetSecs = 70 * 60 // 1 hour 10 minutes
2020

2121
// similarTimeSecs is the number of seconds in either direction from the

0 commit comments

Comments
 (0)