Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: unify the error handling methods that are different from the project style & use errors.New to replace fmt.Errorf with no parameters #9570

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion amp/shard_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package amp
import (
"crypto/rand"
"encoding/binary"
"errors"
"fmt"
"sync"

Expand Down Expand Up @@ -139,7 +140,7 @@ func (s *ShardTracker) CancelShard(pid uint64) error {

c, ok := s.shards[pid]
if !ok {
return fmt.Errorf("pid not found")
return errors.New("pid not found")
}
delete(s.shards, pid)

Expand Down
4 changes: 2 additions & 2 deletions amp/sharer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package amp

import (
"crypto/rand"
"fmt"
"errors"
)

// zeroShare is the all-zero 32-byte share.
Expand Down Expand Up @@ -97,7 +97,7 @@ func (s *SeedSharer) Root() Share {
func (s *SeedSharer) Split() (Sharer, Sharer, error) {
// We cannot split the zero-Sharer.
if s.curr == zeroShare {
return nil, nil, fmt.Errorf("cannot split zero-Sharer")
return nil, nil, errors.New("cannot split zero-Sharer")
}

shareLeft, shareRight, err := split(&s.curr)
Expand Down
5 changes: 2 additions & 3 deletions cmd/commands/chainrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import (
"bytes"
"fmt"
"strconv"

"github.com/btcsuite/btcd/chaincfg/chainhash"
Expand Down Expand Up @@ -80,7 +79,7 @@
blockHashString = args.First()

default:
return fmt.Errorf("hash argument missing")
return errors.New("hash argument missing")

Check failure on line 82 in cmd/commands/chainrpc_active.go

View workflow job for this annotation

GitHub Actions / check commits

undefined: errors
}

blockHash, err := chainhash.NewHashFromStr(blockHashString)
Expand Down Expand Up @@ -233,7 +232,7 @@
}

default:
return fmt.Errorf("block height argument missing")
return errors.New("block height argument missing")

Check failure on line 235 in cmd/commands/chainrpc_active.go

View workflow job for this annotation

GitHub Actions / check commits

undefined: errors
}

client, cleanUp := getChainClient(ctx)
Expand Down
4 changes: 2 additions & 2 deletions cmd/commands/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func actionDecorator(f func(*cli.Context) error) func(*cli.Context) error {
c.Command.Name == "changepassword" ||
c.Command.Name == "createwatchonly") {

return fmt.Errorf("Wallet is already unlocked")
return errors.New("Wallet is already unlocked")
}

// lnd might be active, but not possible to contact
Expand All @@ -277,7 +277,7 @@ func actionDecorator(f func(*cli.Context) error) func(*cli.Context) error {
// WalletUnlocker server active) and most likely this
// is because of an encrypted wallet.
if ok && s.Code() == codes.Unimplemented {
return fmt.Errorf("Wallet is encrypted. " +
return errors.New("Wallet is encrypted. " +
"Please unlock using 'lncli unlock', " +
"or set password using 'lncli create'" +
" if this is the first time starting " +
Expand Down
4 changes: 1 addition & 3 deletions cmd/commands/peersrpc_active.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package commands

import (
"fmt"

"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/peersrpc"
"github.com/urfave/cli"
Expand Down Expand Up @@ -147,7 +145,7 @@
}

if !change {
return fmt.Errorf("no changes for the node information " +
return errors.New("no changes for the node information " +

Check failure on line 148 in cmd/commands/peersrpc_active.go

View workflow job for this annotation

GitHub Actions / check commits

undefined: errors
"detected")
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/commands/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (e *profileEntry) cert() (*x509.CertPool, error) {

cp := x509.NewCertPool()
if !cp.AppendCertsFromPEM([]byte(e.TLSCert)) {
return nil, fmt.Errorf("credentials: failed to append " +
return nil, errors.New("credentials: failed to append " +
"certificate")
}
return cp, nil
Expand Down Expand Up @@ -140,7 +140,7 @@ func profileFromContext(ctx *cli.Context, store, skipMacaroons bool) (
for _, m := range ctx.GlobalStringSlice("metadata") {
pair := strings.Split(m, ":")
if len(pair) != 2 {
return nil, fmt.Errorf("invalid format for metadata " +
return nil, errors.New("invalid format for metadata " +
"flag; expected \"key:value\"")
}

Expand Down
6 changes: 3 additions & 3 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1930,7 +1930,7 @@ func parseRPCParams(cConfig *lncfg.Chain, nodeConfig interface{},

splitCookie := strings.Split(string(cookie), ":")
if len(splitCookie) != 2 {
return fmt.Errorf("cookie file has a wrong " +
return errors.New("cookie file has a wrong " +
"format")
}
conf.RPCUser = splitCookie[0]
Expand Down Expand Up @@ -1968,7 +1968,7 @@ func parseRPCParams(cConfig *lncfg.Chain, nodeConfig interface{},
// the RPC credentials from the configuration. So if lnd wasn't
// specified the parameters, then we won't be able to start.
if cConfig.SimNet {
return fmt.Errorf("rpcuser and rpcpass must be set to your " +
return errors.New("rpcuser and rpcpass must be set to your " +
"btcd node's RPC parameters for simnet mode")
}

Expand Down Expand Up @@ -2097,7 +2097,7 @@ func extractBtcdRPCParams(btcdConfigPath string) (string, string, error) {
}
userSubmatches := rpcUserRegexp.FindSubmatch(configContents)
if userSubmatches == nil {
return "", "", fmt.Errorf("unable to find rpcuser in config")
return "", "", errors.New("unable to find rpcuser in config")
}

// Similarly, we'll use another regular expression to find the set
Expand Down
6 changes: 3 additions & 3 deletions config_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (d *DefaultWalletImpl) ValidateMacaroon(ctx context.Context,
// Because the default implementation does not return any permissions,
// we shouldn't be registered as an external validator at all and this
// should never be invoked.
return fmt.Errorf("default implementation does not support external " +
return errors.New("default implementation does not support external " +
"macaroon validation")
}

Expand Down Expand Up @@ -376,7 +376,7 @@ func (d *DefaultWalletImpl) BuildWalletConfig(ctx context.Context,
if d.cfg.WalletUnlockPasswordFile != "" && !walletExists &&
!d.cfg.WalletUnlockAllowCreate {

return nil, nil, nil, fmt.Errorf("wallet unlock password file " +
return nil, nil, nil, errors.New("wallet unlock password file " +
"was specified but wallet does not exist; initialize " +
"the wallet before using auto unlocking")
}
Expand Down Expand Up @@ -1173,7 +1173,7 @@ func (d *DefaultDatabaseBuilder) BuildDatabase(
return nil, nil, err
}
if ripInvoices {
err = fmt.Errorf("invoices bucket tombstoned, please " +
err = errors.New("invoices bucket tombstoned, please " +
"switch back to native SQL")
d.logger.Error(err)

Expand Down
6 changes: 3 additions & 3 deletions fn/recv.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fn

import (
"fmt"
"errors"
"time"
)

Expand All @@ -14,7 +14,7 @@ func RecvOrTimeout[T any](c <-chan T, timeout time.Duration) (T, error) {

case <-time.After(timeout):
var zero T
return zero, fmt.Errorf("timeout hit")
return zero, errors.New("timeout hit")
}
}

Expand All @@ -33,6 +33,6 @@ func RecvResp[T any](r <-chan T, e <-chan error, q <-chan struct{}) (T, error) {
return noResp, err

case <-q:
return noResp, fmt.Errorf("quitting")
return noResp, errors.New("quitting")
}
}
5 changes: 3 additions & 2 deletions funding/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import (
"bytes"
"encoding/binary"
"errors"

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

other declaration of errors

Check failure on line 6 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

other declaration of errors
"fmt"
"io"
"sync"
Expand All @@ -18,7 +19,7 @@
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

errors redeclared in this block

Check failure on line 22 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

errors redeclared in this block
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/chanacceptor"
"github.com/lightningnetwork/lnd/channeldb"
Expand Down Expand Up @@ -1112,7 +1113,7 @@
channelState, shortChanID, err := f.getChannelOpeningState(
&channel.FundingOutpoint,
)
if err == channeldb.ErrChannelNotFound {
if errors.Is(err, channeldb.ErrChannelNotFound) {
// Channel not in fundingManager's opening database,
// meaning it was successfully announced to the
// network.
Expand Down Expand Up @@ -1326,7 +1327,7 @@
}

confChannel, err := f.waitForFundingWithTimeout(channel)
if err == ErrConfirmationTimeout {
if errors.Is(err, ErrConfirmationTimeout) {
return f.fundingTimeout(channel, pendingChanID)
} else if err != nil {
return fmt.Errorf("error waiting for funding "+
Expand Down Expand Up @@ -4405,7 +4406,7 @@
// channel announcement.
storedFwdingPolicy, err := f.getInitialForwardingPolicy(chanID)
if err != nil && !errors.Is(err, channeldb.ErrChannelNotFound) {
return nil, errors.Errorf("unable to generate channel "+

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 4409 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
"update announcement: %v", err)
}

Expand Down Expand Up @@ -4449,12 +4450,12 @@
}
sig, err := f.cfg.SignMessage(f.cfg.IDKeyLoc, chanUpdateMsg, true)
if err != nil {
return nil, errors.Errorf("unable to generate channel "+

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 4453 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
"update announcement signature: %v", err)
}
chanUpdateAnn.Signature, err = lnwire.NewSigFromSignature(sig)
if err != nil {
return nil, errors.Errorf("unable to generate channel "+

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 4458 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
"update announcement signature: %v", err)
}

Expand All @@ -4471,14 +4472,14 @@
}
nodeSig, err := f.cfg.SignMessage(f.cfg.IDKeyLoc, chanAnnMsg, true)
if err != nil {
return nil, errors.Errorf("unable to generate node "+

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 4475 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
"signature for channel announcement: %v", err)
}
bitcoinSig, err := f.cfg.SignMessage(
localFundingKey.KeyLocator, chanAnnMsg, true,
)
if err != nil {
return nil, errors.Errorf("unable to generate bitcoin "+

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 4482 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
"signature for node public key: %v", err)
}

Expand Down Expand Up @@ -5141,13 +5142,13 @@
nodeReservations, ok := f.activeReservations[peerIDKey]
if !ok {
// No reservations for this node.
return nil, errors.Errorf("no active reservations for peer(%x)",

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 5145 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
peerIDKey[:])
}

ctx, ok := nodeReservations[pendingChanID]
if !ok {
return nil, errors.Errorf("unknown channel (id: %x) for "+

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 5151 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
"peer(%x)", pendingChanID[:], peerIDKey[:])
}

Expand All @@ -5160,7 +5161,7 @@
}

if err := ctx.reservation.Cancel(); err != nil {
return nil, errors.Errorf("unable to cancel reservation: %v",

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind-notxindex, backend="bitcoind notxindex")

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (neutrino, backend=neutrino cover=1)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (bitcoind, backend=bitcoind cover=1)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / macOS itest

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / basic itests (btcd, backend=btcd cover=1)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / RPC and mobile compilation check

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres, backend=bitcoind dbbackend=postgres)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite, backend=bitcoind dbbackend=sqlite)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-etcd, backend=bitcoind dbbackend=etcd)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-sqlite-nativesql, backend=bitcoind dbbackend=sqlite nativesql=true)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-rpcpolling, backend="bitcoind rpcpolling")

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / itests (bitcoind-postgres-nativesql, backend=bitcoind dbbackend=postgres nativesql=true)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / windows itest

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_sqlite")

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_postgres")

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit tags="kvdb_etcd")

undefined: errors.Errorf

Check failure on line 5164 in funding/manager.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

undefined: errors.Errorf
err)
}

Expand Down
4 changes: 2 additions & 2 deletions graph/db/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ func (c *ChannelGraph) AddChannelEdge(edge *models.ChannelEdgeInfo,

// Silence ErrEdgeAlreadyExist so that the batch can
// succeed, but propagate the error via local state.
if err == ErrEdgeAlreadyExist {
if errors.Is(err, ErrEdgeAlreadyExist) {
alreadyExists = true
return nil
}
Expand Down Expand Up @@ -3493,7 +3493,7 @@ func (c *ChannelGraph) FetchChannelEdgesByID(chanID uint64) (
policy1 = nil
policy2 = nil
})
if err == ErrZombieEdge {
if errors.Is(err, ErrZombieEdge) {
return edgeInfo, nil, nil, err
}
if err != nil {
Expand Down
3 changes: 2 additions & 1 deletion lnrpc/websocket_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package lnrpc

import (
"bufio"
"errors"
"io"
"net/http"
"net/textproto"
Expand Down Expand Up @@ -500,7 +501,7 @@ func IsClosedConnError(err error) bool {
if err == nil {
return false
}
if err == http.ErrServerClosed {
if errors.Is(err, http.ErrServerClosed) {
return true
}

Expand Down
2 changes: 1 addition & 1 deletion peer/brontide.go
Original file line number Diff line number Diff line change
Expand Up @@ -4001,7 +4001,7 @@ func (p *Brontide) handleCloseMsg(msg *closeMsg) {
chanCloser, err := p.fetchActiveChanCloser(msg.cid)
if err != nil {
// If the channel is not known to us, we'll simply ignore this message.
if err == ErrChannelNotFound {
if errors.Is(err, ErrChannelNotFound) {
return
}

Expand Down
2 changes: 1 addition & 1 deletion pilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func validateAtplCfg(cfg *lncfg.AutoPilot) ([]*autopilot.WeightedHeuristic,
}

if sum != 1.0 {
return nil, fmt.Errorf("heuristic weights must sum to 1.0")
return nil, errors.New("heuristic weights must sum to 1.0")
}
return heuristics, nil
}
Expand Down
12 changes: 6 additions & 6 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ var (
// If the --no-macaroons flag is used to start lnd, the macaroon service
// is not initialized. errMacaroonDisabled is then returned when
// macaroon related services are used.
errMacaroonDisabled = fmt.Errorf("macaroon authentication disabled, " +
errMacaroonDisabled = errors.New("macaroon authentication disabled, " +
"remove --no-macaroons flag to enable")
)

Expand Down Expand Up @@ -1355,7 +1355,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
decodedAddr, _ := hex.DecodeString(in.Addr)
_, err = btcec.ParsePubKey(decodedAddr)
if err == nil {
return nil, fmt.Errorf("cannot send coins to pubkeys")
return nil, errors.New("cannot send coins to pubkeys")
}

label, err := labels.ValidateAPI(in.Label)
Expand Down Expand Up @@ -1385,7 +1385,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
}

if fn.HasDuplicates(wireOutpoints) {
return nil, fmt.Errorf("selected outpoints contain " +
return nil, errors.New("selected outpoints contain " +
"duplicate values")
}

Expand All @@ -1400,7 +1400,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
// At this point, the amount shouldn't be set since we've been
// instructed to sweep all the coins from the wallet.
if in.Amount != 0 {
return nil, fmt.Errorf("amount set while SendAll is " +
return nil, errors.New("amount set while SendAll is " +
"active")
}

Expand Down Expand Up @@ -1440,7 +1440,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
// If sending everything to this address would invalidate our
// reserved wallet balance, we create a new sweep tx, where
// we'll send the reserved value back to our wallet.
if err == lnwallet.ErrReservedValueInvalidated {
if errors.Is(err, lnwallet.ErrReservedValueInvalidated) {
sweepTxPkg.CancelSweepAttempt()

rpcsLog.Debugf("Reserved value %v not satisfied after "+
Expand Down Expand Up @@ -4348,7 +4348,7 @@ func (r *rpcServer) nurseryPopulateForceCloseResp(chanPoint *wire.OutPoint,
// didn't have any time-locked outputs, then the nursery may not know of
// the contract.
nurseryInfo, err := r.server.utxoNursery.NurseryReport(chanPoint)
if err == contractcourt.ErrContractNotFound {
if errors.Is(err, contractcourt.ErrContractNotFound) {
return nil
}
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"math/big"
prand "math/rand"
Expand Down Expand Up @@ -572,7 +573,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
if cfg.ProtocolOptions.TaprootOverlayChans &&
implCfg.AuxFundingController.IsNone() {

return nil, fmt.Errorf("taproot overlay flag set, but not " +
return nil, errors.New("taproot overlay flag set, but not " +
"aux controllers")
}

Expand Down Expand Up @@ -1428,7 +1429,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,

if ourPolicy == nil {
// Something is wrong, so return an error.
return nil, fmt.Errorf("we don't have an edge")
return nil, errors.New("we don't have an edge")
}

err = s.graphDB.DeleteChannelEdges(
Expand Down Expand Up @@ -4906,7 +4907,7 @@ func (s *server) DisconnectPeer(pubKey *btcec.PublicKey) error {
// exit in an error as we can't disconnect from a peer that we're not
// currently connected to.
peer, err := s.findPeerByPubStr(pubStr)
if err == ErrPeerNotConnected {
if errors.Is(err, ErrPeerNotConnected) {
return fmt.Errorf("peer %x is not connected", pubBytes)
}

Expand Down
Loading