Skip to content
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
4 changes: 2 additions & 2 deletions cmd/loop/openchannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"

"github.com/lightninglabs/loop/looprpc"
lndcommands "github.com/lightningnetwork/lnd/cmd/commands"
"github.com/lightningnetwork/lnd"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Importing "github.com/lightningnetwork/lnd" directly is invalid because the root package of lnd is package main (as it contains the daemon's main.go), which cannot be imported as a library in Go. This will result in a compilation error. The CLI helper UtxosToOutpoints should still be imported from "github.com/lightningnetwork/lnd/cmd/commands".

Suggested change
"github.com/lightningnetwork/lnd"
lndcommands "github.com/lightningnetwork/lnd/cmd/commands"

"github.com/lightningnetwork/lnd/lnrpc"
"github.com/urfave/cli/v3"
)
Expand Down Expand Up @@ -271,7 +271,7 @@ func openChannel(ctx context.Context, cmd *cli.Command) error {
if cmd.IsSet("utxo") {
utxos := cmd.StringSlice("utxo")

outpoints, err := lndcommands.UtxosToOutpoints(utxos)
outpoints, err := lnd.UtxosToOutpoints(utxos)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Use lndcommands.UtxosToOutpoints instead of lnd.UtxosToOutpoints to match the correct import of "github.com/lightningnetwork/lnd/cmd/commands".

Suggested change
outpoints, err := lnd.UtxosToOutpoints(utxos)
outpoints, err := lndcommands.UtxosToOutpoints(utxos)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to note that it was these exact uses of "github.com/lightningnetwork/lnd/cmd/commands" that were the main cause of why loop v32+ was incompatible with a litd version that shipped lnd v21. So I think this lnd.UtxosToOutpoints is what you'd like. I can test this PR tomorrow with litd to verify.

if err != nil {
return fmt.Errorf("unable to decode utxos: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/loop/staticaddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/lightninglabs/loop/staticaddr/deposit"
"github.com/lightninglabs/loop/staticaddr/loopin"
"github.com/lightninglabs/loop/swapserverrpc"
lndcommands "github.com/lightningnetwork/lnd/cmd/commands"
"github.com/lightningnetwork/lnd"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Importing "github.com/lightningnetwork/lnd" directly is invalid because the root package of lnd is package main (as it contains the daemon's main.go), which cannot be imported as a library in Go. This will result in a compilation error. The CLI helper UtxosToOutpoints should still be imported from "github.com/lightningnetwork/lnd/cmd/commands".

Suggested change
"github.com/lightningnetwork/lnd"
lndcommands "github.com/lightningnetwork/lnd/cmd/commands"

"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/routing/route"
"github.com/urfave/cli/v3"
Expand Down Expand Up @@ -192,7 +192,7 @@ func withdraw(ctx context.Context, cmd *cli.Command) error {
case isAllSelected:
case isUtxoSelected:
utxos := cmd.StringSlice("utxo")
outpoints, err = lndcommands.UtxosToOutpoints(utxos)
outpoints, err = lnd.UtxosToOutpoints(utxos)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

Use lndcommands.UtxosToOutpoints instead of lnd.UtxosToOutpoints to match the correct import of "github.com/lightningnetwork/lnd/cmd/commands".

Suggested change
outpoints, err = lnd.UtxosToOutpoints(utxos)
outpoints, err = lndcommands.UtxosToOutpoints(utxos)

if err != nil {
return err
}
Expand Down
20 changes: 5 additions & 15 deletions docs/loop.1
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,22 @@ loop - control plane for your loopd
.PP
loop

.PP
.RS

.nf
.EX
[--help|-h]
[--loopdir]=[value]
[--macaroonpath]=[value]
[--network|-n]=[value]
[--rpcserver]=[value]
[--tlscertpath]=[value]
[--version|-v]

.fi
.RE
.EE

.PP
\fBUsage\fP:

.PP
.RS

.nf
.EX
loop [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]

.fi
.RE
.EE


.SH GLOBAL OPTIONS
Expand Down Expand Up @@ -497,7 +487,7 @@ htlc_timeout_swept
wait_for_expiry_sweep
expired
failed
.
\&.

.PP
\fB--help, -h\fP: show help
Expand Down
80 changes: 38 additions & 42 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
module github.com/lightninglabs/loop

require (
github.com/btcsuite/btcd v0.24.3-0.20250318170759-4f4ea81776d6
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd v0.25.1-0.20260310163610-1c55c7c18179
github.com/btcsuite/btcd/btcec/v2 v2.3.6
github.com/btcsuite/btcd/btcutil v1.1.6
github.com/btcsuite/btcd/btcutil/psbt v1.1.10
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
github.com/btcsuite/btclog/v2 v2.0.1-0.20250728225537-6090e87c6c5b
github.com/btcsuite/btcwallet v0.16.17
github.com/btcsuite/btcwallet v0.16.18
github.com/btcsuite/btcwallet/wtxmgr v1.5.6
github.com/davecgh/go-spew v1.1.1
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
github.com/fortytw2/leaktest v1.3.0
github.com/golang-migrate/migrate/v4 v4.17.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0
github.com/jackc/pgconn v1.14.3
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
github.com/jackc/pgx/v5 v5.9.2
github.com/jessevdk/go-flags v1.4.0
github.com/jessevdk/go-flags v1.6.1
github.com/lib/pq v1.10.9
github.com/lightninglabs/aperture v0.3.13-beta
github.com/lightninglabs/lndclient v0.20.0-8
github.com/lightninglabs/aperture v0.4.0
github.com/lightninglabs/lndclient v0.21.0-1
github.com/lightninglabs/loop/looprpc v1.0.7
github.com/lightninglabs/loop/swapserverrpc v1.0.14
github.com/lightninglabs/taproot-assets v0.7.0
github.com/lightninglabs/taproot-assets/taprpc v1.0.11
github.com/lightningnetwork/lnd v0.20.1-beta
github.com/lightninglabs/taproot-assets v0.8.0
github.com/lightninglabs/taproot-assets/taprpc v1.1.0
github.com/lightningnetwork/lnd v0.21.0-beta
github.com/lightningnetwork/lnd/cert v1.2.2
github.com/lightningnetwork/lnd/clock v1.1.1
github.com/lightningnetwork/lnd/queue v1.1.1
github.com/lightningnetwork/lnd/queue v1.2.0
github.com/lightningnetwork/lnd/ticker v1.1.1
github.com/lightningnetwork/lnd/tlv v1.3.2
github.com/lightningnetwork/lnd/tor v1.1.6
Expand All @@ -38,7 +38,7 @@ require (
github.com/urfave/cli/v3 v3.4.1
go.etcd.io/bbolt v1.4.3
golang.org/x/sync v0.19.0
google.golang.org/grpc v1.79.3
google.golang.org/grpc v1.80.0
google.golang.org/protobuf v1.36.11
gopkg.in/macaroon-bakery.v2 v2.3.0
gopkg.in/macaroon.v2 v2.1.0
Expand All @@ -57,9 +57,9 @@ require (
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/btclog v0.0.0-20241003133417-09c4e92e319c // indirect
github.com/btcsuite/btcd/v2transport v1.0.1 // indirect
github.com/btcsuite/btclog v1.0.0 // indirect
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 // indirect
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 // indirect
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 // indirect
Expand All @@ -76,12 +76,12 @@ require (
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/decred/dcrd/crypto/blake256 v1.1.0 // indirect
github.com/decred/dcrd/lru v1.1.2 // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/cli v29.2.0+incompatible // indirect
github.com/docker/go-connections v0.6.0 // indirect
github.com/docker/cli v29.4.1+incompatible // indirect
github.com/docker/go-connections v0.7.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand Down Expand Up @@ -113,11 +113,9 @@ require (
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgtype v1.14.4 // indirect
github.com/jackc/pgx/v4 v4.18.3 // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jackpal/gateway v1.0.5 // indirect
github.com/jackpal/go-nat-pmp v0.0.0-20170405195558-28a68d0c24ad // indirect
github.com/jedib0t/go-pretty/v6 v6.2.7 // indirect
github.com/jonboulle/clockwork v0.2.2 // indirect
github.com/jrick/logrotate v1.1.2 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -127,22 +125,22 @@ require (
github.com/libdns/libdns v0.2.1 // indirect
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.4-0.20250610182311-2f1d46ef18b7 // indirect
github.com/lightninglabs/neutrino v0.16.1 // indirect
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240815225420-8b40adf04ab9 // indirect
github.com/lightninglabs/neutrino v0.17.1 // indirect
github.com/lightninglabs/neutrino/cache v1.1.3 // indirect
github.com/lightningnetwork/lightning-onion v1.3.0 // indirect
github.com/lightningnetwork/lnd/actor v0.0.6 // indirect
github.com/lightningnetwork/lnd/fn/v2 v2.0.9 // indirect
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
github.com/lightningnetwork/lnd/kvdb v1.4.16 // indirect
github.com/lightningnetwork/lnd/sqldb v1.0.12-0.20260113193010-8565d12e40b1 // indirect
github.com/lightningnetwork/lnd/sqldb v1.0.13 // indirect
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mholt/acmez v1.0.4 // indirect
github.com/miekg/dns v1.1.50 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/moby/api v1.53.0 // indirect
github.com/moby/moby/client v0.2.2 // indirect
github.com/moby/moby/api v1.54.2 // indirect
github.com/moby/moby/client v0.4.1 // indirect
github.com/moby/sys/user v0.3.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -157,17 +155,15 @@ require (
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rogpeppe/fastuuid v1.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/soheilhy/cmux v0.1.5 // indirect
github.com/spf13/pflag v1.0.6 // indirect
github.com/spf13/pflag v1.0.9 // 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/tv42/zbase32 v0.0.0-20160707012821-501572607d02 // indirect
github.com/urfave/cli v1.22.14 // 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
Expand Down Expand Up @@ -195,18 +191,18 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.24.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/crypto v0.47.0 // indirect
golang.org/x/exp v0.0.0-20250811191247-51f88131bc50 // indirect
golang.org/x/mod v0.31.0 // indirect
golang.org/x/net v0.49.0 // indirect
golang.org/x/sys v0.42.0 // indirect
golang.org/x/term v0.38.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/term v0.41.0 // indirect
golang.org/x/text v0.33.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.39.0 // indirect
golang.org/x/tools v0.40.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217
google.golang.org/genproto/googleapis/api v0.0.0-20260120221211-b8f7ae30c516 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516
gopkg.in/errgo.v1 v1.0.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand All @@ -224,7 +220,7 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d

// We are using a fork of the migration library with custom functionality that
// did not yet make it into the upstream repository.
replace github.com/golang-migrate/migrate/v4 => github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2
replace github.com/golang-migrate/migrate/v4 => github.com/lightninglabs/migrate/v4 v4.18.2-9023d66a-fork-pr-2.0.20251211093704-71c1eef09789

replace lukechampine.com/uint128 => github.com/lukechampine/uint128 v1.2.0

Expand All @@ -242,4 +238,4 @@ replace gonum.org/v1/plot => github.com/gonum/plot v0.10.1
// checking later if the domain reappears and replace can be removed.
replace dario.cat/mergo => github.com/darccio/mergo v1.0.1

go 1.25.5
go 1.25.10
Loading
Loading