Merge pull request #138 from starius/update-lnd-v0.18.0-beta

update dependencies (LND v0.18.0-beta and co)
This commit is contained in:
Oliver Gugger 2024-06-18 10:56:39 -06:00 committed by GitHub
commit d173f8ca1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 1198 additions and 798 deletions

View file

@ -16,7 +16,7 @@ env:
# go needs absolute directories, using the $HOME variable doesn't work here.
GOCACHE: /home/runner/work/go/pkg/build
GOPATH: /home/runner/work/go
GO_VERSION: 1.21.3
GO_VERSION: 1.22.3
jobs:
########################

View file

@ -1,6 +1,6 @@
run:
# timeout for analysis
deadline: 4m
timeout: 4m
linters-settings:
govet:
@ -12,7 +12,7 @@ linters-settings:
whitespace:
multi-func: true
multi-if: true
tagliatelle:
tagliatelle:
case:
rules:
json: snake
@ -31,17 +31,15 @@ linters:
- gochecknoglobals
- gosec
- funlen
- maligned
- varnamelen
- wrapcheck
- testpackage
- gomnd
- goerr113
- err113
- exhaustruct
- forbidigo
- gocognit
- nestif
- ifshort
- wsl
- cyclop
- gocyclo
@ -53,16 +51,9 @@ linters:
- noctx
- gofumpt
- exhaustive
# deprecated
- interfacer
- scopelint
- golint
- exhaustivestruct
- nosnakecase
- deadcode
- structcheck
- varcheck
- protogetter
- depguard
- mnd
issues:
exclude-rules:

View file

