Skip to content

Commit

Permalink
multi: Address some linter complaints.
Browse files Browse the repository at this point in the history
  • Loading branch information
davecgh committed Jul 24, 2023
1 parent 488b816 commit 93c5b39
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion internal/blockchain/agendas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestFixedSequenceLocks(t *testing.T) {
// ---------------------------------------------------------------------
// Create block that involves reorganize to a sequence lock spending
// from an output created in a block prior to the parent also spent on
// on the side chain.
// the side chain.
//
// ... -> b0 -> b1 -> b2
// \-> b1a
Expand Down
4 changes: 2 additions & 2 deletions internal/blockchain/indexers/common.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016 The btcsuite developers
// Copyright (c) 2016-2022 The Decred developers
// Copyright (c) 2016-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 @@ -603,7 +603,7 @@ func maybeNotifySubscribers(ctx context.Context, indexer Indexer) error {
bestHeight, bestHash := indexer.Queryer().Best()
tipHeight, tipHash, err := indexer.Tip()
if err != nil {
return fmt.Errorf("%s: unable to fetch index tip: %v",
return fmt.Errorf("%s: unable to fetch index tip: %w",
indexer.Name(), err)
}

Expand Down
4 changes: 2 additions & 2 deletions internal/blockchain/indexers/dropcfindex.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2017 The btcsuite developers
// Copyright (c) 2018-2020 The Decred developers
// Copyright (c) 2018-2023 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

Expand All @@ -23,7 +23,7 @@ var (
)

// DropCfIndex drops the CF index from the provided database if it exists.
func DropCfIndex(ctx context.Context, db database.DB) error {
func DropCfIndex(_ context.Context, db database.DB) error {
// Nothing to do if the index doesn't already exist.
exists, err := existsIndex(db, cfIndexParentBucketKey)
if err != nil {
Expand Down
8 changes: 2 additions & 6 deletions internal/blockchain/indexers/existsaddrindex.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016-2022 The Decred developers
// Copyright (c) 2016-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 @@ -193,11 +193,7 @@ func (idx *ExistsAddrIndex) Init(ctx context.Context, chainParams *chaincfg.Para

// Recover the exists address index and its dependents to the main
// chain if needed.
if err := recoverIndex(ctx, idx); err != nil {
return err
}

return nil
return recoverIndex(ctx, idx)
}

// Key returns the database key to use for the index as a byte slice.
Expand Down
3 changes: 1 addition & 2 deletions internal/blockchain/indexers/indexsubscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ func newIndexSubscription(subber *IndexSubscriber, indexer Indexer, prereq strin
//
// This must be called with the index subscriber mutex held for writes.
func (s *IndexSubscription) stop() error {

// If the subscription has a prerequisite, find it and remove the
// subscription as a dependency.
if s.prerequisite != noPrereqs {
Expand Down Expand Up @@ -247,7 +246,7 @@ func (s *IndexSubscriber) findLowestIndexTipHeight(queryer ChainQueryer) (int64,
// from after the lowest index tip to the current main chain tip.
//
// This should be called after all indexes have subscribed for updates.
func (s *IndexSubscriber) CatchUp(ctx context.Context, db database.DB, queryer ChainQueryer) error {
func (s *IndexSubscriber) CatchUp(ctx context.Context, _ database.DB, queryer ChainQueryer) error {
lowestHeight, bestHeight, err := s.findLowestIndexTipHeight(queryer)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions internal/blockchain/indexers/txindex.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2016 The btcsuite developers
// Copyright (c) 2016-2022 The Decred developers
// Copyright (c) 2016-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 @@ -371,7 +371,7 @@ func (idx *TxIndex) Init(ctx context.Context, chainParams *chaincfg.Params) erro
// below.
var highestKnown, nextUnknown uint32
testBlockID := uint32(1)
increment := uint32(100000)
const increment = uint32(100000)
for {
_, err := dbFetchBlockHashByID(dbTx, testBlockID)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions internal/blockchain/indexers/txindex_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2021-2022 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 @@ -113,7 +113,7 @@ func (tc *testChain) Best() (int64, *chainhash.Hash) {
}

// IsTreasuryAgendaActive returns whether or not the treasury agenda is active.
func (tc *testChain) IsTreasuryAgendaActive(hash *chainhash.Hash) (bool, error) {
func (tc *testChain) IsTreasuryAgendaActive(_ *chainhash.Hash) (bool, error) {
return tc.treasuryActive, nil
}

Expand Down

0 comments on commit 93c5b39

Please sign in to comment.