Skip to content

Commit

Permalink
[lbry] ci: fixed various lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
roylee17 committed May 24, 2022
1 parent 2648505 commit 0aa0d21
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 22 deletions.
3 changes: 2 additions & 1 deletion blockchain/checkpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ func (b *BlockChain) findPreviousCheckpoint() (*blockNode, error) {
func isNonstandardTransaction(tx *btcutil.Tx) bool {
// Check all of the output public key scripts for non-standard scripts.
for _, txOut := range tx.MsgTx().TxOut {
scriptClass := txscript.GetScriptClass(txOut.PkScript)
stripped := txscript.StripClaimScriptPrefix(txOut.PkScript)
scriptClass := txscript.GetScriptClass(stripped)
if scriptClass == txscript.NonStandardTy {
return true
}
Expand Down
5 changes: 1 addition & 4 deletions blockchain/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,7 @@ func withinLevelBounds(reduction int64, lv int64) bool {
return false
}
reduction++
if ((reduction*reduction + reduction) >> 1) <= lv {
return false
}
return true
return ((reduction*reduction + reduction) >> 1) > lv
}

// CheckTransactionSanity performs some preliminary checks on a transaction to
Expand Down
1 change: 1 addition & 0 deletions btcec/genprecomps.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// This file is ignored during the regular build due to the following build tag.
// It is called by go generate and used to automatically generate pre-computed
// tables used to accelerate operations.
//go:build ignore
// +build ignore

package main
Expand Down
1 change: 1 addition & 0 deletions btcec/gensecp256k1.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// This file is ignored during the regular build due to the following build tag.
// This build tag is set during go generate.
//go:build gensecp256k1
// +build gensecp256k1

package btcec
Expand Down
2 changes: 1 addition & 1 deletion btcec/precompute.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strings"
)

//go:generate go run -tags gensecp256k1 genprecomps.go
//go:rm -f gensecp256k1.go; generate go run -tags gensecp256k1 genprecomps.go

// loadS256BytePoints decompresses and deserializes the pre-computed byte points
// used to accelerate scalar base multiplication for the secp256k1 curve. This
Expand Down
14 changes: 7 additions & 7 deletions database/ffldb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ import (
"sort"
"sync"

"github.com/btcsuite/goleveldb/leveldb"
"github.com/btcsuite/goleveldb/leveldb/comparer"
ldberrors "github.com/btcsuite/goleveldb/leveldb/errors"
"github.com/btcsuite/goleveldb/leveldb/filter"
"github.com/btcsuite/goleveldb/leveldb/iterator"
"github.com/btcsuite/goleveldb/leveldb/opt"
"github.com/btcsuite/goleveldb/leveldb/util"
"github.com/lbryio/lbcd/chaincfg/chainhash"
"github.com/lbryio/lbcd/database"
"github.com/lbryio/lbcd/database/internal/treap"
"github.com/lbryio/lbcd/wire"
btcutil "github.com/lbryio/lbcutil"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/comparer"
ldberrors "github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syndtr/goleveldb/leveldb/filter"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/syndtr/goleveldb/leveldb/util"
)

const (
Expand Down
6 changes: 3 additions & 3 deletions database/ffldb/dbcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"sync"
"time"

"github.com/btcsuite/goleveldb/leveldb"
"github.com/btcsuite/goleveldb/leveldb/iterator"
"github.com/btcsuite/goleveldb/leveldb/util"
"github.com/lbryio/lbcd/database/internal/treap"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/util"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions database/ffldb/ldbtreapiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
package ffldb

import (
"github.com/btcsuite/goleveldb/leveldb/iterator"
"github.com/btcsuite/goleveldb/leveldb/util"
"github.com/lbryio/lbcd/database/internal/treap"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/util"
)

// ldbTreapIter wraps a treap iterator to provide the additional functionality
Expand Down
4 changes: 2 additions & 2 deletions database/ffldb/whitebox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
"path/filepath"
"testing"

"github.com/btcsuite/goleveldb/leveldb"
ldberrors "github.com/btcsuite/goleveldb/leveldb/errors"
"github.com/lbryio/lbcd/database"
"github.com/lbryio/lbcd/wire"
btcutil "github.com/lbryio/lbcutil"
"github.com/syndtr/goleveldb/leveldb"
ldberrors "github.com/syndtr/goleveldb/leveldb/errors"
)

var (
Expand Down
1 change: 1 addition & 0 deletions limits/limits_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

//go:build !windows && !plan9
// +build !windows,!plan9

package limits
Expand Down
1 change: 1 addition & 0 deletions signalsigterm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
// +build darwin dragonfly freebsd linux netbsd openbsd solaris

package main
Expand Down
4 changes: 2 additions & 2 deletions upnp.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func Discover() (nat NAT, err error) {
return
}
err = errors.New("UPnP port discovery failed")
return
return nat, err
}

// service represents the Service type in an UPnP xml description.
Expand Down Expand Up @@ -269,7 +269,7 @@ func getServiceURL(rootURL string) (url string, err error) {
return
}
url = combineURL(rootURL, d.ControlURL)
return
return url, err
}

// combineURL appends subURL onto rootURL.
Expand Down

0 comments on commit 0aa0d21

Please sign in to comment.