@ -39,7 +39,7 @@ $ sudo mv chantools-*/chantools /usr/local/bin/
If there isn't a pre-built binary for your operating system or architecture
available or you want to build `chantools` from source for another reason, you
need to make sure you have `go 1.21.x` (or later) and `make` installed and can
need to make sure you have `go 1.22.3` (or later) and `make` installed and can
then run the following commands:
```bash
@ -519,4 +519,4 @@ Legend:
[discussions]: https://github.com/lightningnetwork/lnd/discussions
[zombie-recovery]: doc/zombierecovery.md
[zombie-recovery]: doc/zombierecovery.md

View file

@ -3,8 +3,8 @@
package bip39
import (
"fmt"
"hash/crc32"
"strconv"
"strings"
)
@ -14,7 +14,7 @@ func init() { //nolint:gochecknoinits
// $ crc32 english.txt
// c1dbd296
checksum := crc32.ChecksumIEEE([]byte(english))
if fmt.Sprintf("%x", checksum) != "c1dbd296" {
if strconv.FormatUint(uint64(checksum), 16) != "c1dbd296" {
panic("english checksum invalid")
}
}

View file

@ -25,9 +25,9 @@ const (
type KeyExporter interface {
Header() string
Format(*hdkeychain.ExtendedKey, *chaincfg.Params, string, uint32,
uint32) (string, error)
Trailer(uint32) string
Format(hdKey *hdkeychain.ExtendedKey, params *chaincfg.Params,
path string, branch, index uint32) (string, error)
Trailer(birthdayBlock uint32) string
}
// ParseFormat parses the given format name and returns its associated print
@ -67,7 +67,7 @@ func ExportKeys(extendedKey *hdkeychain.ExtendedKey, strPaths []string,
path := paths[idx]
// External branch first (<DerivationPath>/0/i).
for i := uint32(0); i < recoveryWindow; i++ {
for i := range recoveryWindow {
path := append(path, 0, i)
derivedKey, err := lnd.DeriveChildren(extendedKey, path)
if err != nil {
@ -83,7 +83,7 @@ func ExportKeys(extendedKey *hdkeychain.ExtendedKey, strPaths []string,
}
// Now the internal branch (<DerivationPath>/1/i).
for i := uint32(0); i < recoveryWindow; i++ {
for i := range recoveryWindow {
path := append(path, 1, i)
derivedKey, err := lnd.DeriveChildren(extendedKey, path)
if err != nil {
@ -254,7 +254,7 @@ func (p *Electrum) Header() string {
}
func (p *Electrum) Format(hdKey *hdkeychain.ExtendedKey,
params *chaincfg.Params, path string, branch, index uint32) (string,
params *chaincfg.Params, path string, _, _ uint32) (string,
error) {
privKey, err := hdKey.ECPrivKey()
@ -285,7 +285,7 @@ func (d *Descriptors) Header() string {
}
func (d *Descriptors) Format(hdKey *hdkeychain.ExtendedKey,
params *chaincfg.Params, path string, branch, index uint32) (string,
params *chaincfg.Params, _ string, _, _ uint32) (string,
error) {
privKey, err := hdKey.ECPrivKey()

View file

@ -19,7 +19,7 @@ func descriptorSumPolymod(symbols []uint64) uint64 {
for _, value := range symbols {
top := chk >> 35
chk = (chk&0x7ffffffff)<<5 ^ value
for i := 0; i < 5; i++ {
for i := range 5 {
if (top>>i)&1 != 0 {
chk ^= generator[i]
}
@ -57,7 +57,7 @@ func DescriptorSumCreate(s string) string {
symbols := append(descriptorSumExpand(s), 0, 0, 0, 0, 0, 0, 0, 0)
checksum := descriptorSumPolymod(symbols) ^ 1
builder := strings.Builder{}
for i := 0; i < 8; i++ {
for i := range 8 {
builder.WriteByte(checksumCharset[(checksum>>(5*(7-i)))&31])
}
return s + "#" + builder.String()

View file

@ -103,7 +103,7 @@ func (a *ExplorerAPI) Outpoint(addr string) (*TX, int, error) {
}
}
return nil, 0, fmt.Errorf("no tx found")
return nil, 0, errors.New("no tx found")
}
func (a *ExplorerAPI) Spends(addr string) ([]*TX, error) {
@ -193,7 +193,7 @@ func (a *ExplorerAPI) Address(outpoint string) (string, error) {
}
func (a *ExplorerAPI) PublishTx(rawTxHex string) (string, error) {
url := fmt.Sprintf("%s/tx", a.BaseURL)
url := a.BaseURL + "/tx"
resp, err := http.Post(url, "text/plain", strings.NewReader(rawTxHex))
if err != nil {
return "", fmt.Errorf("error posting data to API '%s', "+

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/lightninglabs/chantools/lnd"
@ -50,12 +51,12 @@ func (c *chanBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a backup file.
if c.MultiFile == "" {
return fmt.Errorf("backup file is required")
return errors.New("backup file is required")
}
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, true)
if err != nil {

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -292,7 +293,7 @@ func closePoolAccount(extendedKey *hdkeychain.ExtendedKey, apiURL string,
signDesc.SignMethod = input.TaprootScriptSpendSignMethod
}
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
// Add our sweep destination output.
sweepTx.TxOut = []*wire.TxOut{{
@ -367,7 +368,7 @@ func bruteForceAccountScript(accountBaseKey *hdkeychain.ExtendedKey,
maxNumBatchKeys uint32, targetScript []byte) (*poolAccount, error) {
// The outermost loop is over the possible accounts.
for i := uint32(0); i < maxNumAccounts; i++ {
for i := range maxNumAccounts {
accountExtendedKey, err := accountBaseKey.DeriveNonStandard(i)
if err != nil {
return nil, fmt.Errorf("error deriving account key: "+
@ -430,7 +431,7 @@ func bruteForceAccountScript(accountBaseKey *hdkeychain.ExtendedKey,
log.Debugf("Tried account index %d of %d", i, maxNumAccounts)
}
return nil, fmt.Errorf("account script not derived")
return nil, errors.New("account script not derived")
}
func fastScript(keyIndex, expiryFrom, expiryTo uint32, traderKey, auctioneerKey,
@ -442,7 +443,7 @@ func fastScript(keyIndex, expiryFrom, expiryTo uint32, traderKey, auctioneerKey,
return nil, err
}
if script.Class() != txscript.WitnessV0ScriptHashTy {
return nil, fmt.Errorf("incompatible script class")
return nil, errors.New("incompatible script class")
}
traderKeyTweak := poolscript.TraderKeyTweak(batchKey, secret, traderKey)
@ -492,7 +493,7 @@ func fastScript(keyIndex, expiryFrom, expiryTo uint32, traderKey, auctioneerKey,
}, nil
}
return nil, fmt.Errorf("account script not derived")
return nil, errors.New("account script not derived")
}
func fastScriptTaproot(scriptVersion poolscript.Version, keyIndex, expiryFrom,
@ -504,7 +505,7 @@ func fastScriptTaproot(scriptVersion poolscript.Version, keyIndex, expiryFrom,
return nil, err
}
if parsedScript.Class() != txscript.WitnessV1TaprootTy {
return nil, fmt.Errorf("incompatible script class")
return nil, errors.New("incompatible script class")
}
traderKeyTweak := poolscript.TraderKeyTweak(batchKey, secret, traderKey)
@ -601,5 +602,5 @@ func fastScriptTaproot(scriptVersion poolscript.Version, keyIndex, expiryFrom,
}, nil
}
return nil, fmt.Errorf("account script not derived")
return nil, errors.New("account script not derived")
}

View file

@ -70,8 +70,6 @@ func TestClosePoolAccount(t *testing.T) {
)
for _, tc := range testAccounts {
tc := tc
t.Run(tc.name, func(tt *testing.T) {
tt.Parallel()

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/coreos/bbolt"
@ -52,10 +53,10 @@ to create a copy of it to a destination file, compacting it in the process.`,
func (c *compactDBCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a source and destination channel DB.
if c.SourceDB == "" {
return fmt.Errorf("source channel DB is required")
return errors.New("source channel DB is required")
}
if c.DestDB == "" {
return fmt.Errorf("destination channel DB is required")
return errors.New("destination channel DB is required")
}
if c.TxMaxSize <= 0 {
c.TxMaxSize = defaultTxMaxSize

View file

@ -2,6 +2,7 @@ package main
import (
"bytes"
"errors"
"fmt"
"os"
"strings"
@ -63,7 +64,7 @@ func (c *createWalletCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a wallet DB.
if c.WalletDBDir == "" {
return fmt.Errorf("wallet DB directory is required")
return errors.New("wallet DB directory is required")
}
// Make sure the directory (and parents) exists.
@ -143,7 +144,7 @@ func (c *createWalletCommand) Execute(_ *cobra.Command, _ []string) error {
}
if !bytes.Equal(pw, pw2) {
return fmt.Errorf("passwords don't match")
return errors.New("passwords don't match")
}
if len(pw) > 0 {

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/lightninglabs/chantools/lnd"
@ -45,7 +46,7 @@ run lnd ` + lndVersion + ` or later after using this command!'`,
func (c *deletePaymentsCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, false)
if err != nil {

View file

@ -10,7 +10,7 @@ func newDocCommand() *cobra.Command {
Use: "doc",
Short: "Generate the markdown documentation of all commands",
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
return doc.GenMarkdownTree(rootCmd, "./doc")
},
}

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"strconv"
@ -96,7 +97,7 @@ func (c *doubleSpendInputs) Execute(_ *cobra.Command, _ []string) error {
// Make sure we have at least one input.
if len(c.InputOutpoints) == 0 {
return fmt.Errorf("inputoutpoints are required")
return errors.New("inputoutpoints are required")
}
api := newExplorerAPI(c.APIURL)
@ -226,7 +227,7 @@ func (c *doubleSpendInputs) Execute(_ *cobra.Command, _ []string) error {
// Calculate the fee.
feeRateKWeight := chainfee.SatPerKVByte(1000 * c.FeeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
// Create the transaction.
tx := wire.NewMsgTx(2)
@ -308,7 +309,7 @@ func (c *doubleSpendInputs) Execute(_ *cobra.Command, _ []string) error {
func iterateOverPath(baseKey *hdkeychain.ExtendedKey, addr btcutil.Address,
path []uint32, maxTries uint32) (*hdkeychain.ExtendedKey, error) {
for i := uint32(0); i < maxTries; i++ {
for i := range maxTries {
// Check for both the external and internal branch.
for _, branch := range []uint32{0, 1} {
// Create the path to derive the key.

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"time"
@ -12,6 +13,7 @@ import (
"github.com/lightninglabs/chantools/lnd"
"github.com/lightningnetwork/lnd/chainreg"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/channeldb/models"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/spf13/cobra"
@ -81,7 +83,7 @@ chantools dropchannelgraph \
func (c *dropChannelGraphCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, false)
if err != nil {
@ -90,7 +92,7 @@ func (c *dropChannelGraphCommand) Execute(_ *cobra.Command, _ []string) error {
defer func() { _ = db.Close() }()
if c.NodeIdentityKey == "" {
return fmt.Errorf("node identity key is required")
return errors.New("node identity key is required")
}
idKeyBytes, err := hex.DecodeString(c.NodeIdentityKey)
@ -174,8 +176,8 @@ func newChanAnnouncement(localPubKey, remotePubKey *btcec.PublicKey,
localFundingKey *keychain.KeyDescriptor,
remoteFundingKey *btcec.PublicKey, shortChanID lnwire.ShortChannelID,
fwdMinHTLC, fwdMaxHTLC lnwire.MilliSatoshi, capacity btcutil.Amount,
channelPoint wire.OutPoint) (*channeldb.ChannelEdgeInfo,
*channeldb.ChannelEdgePolicy, error) {
channelPoint wire.OutPoint) (*models.ChannelEdgeInfo,
*models.ChannelEdgePolicy, error) {
chainHash := *chainParams.GenesisHash
@ -226,7 +228,7 @@ func newChanAnnouncement(localPubKey, remotePubKey *btcec.PublicKey,
return nil, nil, err
}
edge := &channeldb.ChannelEdgeInfo{
edge := &models.ChannelEdgeInfo{
ChannelID: chanAnn.ShortChannelID.ToUint64(),
ChainHash: chanAnn.ChainHash,
NodeKey1Bytes: chanAnn.NodeID1,
@ -264,7 +266,7 @@ func newChanAnnouncement(localPubKey, remotePubKey *btcec.PublicKey,
FeeRate: uint32(chainreg.DefaultBitcoinFeeRate),
}
update := &channeldb.ChannelEdgePolicy{
update := &models.ChannelEdgePolicy{
SigBytes: chanUpdateAnn.Signature.ToSignatureBytes(),
ChannelID: chanAnn.ShortChannelID.ToUint64(),
LastUpdate: time.Now(),

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/lightninglabs/chantools/lnd"
@ -52,7 +53,7 @@ run lnd ` + lndVersion + ` or later after using this command!'`,
func (c *dropGraphZombiesCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, false)
if err != nil {

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/davecgh/go-spew/spew"
@ -47,7 +48,7 @@ func (c *dumpBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a backup file.
if c.MultiFile == "" {
return fmt.Errorf("backup file is required")
return errors.New("backup file is required")
}
multiFile := chanbackup.NewMultiFile(c.MultiFile)
keyRing := &lnd.HDKeyRing{

View file

@ -55,7 +55,7 @@ given lnd channel.db gile in a human readable format.`,
func (c *dumpChannelsCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, true)
if err != nil {
@ -67,7 +67,7 @@ func (c *dumpChannelsCommand) Execute(_ *cobra.Command, _ []string) error {
(c.Pending && c.WaitingClose) ||
(c.Closed && c.Pending && c.WaitingClose) {
return fmt.Errorf("can only specify one flag at a time")
return errors.New("can only specify one flag at a time")
}
if c.Closed {

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"net"
@ -156,7 +157,7 @@ func (c *fakeChanBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Now parse the remote node info.
splitNodeInfo := strings.Split(c.NodeAddr, "@")
if len(splitNodeInfo) != 2 {
return fmt.Errorf("--remote_node_addr expected in format: " +
return errors.New("--remote_node_addr expected in format: " +
"pubkey@host:port")
}
pubKeyBytes, err := hex.DecodeString(splitNodeInfo[0])
@ -192,7 +193,7 @@ func (c *fakeChanBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Parse the short channel ID.
splitChanID := strings.Split(c.ShortChanID, "x")
if len(splitChanID) != 3 {
return fmt.Errorf("--short_channel_id expected in format: " +
return errors.New("--short_channel_id expected in format: " +
"<blockheight>x<transactionindex>x<outputindex>",
)
}
@ -216,7 +217,7 @@ func (c *fakeChanBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Is the outpoint and/or short channel ID correct?
if uint32(chanOutputIdx) != chanOp.Index {
return fmt.Errorf("output index of --short_channel_id must " +
return errors.New("output index of --short_channel_id must " +
"be equal to index on --channelpoint")
}

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"os"
"strings"
@ -59,7 +60,7 @@ func (c *filterBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a backup file.
if c.MultiFile == "" {
return fmt.Errorf("backup file is required")
return errors.New("backup file is required")
}
multiFile := chanbackup.NewMultiFile(c.MultiFile)
keyRing := &lnd.HDKeyRing{

View file

@ -53,7 +53,7 @@ func (c *fixOldBackupCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a backup file.
if c.MultiFile == "" {
return fmt.Errorf("backup file is required")
return errors.New("backup file is required")
}
multiFile := chanbackup.NewMultiFile(c.MultiFile)
keyRing := &lnd.HDKeyRing{

View file

@ -4,6 +4,7 @@ import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@ -79,7 +80,7 @@ func (c *forceCloseCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("rescue DB is required")
return errors.New("rescue DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, true)
if err != nil {

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"os"
"time"
@ -145,7 +146,7 @@ func (c *genImportScriptCommand) Execute(_ *cobra.Command, _ []string) error {
paths = [][]uint32{derivationPath}
case c.LndPaths && c.DerivationPath != "":
return fmt.Errorf("cannot use --lndpaths and --derivationpath " +
return errors.New("cannot use --lndpaths and --derivationpath " +
"at the same time")
case c.LndPaths:

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/lightninglabs/chantools/lnd"
@ -41,7 +42,7 @@ run lnd ` + lndVersion + ` or later after using this command!'`,
func (c *migrateDBCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, false)
if err != nil {

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"math"
@ -87,10 +88,10 @@ func (c *pullAnchorCommand) Execute(_ *cobra.Command, _ []string) error {
// Make sure all input is provided.
if c.SponsorInput == "" {
return fmt.Errorf("sponsor input is required")
return errors.New("sponsor input is required")
}
if len(c.AnchorAddrs) == 0 {
return fmt.Errorf("at least one anchor addr is required")
return errors.New("at least one anchor addr is required")
}
for _, anchorAddr := range c.AnchorAddrs {
err = lnd.CheckAddress(
@ -216,7 +217,7 @@ func createPullTransactionTemplate(rootKey *hdkeychain.ExtendedKey,
anchorAmt := uint64(len(anchorAddrs)) * 330
totalOutputValue := btcutil.Amount(sponsorTxOut.Value + anchorAmt)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
log.Infof("Fee %d sats of %d total amount (estimated weight %d)",
totalFee, totalOutputValue, estimator.Weight())
@ -430,7 +431,7 @@ func findAnchorKey(rootKey *hdkeychain.ExtendedKey,
// Loop through the local multisig keys to find the target anchor
// script.
for index := uint32(0); index < math.MaxInt16; index++ {
for index := range uint32(math.MaxInt16) {
currentKey, err := localMultisig.DeriveNonStandard(index)
if err != nil {
return nil, nil, fmt.Errorf("error deriving child "+
@ -468,7 +469,7 @@ func findAnchorKey(rootKey *hdkeychain.ExtendedKey,
}, script, nil
}
return nil, nil, fmt.Errorf("no matching pubkeys found")
return nil, nil, errors.New("no matching pubkeys found")
}
func findTaprootAnchorKey(rootKey *hdkeychain.ExtendedKey,
@ -489,7 +490,7 @@ func findTaprootAnchorKey(rootKey *hdkeychain.ExtendedKey,
// Loop through the local multisig keys to find the target anchor
// script.
for index := uint32(0); index < math.MaxInt16; index++ {
for index := range uint32(math.MaxInt16) {
currentKey, err := localPayment.DeriveNonStandard(index)
if err != nil {
return nil, nil, fmt.Errorf("error deriving child "+
@ -526,5 +527,5 @@ func findTaprootAnchorKey(rootKey *hdkeychain.ExtendedKey,
}, scriptTree, nil
}
return nil, nil, fmt.Errorf("no matching pubkeys found")
return nil, nil, errors.New("no matching pubkeys found")
}

View file

@ -14,9 +14,9 @@ import (
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/lightninglabs/chantools/lnd"
"github.com/lightninglabs/loop"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
"github.com/lightninglabs/loop/utils"
"github.com/lightningnetwork/lnd/input"
"github.com/lightningnetwork/lnd/keychain"
"github.com/lightningnetwork/lnd/lnrpc"
@ -25,7 +25,7 @@ import (
)
var (
errSwapNotFound = fmt.Errorf("loop in swap not found")
errSwapNotFound = errors.New("loop in swap not found")
)
type recoverLoopInCommand struct {
@ -125,15 +125,15 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
}
if c.TxID == "" {
return fmt.Errorf("txid is required")
return errors.New("txid is required")
}
if c.SwapHash == "" {
return fmt.Errorf("swap_hash is required")
return errors.New("swap_hash is required")
}
if c.LoopDbDir == "" {
return fmt.Errorf("loop_db_dir is required")
return errors.New("loop_db_dir is required")
}
err = lnd.CheckAddress(
@ -207,7 +207,7 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
// set, as a lot of failure cases steam from the output amount being
// wrong.
if loopIn.Contract.ExternalHtlc && c.OutputAmt == 0 {
return fmt.Errorf("output_amt is required for external htlc")
return errors.New("output_amt is required for external htlc")
}
fmt.Println("Loop expires at block height", loopIn.Contract.CltvExpiry)
@ -218,7 +218,7 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
}
// Get the swaps htlc.
htlc, err := loop.GetHtlc(
htlc, err := utils.GetHtlc(
loopIn.Hash, &loopIn.Contract.SwapContract, chainParams,
)
if err != nil {
@ -243,7 +243,7 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
feeRateKWeight := chainfee.SatPerKVByte(
1000 * c.FeeRate,
).FeePerKWeight()
fee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
fee := feeRateKWeight.FeeForWeight(estimator.Weight())
txID, err := chainhash.NewHashFromStr(c.TxID)
if err != nil {
@ -289,7 +289,7 @@ func (c *recoverLoopInCommand) Execute(_ *cobra.Command, _ []string) error {
}
}
if rawTx == nil {
return fmt.Errorf("failed to brute force key index, " +
return errors.New("failed to brute force key index, " +
"please try again with a higher start key " +
"index")
}

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"strconv"
"strings"
@ -53,7 +54,7 @@ run lnd ` + lndVersion + ` or later after using this command!`,
func (c *removeChannelCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a channel DB.
if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required")
return errors.New("channel DB is required")
}
db, err := lnd.OpenDB(c.ChannelDB, false)
if err != nil {

View file

@ -173,7 +173,7 @@ func (c *rescueClosedCommand) Execute(_ *cobra.Command, _ []string) error {
return rescueClosedChannels(extendedKey, entries, commitPoints)
default:
return fmt.Errorf("you either need to specify --channeldb and " +
return errors.New("you either need to specify --channeldb and " +
"--fromsummary or --force_close_addr and " +
"--commit_point but not a mixture of them")
}
@ -333,7 +333,7 @@ func rescueClosedChannel(extendedKey *hdkeychain.ExtendedKey,
"hash %x\n", addr.ScriptAddress())
default:
return fmt.Errorf("address: must be a bech32 P2WPKH address")
return errors.New("address: must be a bech32 P2WPKH address")
}
err := fillCache(extendedKey)
@ -380,13 +380,13 @@ func addrInCache(addr string, perCommitPoint *btcec.PublicKey) (string, error) {
return "", fmt.Errorf("error parsing addr: %w", err)
}
if scriptHash {
return "", fmt.Errorf("address must be a P2WPKH address")
return "", errors.New("address must be a P2WPKH address")
}
// If the commit point is nil, we try with plain private keys to match
// static_remote_key outputs.
if perCommitPoint == nil {
for i := 0; i < cacheSize; i++ {
for i := range cacheSize {
cacheEntry := cache[i]
hashedPubKey := btcutil.Hash160(
cacheEntry.pubKey.SerializeCompressed(),
@ -415,7 +415,7 @@ func addrInCache(addr string, perCommitPoint *btcec.PublicKey) (string, error) {
// Loop through all cached payment base point keys, tweak each of it
// with the per_commit_point and see if the hashed public key
// corresponds to the target pubKeyHash of the given address.
for i := 0; i < cacheSize; i++ {
for i := range cacheSize {
cacheEntry := cache[i]
basePoint := cacheEntry.pubKey
tweakedPubKey := input.TweakPubKey(basePoint, perCommitPoint)
@ -449,7 +449,7 @@ func addrInCache(addr string, perCommitPoint *btcec.PublicKey) (string, error) {
func fillCache(extendedKey *hdkeychain.ExtendedKey) error {
cache = make([]*cacheEntry, cacheSize)
for i := 0; i < cacheSize; i++ {
for i := range cacheSize {
key, err := lnd.DeriveChildren(extendedKey, []uint32{
lnd.HardenedKeyStart + uint32(keychain.BIP0043Purpose),
lnd.HardenedKeyStart + chainParams.HDCoinType,

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -153,7 +154,7 @@ func (c *rescueFundingCommand) Execute(_ *cobra.Command, _ []string) error {
case (c.ChannelDB == "" || c.DBChannelPoint == "") &&
c.RemotePubKey == "":
return fmt.Errorf("need to specify either channel DB and " +
return errors.New("need to specify either channel DB and " +
"channel point or both local and remote pubkey")
case c.ChannelDB != "" && c.DBChannelPoint != "":
@ -179,11 +180,11 @@ func (c *rescueFundingCommand) Execute(_ *cobra.Command, _ []string) error {
}
if pendingChan.LocalChanCfg.MultiSigKey.PubKey == nil {
return fmt.Errorf("invalid channel data in DB, local " +
return errors.New("invalid channel data in DB, local " +
"multisig pubkey is nil")
}
if pendingChan.LocalChanCfg.MultiSigKey.PubKey == nil {
return fmt.Errorf("invalid channel data in DB, remote " +
return errors.New("invalid channel data in DB, remote " +
"multisig pubkey is nil")
}
@ -297,7 +298,7 @@ func rescueFunding(localKeyDesc *keychain.KeyDescriptor,
// Some last sanity check that we're working with the correct data.
if !bytes.Equal(fundingTxOut.PkScript, utxo.PkScript) {
return fmt.Errorf("funding output script does not match UTXO")
return errors.New("funding output script does not match UTXO")
}
// Now the rest of the known data for the PSBT.
@ -316,7 +317,7 @@ func rescueFunding(localKeyDesc *keychain.KeyDescriptor,
// Estimate the transaction weight, so we can do the fee estimation.
estimator.AddWitnessInput(MultiSigWitnessSize)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
txOut.Value = utxo.Value - int64(totalFee)
// Let's now create the PSBT as we have everything we need so far.

View file

@ -2,6 +2,7 @@ package main
import (
"bytes"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -15,7 +16,7 @@ import (
)
var (
ErrAddrNotFound = fmt.Errorf("address not found")
ErrAddrNotFound = errors.New("address not found")
)
type rescueTweakedKeyCommand struct {
@ -66,7 +67,7 @@ func (c *rescueTweakedKeyCommand) Execute(_ *cobra.Command, _ []string) error {
}
if c.Path == "" {
return fmt.Errorf("path is required")
return errors.New("path is required")
}
childKey, _, _, err := lnd.DeriveKey(extendedKey, c.Path, chainParams)

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
@ -35,7 +36,7 @@ const (
// lndVersion is the current version of lnd that we support. This is
// shown in some commands that affect the database and its migrations.
lndVersion = "v0.17.4-beta"
lndVersion = "v0.18.0-beta"
Commit = ""
)
@ -58,7 +59,7 @@ funds locked in lnd channels in case lnd itself cannot run properly anymore.
Complete documentation is available at
https://github.com/lightninglabs/chantools/.`,
Version: fmt.Sprintf("v%s, commit %s", version, Commit),
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(_ *cobra.Command, _ []string) {
switch {
case Testnet:
chainParams = &chaincfg.TestNet3Params
@ -282,7 +283,7 @@ func (f *inputFlags) parseInputType() ([]*dataformat.SummaryEntry, error) {
return target.AsSummaryEntries()
default:
return nil, fmt.Errorf("an input file must be specified")
return nil, errors.New("an input file must be specified")
}
if err != nil {

View file

@ -2,6 +2,7 @@ package main
import (
"bytes"
"io"
"io/ioutil"
"os"
"path"
@ -103,7 +104,20 @@ func (h *harness) testdataFile(name string) string {
workingDir, err := os.Getwd()
require.NoError(h.t, err)
return path.Join(workingDir, "testdata", name)
origFile := path.Join(workingDir, "testdata", name)
fileCopy := path.Join(h.t.TempDir(), name)
src, err := os.Open(origFile)
require.NoError(h.t, err)
defer src.Close()
dst, err := os.Create(fileCopy)
require.NoError(h.t, err)
defer dst.Close()
_, err = io.Copy(dst, src)
require.NoError(h.t, err)
return fileCopy
}
func (h *harness) tempFile(name string) string {

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
chantools_lnd "github.com/lightninglabs/chantools/lnd"
@ -41,7 +42,7 @@ func newSignMessageCommand() *cobra.Command {
func (c *signMessageCommand) Execute(_ *cobra.Command, _ []string) error {
if c.Msg == "" {
return fmt.Errorf("please enter a valid msg")
return errors.New("please enter a valid msg")
}
extendedKey, err := c.rootKey.read()

View file

@ -17,7 +17,7 @@ import (
)
var (
errNoPathFound = fmt.Errorf("no matching derivation path found")
errNoPathFound = errors.New("no matching derivation path found")
)
type signPSBTCommand struct {
@ -98,7 +98,7 @@ func (c *signPSBTCommand) Execute(_ *cobra.Command, _ []string) error {
}
default:
return fmt.Errorf("either the PSBT or the raw PSBT file " +
return errors.New("either the PSBT or the raw PSBT file " +
"must be set")
}

View file

@ -2,6 +2,7 @@ package main
import (
"bytes"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -115,11 +116,11 @@ func signRescueFunding(rootKey *hdkeychain.ExtendedKey,
return fmt.Errorf("could not find local multisig key: %w", err)
}
if len(packet.Inputs[0].WitnessScript) == 0 {
return fmt.Errorf("invalid PSBT, missing witness script")
return errors.New("invalid PSBT, missing witness script")
}
witnessScript := packet.Inputs[0].WitnessScript
if packet.Inputs[0].WitnessUtxo == nil {
return fmt.Errorf("invalid PSBT, witness UTXO missing")
return errors.New("invalid PSBT, witness UTXO missing")
}
utxo := packet.Inputs[0].WitnessUtxo
@ -157,7 +158,7 @@ func findLocalMultisigKey(multisigBranch *hdkeychain.ExtendedKey,
targetPubkey *btcec.PublicKey) (*keychain.KeyDescriptor, error) {
// Loop through the local multisig keys to find the target key.
for index := uint32(0); index < MaxChannelLookup; index++ {
for index := range uint32(MaxChannelLookup) {
currentKey, err := multisigBranch.DeriveNonStandard(index)
if err != nil {
return nil, fmt.Errorf("error deriving child key: %w",
@ -183,5 +184,5 @@ func findLocalMultisigKey(multisigBranch *hdkeychain.ExtendedKey,
}, nil
}
return nil, fmt.Errorf("no matching pubkeys found")
return nil, errors.New("no matching pubkeys found")
}

View file

@ -145,7 +145,7 @@ func sweepRemoteClosed(extendedKey *hdkeychain.ExtendedKey, apiURL,
targets []*targetAddr
api = newExplorerAPI(apiURL)
)
for index := uint32(0); index < recoveryWindow; index++ {
for index := range recoveryWindow {
path := fmt.Sprintf("m/1017'/%d'/%d'/0/%d",
chainParams.HDCoinType, keychain.KeyFamilyPaymentBase,
index)
@ -302,7 +302,7 @@ func sweepRemoteClosed(extendedKey *hdkeychain.ExtendedKey, apiURL,
// Calculate the fee based on the given fee rate and our weight
// estimation.
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
log.Infof("Fee %d sats of %d total amount (estimated weight %d)",
totalFee, totalOutputValue, estimator.Weight())

View file

@ -299,7 +299,7 @@ func sweepTimeLock(extendedKey *hdkeychain.ExtendedKey, apiURL string,
// Calculate the fee based on the given fee rate and our weight
// estimation.
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
log.Infof("Fee %d sats of %d total amount (estimated weight %d)",
totalFee, totalOutputValue, estimator.Weight())

View file

@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -179,7 +180,7 @@ func (c *sweepTimeLockManualCommand) Execute(_ *cobra.Command, _ []string) error
case c.ChannelBackup != "":
if c.ChannelPoint == "" {
return fmt.Errorf("channel point is required with " +
return errors.New("channel point is required with " +
"--frombackup")
}
@ -211,11 +212,11 @@ func (c *sweepTimeLockManualCommand) Execute(_ *cobra.Command, _ []string) error
maxNumChannelsTotal = startNumChannelsTotal + 1
case c.ChannelBackup != "" && c.RemoteRevocationBasePoint != "":
return fmt.Errorf("cannot use both --frombackup and " +
return errors.New("cannot use both --frombackup and " +
"--remoterevbasepoint at the same time")
default:
return fmt.Errorf("either --frombackup or " +
return errors.New("either --frombackup or " +
"--remoterevbasepoint is required")
}
@ -318,7 +319,7 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
// Did we find what we looked for or did we just exhaust all
// possibilities?
if script == nil || delayDesc == nil {
return fmt.Errorf("target script not derived")
return errors.New("target script not derived")
}
// We now know everything we need to construct the sweep transaction,
@ -352,7 +353,7 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
// estimation.
estimator.AddWitnessInput(input.ToLocalTimeoutWitnessSize)
feeRateKWeight := chainfee.SatPerKVByte(1000 * feeRate).FeePerKWeight()
totalFee := feeRateKWeight.FeeForWeight(int64(estimator.Weight()))
totalFee := feeRateKWeight.FeeForWeight(estimator.Weight())
// Add our sweep destination output.
sweepTx.TxOut = []*wire.TxOut{{
@ -564,7 +565,7 @@ func tryKey(baseKey *hdkeychain.ExtendedKey, remoteRevPoint *btcec.PublicKey,
}, nil
}
return 0, nil, nil, nil, nil, fmt.Errorf("target script not derived")
return 0, nil, nil, nil, nil, errors.New("target script not derived")
}
func bruteForceDelayPoint(delayBase, revBase *btcec.PublicKey,
@ -572,7 +573,7 @@ func bruteForceDelayPoint(delayBase, revBase *btcec.PublicKey,
startCsvTimeout, maxCsvTimeout uint16, maxChanUpdates uint64) (int32,
[]byte, []byte, *btcec.PublicKey, error) {
for i := uint64(0); i < maxChanUpdates; i++ {
for i := range maxChanUpdates {
revPreimage, err := revRoot.AtIndex(i)
if err != nil {
return 0, nil, nil, nil, err
@ -592,5 +593,5 @@ func bruteForceDelayPoint(delayBase, revBase *btcec.PublicKey,
return csvTimeout, script, scriptHash, commitPoint, nil
}
return 0, nil, nil, nil, fmt.Errorf("target script not derived")
return 0, nil, nil, nil, errors.New("target script not derived")
}

View file

@ -103,7 +103,7 @@ func (c *triggerForceCloseCommand) Execute(_ *cobra.Command, _ []string) error {
}
err = requestForceClose(
c.Peer, c.TorProxy, pubKey, outPoint, identityECDH,
c.Peer, c.TorProxy, pubKey, *outPoint, identityECDH,
)
if err != nil {
return fmt.Errorf("error requesting force close: %w", err)
@ -199,7 +199,7 @@ func connectPeer(peerHost, torProxy string, peerPubKey *btcec.PublicKey,
}
func requestForceClose(peerHost, torProxy string, peerPubKey *btcec.PublicKey,
channelPoint *wire.OutPoint, identity keychain.SingleKeyECDH) error {
channelPoint wire.OutPoint, identity keychain.SingleKeyECDH) error {
p, err := connectPeer(
peerHost, torProxy, peerPubKey, identity, dialTimeout,

View file

@ -4,6 +4,7 @@ import (
"bytes"
"crypto/rand"
"encoding/hex"
"errors"
"fmt"
"math"
"runtime"
@ -71,14 +72,14 @@ func (c *vanityGenCommand) Execute(_ *cobra.Command, _ []string) error {
}
if len(prefixBytes) < 2 {
return fmt.Errorf("prefix must be at least 2 bytes")
return errors.New("prefix must be at least 2 bytes")
}
if len(prefixBytes) > 8 {
return fmt.Errorf("prefix too long, unlikely to find a key " +
return errors.New("prefix too long, unlikely to find a key " +
"within billions of years")
}
if !(prefixBytes[0] == 0x02 || prefixBytes[0] == 0x03) {
return fmt.Errorf("prefix must start with 02 or 03 because " +
return errors.New("prefix must start with 02 or 03 because " +
"it's an EC public key")
}
@ -103,7 +104,7 @@ func (c *vanityGenCommand) Execute(_ *cobra.Command, _ []string) error {
start = time.Now()
)
for i := uint8(0); i < c.Threads; i++ {
for range c.Threads {
go func() {
var (
entropy [16]byte

View file

@ -1,6 +1,7 @@
package main
import (
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -79,7 +80,7 @@ or simply press <enter> without entering a password when being prompted.`,
func (c *walletInfoCommand) Execute(_ *cobra.Command, _ []string) error {
// Check that we have a wallet DB.
if c.WalletDB == "" {
return fmt.Errorf("wallet DB is required")
return errors.New("wallet DB is required")
}
w, privateWalletPw, cleanup, err := lnd.OpenWallet(
@ -163,7 +164,7 @@ func walletInfo(w *wallet.Wallet, dumpAddrs bool) (*btcec.PublicKey, string,
printAddr := func(a waddrmgr.ManagedAddress) error {
pka, ok := a.(waddrmgr.ManagedPubKeyAddress)
if !ok {
return fmt.Errorf("key is not a managed pubkey")
return errors.New("key is not a managed pubkey")
}
privKey, err := pka.PrivKey()

View file

@ -298,7 +298,7 @@ func (c *zombieRecoveryFindMatchesCommand) Execute(_ *cobra.Command,
Node1: node1,
}
folder := fmt.Sprintf("results/match-%s", node1)
folder := "results/match-" + node1
today := time.Now().Format("2006-01-02")
for node2, match := range node1map {
err = os.MkdirAll(folder, 0755)

View file

@ -5,6 +5,7 @@ import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"os"
"strconv"
@ -111,49 +112,49 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
// Make sure the key files were filled correctly.
if keys1.Node1 == nil || keys1.Node2 == nil {
return fmt.Errorf("invalid node1 file, node info missing")
return errors.New("invalid node1 file, node info missing")
}
if keys2.Node1 == nil || keys2.Node2 == nil {
return fmt.Errorf("invalid node2 file, node info missing")
return errors.New("invalid node2 file, node info missing")
}
if keys1.Node1.PubKey != keys2.Node1.PubKey {
return fmt.Errorf("invalid files, node 1 pubkey doesn't match")
return errors.New("invalid files, node 1 pubkey doesn't match")
}
if keys1.Node2.PubKey != keys2.Node2.PubKey {
return fmt.Errorf("invalid files, node 2 pubkey doesn't match")
return errors.New("invalid files, node 2 pubkey doesn't match")
}
if len(keys1.Node1.MultisigKeys) == 0 &&
len(keys1.Node2.MultisigKeys) == 0 {
return fmt.Errorf("invalid node1 file, missing multisig keys")
return errors.New("invalid node1 file, missing multisig keys")
}
if len(keys2.Node1.MultisigKeys) == 0 &&
len(keys2.Node2.MultisigKeys) == 0 {
return fmt.Errorf("invalid node2 file, missing multisig keys")
return errors.New("invalid node2 file, missing multisig keys")
}
if len(keys1.Node1.MultisigKeys) == len(keys2.Node1.MultisigKeys) {
return fmt.Errorf("invalid files, channel info incorrect")
return errors.New("invalid files, channel info incorrect")
}
if len(keys1.Node2.MultisigKeys) == len(keys2.Node2.MultisigKeys) {
return fmt.Errorf("invalid files, channel info incorrect")
return errors.New("invalid files, channel info incorrect")
}
if len(keys1.Channels) != len(keys2.Channels) {
return fmt.Errorf("invalid files, channels don't match")
return errors.New("invalid files, channels don't match")
}
for idx, node1Channel := range keys1.Channels {
if keys2.Channels[idx].ChanPoint != node1Channel.ChanPoint {
return fmt.Errorf("invalid files, channels don't match")
return errors.New("invalid files, channels don't match")
}
if keys2.Channels[idx].Address != node1Channel.Address {
return fmt.Errorf("invalid files, channels don't match")
return errors.New("invalid files, channels don't match")
}
if keys2.Channels[idx].Address == "" ||
node1Channel.Address == "" {
return fmt.Errorf("invalid files, channel address " +
return errors.New("invalid files, channel address " +
"missing")
}
}
@ -221,10 +222,10 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
theirPayoutAddr = keys1.Node1.PayoutAddr
}
if len(ourKeys) == 0 || len(theirKeys) == 0 {
return fmt.Errorf("couldn't find necessary keys")
return errors.New("couldn't find necessary keys")
}
if ourPayoutAddr == "" || theirPayoutAddr == "" {
return fmt.Errorf("payout address missing")
return errors.New("payout address missing")
}
ourPubKeys, err := parseKeys(ourKeys)
@ -292,7 +293,7 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
estimator.AddWitnessInput(input.MultiSigWitnessSize)
}
feeRateKWeight := chainfee.SatPerKVByte(1000 * c.FeeRate).FeePerKWeight()
totalFee := int64(feeRateKWeight.FeeForWeight(int64(estimator.Weight())))
totalFee := int64(feeRateKWeight.FeeForWeight(estimator.Weight()))
fmt.Printf("Current tally (before fees):\n\t"+
"To our address (%s): %d sats\n\t"+
@ -315,7 +316,7 @@ func (c *zombieRecoveryMakeOfferCommand) Execute(_ *cobra.Command,
theirSum -= totalFee
default:
return fmt.Errorf("error distributing fees, unhandled case")
return errors.New("error distributing fees, unhandled case")
}
// Our output.

View file

@ -4,6 +4,7 @@ import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
@ -72,7 +73,7 @@ func (c *zombieRecoveryPrepareKeysCommand) Execute(_ *cobra.Command,
_, err = lnd.GetP2WPKHScript(c.PayoutAddr, chainParams)
if err != nil {
return fmt.Errorf("invalid payout address, must be P2WPKH")
return errors.New("invalid payout address, must be P2WPKH")
}
matchFileBytes, err := ioutil.ReadFile(c.MatchFile)
@ -90,7 +91,7 @@ func (c *zombieRecoveryPrepareKeysCommand) Execute(_ *cobra.Command,
// Make sure the match file was filled correctly.
if match.Node1 == nil || match.Node2 == nil {
return fmt.Errorf("invalid match file, node info missing")
return errors.New("invalid match file, node info missing")
}
_, pubKey, _, err := lnd.DeriveKey(
@ -116,7 +117,7 @@ func (c *zombieRecoveryPrepareKeysCommand) Execute(_ *cobra.Command,
}
// Derive all 2500 keys now, this might take a while.
for index := uint32(0); index < c.NumKeys; index++ {
for index := range c.NumKeys {
_, pubKey, _, err := lnd.DeriveKey(
extendedKey, lnd.MultisigPath(chainParams, int(index)),
chainParams,

View file

@ -3,6 +3,7 @@ package main
import (
"bufio"
"bytes"
"errors"
"fmt"
"os"
@ -151,12 +152,12 @@ func signOffer(rootKey *hdkeychain.ExtendedKey,
"%w", err)
}
if len(packet.Inputs[idx].WitnessScript) == 0 {
return fmt.Errorf("invalid PSBT, missing witness " +
return errors.New("invalid PSBT, missing witness " +
"script")
}
witnessScript := packet.Inputs[idx].WitnessScript
if packet.Inputs[idx].WitnessUtxo == nil {
return fmt.Errorf("invalid PSBT, witness UTXO missing")
return errors.New("invalid PSBT, witness UTXO missing")
}
utxo := packet.Inputs[idx].WitnessUtxo

View file

@ -10,7 +10,7 @@ If only the failed payments should be deleted (and not the successful ones), the
CAUTION: Running this command will make it impossible to use the channel DB
with an older version of lnd. Downgrading is not possible and you'll need to
run lnd v0.17.4-beta or later after using this command!'
run lnd v0.18.0-beta or later after using this command!'
```
chantools deletepayments [flags]

View file

@ -12,7 +12,7 @@ without removing any other data.
CAUTION: Running this command will make it impossible to use the channel DB
with an older version of lnd. Downgrading is not possible and you'll need to
run lnd v0.17.4-beta or later after using this command!'
run lnd v0.18.0-beta or later after using this command!'
```
chantools dropchannelgraph [flags]

View file

@ -12,7 +12,7 @@ be helpful to fix a graph that is out of sync with the network.
CAUTION: Running this command will make it impossible to use the channel DB
with an older version of lnd. Downgrading is not possible and you'll need to
run lnd v0.17.4-beta or later after using this command!'
run lnd v0.18.0-beta or later after using this command!'
```
chantools dropgraphzombies [flags]

View file

@ -61,7 +61,7 @@ chantools fakechanbackup --from_channel_graph lncli_describegraph.json \
--channelpoint string funding transaction outpoint of the channel to rescue (<txid>:<txindex>) as it is displayed on 1ml.com
--from_channel_graph string the full LN channel graph in the JSON format that the 'lncli describegraph' returns
-h, --help help for fakechanbackup
--multi_file string the fake channel backup file to create (default "results/fake-2024-01-26-02-27-52.backup")
--multi_file string the fake channel backup file to create (default "results/fake-2024-06-18-10-55-31.backup")
--remote_node_addr string the remote node connection information in the format pubkey@host:port
--rootkey string BIP32 HD root key of the wallet to use for encrypting the backup; leave empty to prompt for lnd 24 word aezeed
--short_channel_id string the short channel ID in the format <blockheight>x<transactionindex>x<outputindex>

View file

@ -11,7 +11,7 @@ needs to read the database content.
CAUTION: Running this command will make it impossible to use the channel DB
with an older version of lnd. Downgrading is not possible and you'll need to
run lnd v0.17.4-beta or later after using this command!'
run lnd v0.18.0-beta or later after using this command!'
```
chantools migratedb [flags]

View file

@ -11,7 +11,7 @@ channel was never confirmed on chain!
CAUTION: Running this command will make it impossible to use the channel DB
with an older version of lnd. Downgrading is not possible and you'll need to
run lnd v0.17.4-beta or later after using this command!
run lnd v0.18.0-beta or later after using this command!
```
chantools removechannel [flags]

144
go.mod
View file

@ -1,54 +1,54 @@
module github.com/lightninglabs/chantools
go 1.21
go 1.22.3
require (
github.com/btcsuite/btcd v0.24.1-0.20240123000108-62e6af035ec5
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/btcsuite/btcd v0.24.2-beta.rc1.0.20240403021926-ae5533602c46
github.com/btcsuite/btcd/btcec/v2 v2.3.3
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.8
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcwallet v0.16.10-0.20240127010340-16b422a2e8bf
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
github.com/btcsuite/btcwallet/walletdb v1.4.0
github.com/btcsuite/btcwallet v0.16.10-0.20240410030101-6fe19a472a62
github.com/btcsuite/btcwallet/wallet/txrules v1.2.1
github.com/btcsuite/btcwallet/walletdb v1.4.2
github.com/coreos/bbolt v1.3.3
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/gogo/protobuf v1.3.2 // indirect
github.com/hasura/go-graphql-client v0.9.1
github.com/lightninglabs/loop v0.26.6-beta
github.com/lightninglabs/pool v0.6.2-beta.0.20230329135228-c3bffb52df3a
github.com/lightninglabs/loop v0.28.3-beta
github.com/lightninglabs/pool v0.6.5-beta.0.20240531084722-4000ec802aaa
// The current version of lnd we are compatible with, mostly affects the
// commands that touch the channel DB and has an impact on the DB schema.
// NOTE: When updating this version, make sure to also update the string in
// cmd/chantools/root.go.
github.com/lightningnetwork/lnd v0.17.4-beta
github.com/lightningnetwork/lnd/kvdb v1.4.4
github.com/lightningnetwork/lnd v0.18.0-beta.1
github.com/lightningnetwork/lnd/kvdb v1.4.8
github.com/lightningnetwork/lnd/queue v1.1.1
github.com/lightningnetwork/lnd/ticker v1.1.1
github.com/lightningnetwork/lnd/tor v1.1.2
github.com/lightningnetwork/lnd/tor v1.1.3
github.com/spf13/cobra v1.1.3
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
go.etcd.io/bbolt v1.3.7
golang.org/x/crypto v0.21.0
golang.org/x/oauth2 v0.11.0
golang.org/x/crypto v0.22.0
golang.org/x/oauth2 v0.14.0
)
require github.com/tv42/zbase32 v0.0.0-20220222190657-f76a9fc892fa
require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 // indirect
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 // indirect
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.3 // indirect
github.com/btcsuite/btcwallet/wtxmgr v1.5.0 // indirect
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.4 // indirect
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.4 // indirect
github.com/btcsuite/btcwallet/wtxmgr v1.5.3 // indirect
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/btcsuite/winsvc v1.0.0 // indirect
@ -58,26 +58,26 @@ require (
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/lru v1.0.0 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/decred/dcrd/lru v1.1.2 // indirect
github.com/docker/cli v20.10.17+incompatible // indirect
github.com/docker/docker v24.0.9+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/fergusstrange/embedded-postgres v1.10.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
github.com/fortytw2/leaktest v1.3.0 // indirect
github.com/frankban/quicktest v1.14.3 // indirect
github.com/go-errors/errors v1.0.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
github.com/golang-migrate/migrate/v4 v4.16.1 // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang-migrate/migrate/v4 v4.17.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
@ -85,11 +85,12 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa // indirect
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
@ -101,54 +102,53 @@ require (
github.com/jrick/logrotate v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
github.com/kkdai/bstream v1.0.0 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/lightninglabs/aperture v0.1.21-beta.0.20230705004936-87bb996a4030 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/lib/pq v1.10.9 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/lndclient v0.17.4-1 // indirect
github.com/lightninglabs/loop/swapserverrpc v1.0.5 // indirect
github.com/lightninglabs/neutrino v0.16.0 // indirect
github.com/lightninglabs/neutrino/cache v1.1.1 // indirect
github.com/lightninglabs/pool/auctioneerrpc v1.0.7 // indirect
github.com/lightninglabs/lndclient v0.18.0-2 // indirect
github.com/lightninglabs/loop/swapserverrpc v1.0.8 // indirect
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd // indirect
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
github.com/lightninglabs/pool/auctioneerrpc v1.1.2 // indirect
github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f // indirect
github.com/lightningnetwork/lnd/clock v1.1.1 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.3 // indirect
github.com/lightningnetwork/lnd/tlv v1.1.1 // indirect
github.com/lightningnetwork/lnd/fn v1.0.8 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.4 // indirect
github.com/lightningnetwork/lnd/sqldb v1.0.2 // indirect
github.com/lightningnetwork/lnd/tlv v1.2.6 // indirect
github.com/ltcsuite/ltcd v0.0.0-20191228044241-92166e412499 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mholt/archiver/v3 v3.5.0 // indirect
github.com/miekg/dns v1.1.43 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nwaples/rardecode v1.1.2 // indirect
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.12 // indirect
github.com/ory/dockertest/v3 v3.10.0 // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.11.1 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.30.0 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/fastuuid v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/sirupsen/logrus v1.9.2 // indirect
github.com/soheilhy/cmux v0.1.5 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
@ -162,49 +162,47 @@ require (
go.etcd.io/etcd/pkg/v3 v3.5.7 // indirect
go.etcd.io/etcd/raft/v3 v3.5.7 // indirect
go.etcd.io/etcd/server/v3 v3.5.7 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.0 // indirect
go.opentelemetry.io/otel v1.20.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0 // indirect
go.opentelemetry.io/otel/metric v1.20.0 // indirect
go.opentelemetry.io/otel/sdk v1.3.0 // indirect
go.opentelemetry.io/otel/trace v1.20.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/mock v0.4.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.19.0 // indirect
golang.org/x/term v0.19.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/tools v0.19.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/errgo.v1 v1.0.1 // indirect
gopkg.in/macaroon-bakery.v2 v2.1.0 // indirect
gopkg.in/macaroon.v2 v2.1.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/uint128 v1.2.0 // indirect
modernc.org/cc/v3 v3.40.0 // indirect
modernc.org/ccgo/v3 v3.16.13 // indirect
modernc.org/libc v1.22.2 // indirect
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.4.0 // indirect
modernc.org/opt v0.1.3 // indirect
modernc.org/sqlite v1.20.3 // indirect
modernc.org/strutil v1.1.3 // indirect
modernc.org/token v1.0.1 // indirect
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
modernc.org/libc v1.49.3 // indirect
modernc.org/mathutil v1.6.0 // indirect
modernc.org/memory v1.8.0 // indirect
modernc.org/sqlite v1.29.8 // indirect
modernc.org/strutil v1.2.0 // indirect
modernc.org/token v1.1.0 // indirect
nhooyr.io/websocket v1.8.7 // indirect
sigs.k8s.io/yaml v1.2.0 // indirect
)
@ -212,4 +210,4 @@ require (
// We want to format raw bytes as hex instead of base64. The forked version
// allows us to specify that as an option. This is required for the
// taproot-assets dependency to function properly.
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display

693
go.sum

File diff suppressed because it is too large Load diff

View file

@ -49,7 +49,7 @@ var (
)
func noConsole() ([]byte, error) {
return nil, fmt.Errorf("wallet db requires console access")
return nil, errors.New("wallet db requires console access")
}
// ReadAezeed reads an aezeed from the console or the environment variable.
@ -112,7 +112,7 @@ func ReadAezeed(params *chaincfg.Params) (*hdkeychain.ExtendedKey, time.Time,
}
rootKey, err := hdkeychain.NewMaster(cipherSeed.Entropy[:], params)
if err != nil {
return nil, time.Unix(0, 0), fmt.Errorf("failed to derive " +
return nil, time.Unix(0, 0), errors.New("failed to derive " +
"master extended key")
}
return rootKey, cipherSeed.BirthdayTime(), nil
@ -229,7 +229,7 @@ func OpenWallet(walletDbPath string,
DefaultOpenTimeout,
)
if errors.Is(err, bbolt.ErrTimeout) {
return nil, nil, nil, fmt.Errorf("error opening wallet " +
return nil, nil, nil, errors.New("error opening wallet " +
"database, make sure lnd is not running and holding " +
"the exclusive lock on the wallet")
}

View file

@ -1,6 +1,7 @@
package lnd
import (
"errors"
"fmt"
"os"
"time"
@ -103,14 +104,14 @@ func ConnectPeer(conn *brontide.Conn, connReq *connmgr.ConnReq,
gossiper := discovery.New(discovery.Config{
ChainHash: *netParams.GenesisHash,
Broadcast: func(skips map[route.Vertex]struct{},
msg ...lnwire.Message) error {
Broadcast: func(_ map[route.Vertex]struct{},
_ ...lnwire.Message) error {
return nil
},
NotifyWhenOnline: func([33]byte, chan<- lnpeer.Peer) {
},
NotifyWhenOffline: func(peerPubKey [33]byte) <-chan struct{} {
NotifyWhenOffline: func(_ [33]byte) <-chan struct{} {
return make(chan struct{})
},
FetchSelfAnnouncement: func() lnwire.NodeAnnouncement {
@ -137,24 +138,24 @@ func ConnectPeer(conn *brontide.Conn, connReq *connmgr.ConnReq,
SignAliasUpdate: func(
*lnwire.ChannelUpdate) (*ecdsa.Signature, error) {
return nil, fmt.Errorf("unimplemented")
return nil, errors.New("unimplemented")
},
FindBaseByAlias: func(
lnwire.ShortChannelID) (lnwire.ShortChannelID, error) {
return lnwire.ShortChannelID{},
fmt.Errorf("unimplemented")
errors.New("unimplemented")
},
GetAlias: func(id lnwire.ChannelID) (lnwire.ShortChannelID,
GetAlias: func(_ lnwire.ChannelID) (lnwire.ShortChannelID,
error) {
return lnwire.ShortChannelID{},
fmt.Errorf("unimplemented")
errors.New("unimplemented")
},
FindChannel: func(*btcec.PublicKey,
lnwire.ChannelID) (*channeldb.OpenChannel, error) {
return nil, fmt.Errorf("unimplemented")
return nil, errors.New("unimplemented")
},
}, &keychain.KeyDescriptor{
KeyLocator: keychain.KeyLocator{},
@ -181,22 +182,21 @@ func ConnectPeer(conn *brontide.Conn, connReq *connmgr.ConnReq,
key.SerializeCompressed())
return nil
},
GenNodeAnnouncement: func(
modifier ...netann.NodeAnnModifier) (
GenNodeAnnouncement: func(_ ...netann.NodeAnnModifier) (
lnwire.NodeAnnouncement, error) {
return lnwire.NodeAnnouncement{},
fmt.Errorf("unimplemented")
errors.New("unimplemented")
},
PongBuf: pongBuf,
PrunePersistentPeerConnection: func(bytes [33]byte) {},
PrunePersistentPeerConnection: func(_ [33]byte) {},
FetchLastChanUpdate: func(id lnwire.ShortChannelID) (
FetchLastChanUpdate: func(_ lnwire.ShortChannelID) (
*lnwire.ChannelUpdate, error) {
return nil, fmt.Errorf("unimplemented")
return nil, errors.New("unimplemented")
},
Hodl: &hodl.Config{},
@ -216,16 +216,14 @@ func ConnectPeer(conn *brontide.Conn, connReq *connmgr.ConnReq,
return nil
},
GetAliases: func(
base lnwire.ShortChannelID) []lnwire.ShortChannelID {
_ lnwire.ShortChannelID) []lnwire.ShortChannelID {
return nil
},
RequestAlias: func() (lnwire.ShortChannelID, error) {
return lnwire.ShortChannelID{}, nil
},
AddLocalAlias: func(alias, base lnwire.ShortChannelID,
gossip bool) error {
AddLocalAlias: func(_, _ lnwire.ShortChannelID, _ bool) error {
return nil
},
Quit: make(chan struct{}),

View file

@ -58,8 +58,6 @@ func ExtractChannel(extendedKey *hdkeychain.ExtendedKey,
channels := dump.BackupDump(multi, chainParams)
for _, channel := range channels {
channel := channel
if channel.FundingOutpoint == channelPoint {
return &channel, nil
}

View file

@ -1,6 +1,7 @@
package lnd
import (
"errors"
"fmt"
"strconv"
"strings"
@ -90,7 +91,7 @@ func (lc *LightningChannel) SignedCommitTx() (*wire.MsgTx, error) {
func ParseOutpoint(s string) (*wire.OutPoint, error) {
split := strings.Split(s, ":")
if len(split) != 2 {
return nil, fmt.Errorf("expecting channel point to be in " +
return nil, errors.New("expecting channel point to be in " +
"format of: txid:index")
}

View file

@ -2,6 +2,7 @@ package lnd
import (
"crypto/sha256"
"errors"
"fmt"
"strconv"
"strings"
@ -79,10 +80,10 @@ func DeriveChildren(key *hdkeychain.ExtendedKey, path []uint32) (
func ParsePath(path string) ([]uint32, error) {
path = strings.TrimSpace(path)
if len(path) == 0 {
return nil, fmt.Errorf("path cannot be empty")
return nil, errors.New("path cannot be empty")
}
if !strings.HasPrefix(path, "m/") {
return nil, fmt.Errorf("path must start with m/")
return nil, errors.New("path must start with m/")
}
parts := strings.Split(path, "/")
indices := make([]uint32, len(parts)-1)
@ -250,7 +251,7 @@ func DecodeAddressHash(addr string, chainParams *chaincfg.Params) ([]byte, bool,
targetHash = targetAddr.ScriptAddress()
default:
return nil, false, fmt.Errorf("address: must be a bech32 " +
return nil, false, errors.New("address: must be a bech32 " +
"P2WPKH or P2WSH address")
}
return targetHash, isScriptHash, nil
@ -589,7 +590,7 @@ func (r *HDKeyRing) CheckDescriptor(
// A check doesn't make sense if there is no public key set.
if keyDesc.PubKey == nil {
return fmt.Errorf("no public key provided to check")
return errors.New("no public key provided to check")
}
// Performance fix, derive static path only once.
@ -604,7 +605,7 @@ func (r *HDKeyRing) CheckDescriptor(
}
// Scan the same key range as lnd would do on channel restore.
for i := 0; i < keychain.MaxKeyRangeScan; i++ {
for i := range keychain.MaxKeyRangeScan {
child, err := DeriveChildren(familyKey, []uint32{uint32(i)})
if err != nil {
return err

View file

@ -2,6 +2,7 @@ package lnd
import (
"crypto/sha256"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcec/v2"
@ -119,7 +120,7 @@ func (s *Signer) SignOutputRawWithPrivateKey(tx *wire.MsgTx,
func (s *Signer) ComputeInputScript(_ *wire.MsgTx, _ *input.SignDescriptor) (
*input.Script, error) {
return nil, fmt.Errorf("unimplemented")
return nil, errors.New("unimplemented")
}
func (s *Signer) FetchPrivateKey(descriptor *keychain.KeyDescriptor) (

View file

@ -1,4 +1,4 @@
FROM golang:1.19.4-buster
FROM golang:1.22.3-bookworm
RUN apt-get update && apt-get install -y git
ENV GOCACHE=/tmp/build/.cache

View file

@ -1,10 +1,12 @@
module github.com/lightninglabs/chantools/tools
go 1.18
go 1.21
toolchain go1.22.4
require (
github.com/btcsuite/btcd v0.24.0
github.com/golangci/golangci-lint v1.51.2
github.com/golangci/golangci-lint v1.59.0
github.com/ory/go-acc v0.2.8
github.com/rinchsan/gosimports v0.1.5
)
@ -12,25 +14,30 @@ require (
require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
4d63.com/gochecknoglobals v0.2.1 // indirect
github.com/Abirdcfly/dupword v0.0.9 // indirect
github.com/Antonboom/errname v0.1.7 // indirect
github.com/Antonboom/nilnil v0.1.1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/4meepo/tagalign v1.3.4 // indirect
github.com/Abirdcfly/dupword v0.0.14 // indirect
github.com/Antonboom/errname v0.1.13 // indirect
github.com/Antonboom/nilnil v0.1.9 // indirect
github.com/Antonboom/testifylint v1.3.0 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/Crocmagnon/fatcontext v0.2.2 // indirect
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/OpenPeeDeeP/depguard v1.1.1 // indirect
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.2.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect
github.com/aead/siphash v1.0.1 // indirect
github.com/alecthomas/go-check-sumtype v0.1.4 // indirect
github.com/alexkohler/nakedret/v2 v2.0.4 // indirect
github.com/alexkohler/prealloc v1.0.0 // indirect
github.com/alingse/asasalint v0.0.11 // indirect
github.com/ashanbrown/forbidigo v1.4.0 // indirect
github.com/ashanbrown/forbidigo v1.6.0 // indirect
github.com/ashanbrown/makezero v1.1.1 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bkielbasa/cyclop v1.2.0 // indirect
github.com/bkielbasa/cyclop v1.2.1 // indirect
github.com/blizzy78/varnamelen v0.8.0 // indirect
github.com/bombsimon/wsl/v3 v3.4.0 // indirect
github.com/breml/bidichk v0.2.3 // indirect
github.com/breml/errchkjson v0.3.0 // indirect
github.com/bombsimon/wsl/v4 v4.2.1 // indirect
github.com/breml/bidichk v0.2.7 // indirect
github.com/breml/errchkjson v0.3.6 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.1.3 // indirect
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
@ -38,169 +45,175 @@ require (
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
github.com/btcsuite/winsvc v1.0.0 // indirect
github.com/butuzov/ireturn v0.1.1 // indirect
github.com/butuzov/ireturn v0.3.0 // indirect
github.com/butuzov/mirror v1.2.0 // indirect
github.com/catenacyber/perfsprint v0.7.1 // indirect
github.com/ccojocar/zxcvbn-go v1.0.2 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/charithe/durationcheck v0.0.9 // indirect
github.com/chavacava/garif v0.0.0-20221024190013-b3ef35877348 // indirect
github.com/charithe/durationcheck v0.0.10 // indirect
github.com/chavacava/garif v0.1.0 // indirect
github.com/ckaznocha/intrange v0.1.2 // indirect
github.com/curioswitch/go-reassign v0.2.0 // indirect
github.com/daixiang0/gci v0.9.1 // indirect
github.com/daixiang0/gci v0.13.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/decred/dcrd/lru v1.0.0 // indirect
github.com/denis-tingaikin/go-header v0.4.3 // indirect
github.com/denis-tingaikin/go-header v0.5.0 // indirect
github.com/dgraph-io/ristretto v0.0.2 // indirect
github.com/esimonov/ifshort v1.0.4 // indirect
github.com/ettle/strcase v0.1.1 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/ettle/strcase v0.2.0 // indirect
github.com/fatih/color v1.17.0 // indirect
github.com/fatih/structtag v1.2.0 // indirect
github.com/firefart/nonamedreturns v1.0.4 // indirect
github.com/firefart/nonamedreturns v1.0.5 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fzipp/gocyclo v0.6.0 // indirect
github.com/go-critic/go-critic v0.6.7 // indirect
github.com/ghostiam/protogetter v0.3.6 // indirect
github.com/go-critic/go-critic v0.11.4 // indirect
github.com/go-toolsmith/astcast v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.0.3 // indirect
github.com/go-toolsmith/astequal v1.1.0 // indirect
github.com/go-toolsmith/astcopy v1.1.0 // indirect
github.com/go-toolsmith/astequal v1.2.0 // indirect
github.com/go-toolsmith/astfmt v1.1.0 // indirect
github.com/go-toolsmith/astp v1.1.0 // indirect
github.com/go-toolsmith/strparse v1.1.0 // indirect
github.com/go-toolsmith/typep v1.1.0 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0-alpha.1 // indirect
github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gofrs/flock v0.8.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect
github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect
github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect
github.com/golangci/gofmt v0.0.0-20220901101216-f2edd75033f2 // indirect
github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect
github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect
github.com/golangci/misspell v0.4.0 // indirect
github.com/golangci/revgrep v0.0.0-20220804021717-745bb2f7c2e6 // indirect
github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 // indirect
github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect
github.com/golangci/misspell v0.5.1 // indirect
github.com/golangci/modinfo v0.3.4 // indirect
github.com/golangci/plugin-module-register v0.1.1 // indirect
github.com/golangci/revgrep v0.5.3 // indirect
github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gordonklaus/ineffassign v0.1.0 // indirect
github.com/gostaticanalysis/analysisutil v0.7.1 // indirect
github.com/gostaticanalysis/comment v1.4.2 // indirect
github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect
github.com/gostaticanalysis/nilerr v0.1.1 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hexops/gotextdiff v1.0.3 // indirect
github.com/inconshreveable/mousetrap v1.0.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/jgautheron/goconst v1.5.1 // indirect
github.com/jgautheron/goconst v1.7.1 // indirect
github.com/jingyugao/rowserrcheck v1.1.1 // indirect
github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect
github.com/jjti/go-spancheck v0.6.1 // indirect
github.com/jrick/logrotate v1.0.0 // indirect
github.com/julz/importas v0.1.0 // indirect
github.com/junk1tm/musttag v0.4.5 // indirect
github.com/kisielk/errcheck v1.6.3 // indirect
github.com/kisielk/gotool v1.0.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.3 // indirect
github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect
github.com/kisielk/errcheck v1.7.0 // indirect
github.com/kkHAIKE/contextcheck v1.1.5 // indirect
github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 // indirect
github.com/kulti/thelper v0.6.3 // indirect
github.com/kunwardeep/paralleltest v1.0.6 // indirect
github.com/kunwardeep/paralleltest v1.0.10 // indirect
github.com/kyoh86/exportloopref v0.1.11 // indirect
github.com/ldez/gomoddirectives v0.2.3 // indirect
github.com/ldez/tagliatelle v0.4.0 // indirect
github.com/leonklingele/grouper v1.1.1 // indirect
github.com/lasiar/canonicalheader v1.1.1 // indirect
github.com/ldez/gomoddirectives v0.2.4 // indirect
github.com/ldez/tagliatelle v0.5.0 // indirect
github.com/leonklingele/grouper v1.1.2 // indirect
github.com/lufeee/execinquery v1.2.1 // indirect
github.com/macabu/inamedparam v0.1.3 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/maratori/testableexamples v1.0.0 // indirect
github.com/maratori/testpackage v1.1.0 // indirect
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // indirect
github.com/maratori/testpackage v1.1.1 // indirect
github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.9 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mbilski/exhaustivestruct v1.2.0 // indirect
github.com/mgechev/revive v1.2.5 // indirect
github.com/mgechev/revive v1.3.7 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moricho/tparallel v0.2.1 // indirect
github.com/moricho/tparallel v0.3.1 // indirect
github.com/nakabonne/nestif v0.3.1 // indirect
github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect
github.com/nishanths/exhaustive v0.9.5 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/nishanths/exhaustive v0.12.0 // indirect
github.com/nishanths/predeclared v0.2.2 // indirect
github.com/nunnatsa/ginkgolinter v0.8.1 // indirect
github.com/nunnatsa/ginkgolinter v0.16.2 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/ory/viper v1.7.5 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polyfloyd/go-errorlint v1.1.0 // indirect
github.com/polyfloyd/go-errorlint v1.5.1 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/quasilyte/go-ruleguard v0.3.19 // indirect
github.com/quasilyte/go-ruleguard v0.4.2 // indirect
github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect
github.com/quasilyte/gogrep v0.5.0 // indirect
github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95 // indirect
github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect
github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect
github.com/ryancurrah/gomodguard v1.3.0 // indirect
github.com/ryanrolds/sqlclosecheck v0.4.0 // indirect
github.com/ryancurrah/gomodguard v1.3.2 // indirect
github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect
github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/sashamelentyev/interfacebloat v1.1.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.23.0 // indirect
github.com/securego/gosec/v2 v2.15.0 // indirect
github.com/sashamelentyev/usestdlibvars v1.25.0 // indirect
github.com/securego/gosec/v2 v2.20.1-0.20240525090044-5f0084eb01a9 // indirect
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
github.com/sivchari/containedctx v1.0.2 // indirect
github.com/sivchari/nosnakecase v1.7.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sivchari/containedctx v1.0.3 // indirect
github.com/sivchari/tenv v1.7.1 // indirect
github.com/sonatard/noctx v0.0.1 // indirect
github.com/sonatard/noctx v0.0.2 // indirect
github.com/sourcegraph/go-diff v0.7.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/cobra v1.6.1 // indirect
github.com/spf13/cobra v1.7.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.12.0 // indirect
github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect
github.com/stbenjam/no-sprintf-host-port v0.1.1 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/testify v1.8.1 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect
github.com/tdakkota/asciicheck v0.1.1 // indirect
github.com/tetafro/godot v1.4.11 // indirect
github.com/timakin/bodyclose v0.0.0-20221125081123-e39cf3fc478e // indirect
github.com/timonwong/loggercheck v0.9.3 // indirect
github.com/tomarrell/wrapcheck/v2 v2.8.0 // indirect
github.com/tdakkota/asciicheck v0.2.0 // indirect
github.com/tetafro/godot v1.4.16 // indirect
github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect
github.com/timonwong/loggercheck v0.9.4 // indirect
github.com/tomarrell/wrapcheck/v2 v2.8.3 // indirect
github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect
github.com/ultraware/funlen v0.0.3 // indirect
github.com/ultraware/whitespace v0.0.5 // indirect
github.com/uudashr/gocognit v1.0.6 // indirect
github.com/ultraware/funlen v0.1.0 // indirect
github.com/ultraware/whitespace v0.1.1 // indirect
github.com/uudashr/gocognit v1.1.2 // indirect
github.com/xen0n/gosmopolitan v1.2.2 // indirect
github.com/yagipy/maintidx v1.0.0 // indirect
github.com/yeya24/promlinter v0.2.0 // indirect
gitlab.com/bosi/decorder v0.2.3 // indirect
github.com/yeya24/promlinter v0.3.0 // indirect
github.com/ykadowak/zerologlint v0.1.5 // indirect
gitlab.com/bosi/decorder v0.4.2 // indirect
go-simpler.org/musttag v0.12.2 // indirect
go-simpler.org/sloglint v0.7.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/automaxprocs v1.5.3 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.17.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.21.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/tools v0.4.2 // indirect
mvdan.cc/gofumpt v0.4.0 // indirect
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect
mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect
honnef.co/go/tools v0.4.7 // indirect
mvdan.cc/gofumpt v0.6.0 // indirect
mvdan.cc/unparam v0.0.0-20240427195214-063aff900ca1 // indirect
)

File diff suppressed because it is too large Load diff