Skip to content

Commit e7f7823

Browse files
authored
Merge pull request #192 from lightninglabs/lnd-update
Update to latest lnd 0.19 version
2 parents 42bce83 + 5f262f1 commit e7f7823

File tree

11 files changed

+227
-1256
lines changed

11 files changed

+227
-1256
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
# go needs absolute directories, using the $HOME variable doesn't work here.
1717
GOCACHE: /home/runner/work/go/pkg/build
1818
GOPATH: /home/runner/work/go
19-
GO_VERSION: 1.23.6
19+
GO_VERSION: 1.23.9
2020

2121
jobs:
2222
########################

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ Available Commands:
424424
filterbackup Filter an lnd channel.backup file and remove certain channels
425425
fixoldbackup Fixes an old channel.backup file that is affected by the lnd issue #3881 (unable to derive shachain root key)
426426
forceclose Force-close the last state that is in the channel.db provided
427+
scbforceclose Force-close the last state that is in the SCB provided
427428
genimportscript Generate a script containing the on-chain keys of an lnd wallet that can be imported into other software like bitcoind
428429
migratedb Apply all recent lnd channel database migrations
429430
pullanchor Attempt to CPFP an anchor output of a channel
@@ -496,6 +497,7 @@ Legend:
496497
| [removechannel](doc/chantools_removechannel.md) | (:skull: :warning:) Remove a single channel from a `channel.db` file |
497498
| [rescueclosed](doc/chantools_rescueclosed.md) | :pencil: (:pushpin:) Rescue funds in a legacy (pre `STATIC_REMOTE_KEY`) channel output |
498499
| [rescuefunding](doc/chantools_rescuefunding.md) | :pencil: (:pushpin:) Rescue funds from a funding transaction. Deprecated, use [zombierecovery](doc/chantools_zombierecovery.md) instead |
500+
| [scbforceclose](doc/chantools_scbforceclose.md) | :pencil: :warning: :skull: Force close a channel using the latest state from a channel backup. EXTREMELY DANGEROUS, read help text! |
499501
| [showrootkey](doc/chantools_showrootkey.md) | :pencil: Display the master root key (`xprv`) from your seed (DO NOT SHARE WITH ANYONE) |
500502
| [signmessage](doc/chantools_signmessage.md) | :pencil: Sign a message with the nodes identity pubkey. |
501503
| [signpsbt](doc/chantools_signpsbt.md) | :pencil: Sign a Partially Signed Bitcoin Transaction (PSBT) |

doc/chantools.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ https://github.com/lightninglabs/chantools/.
4343
* [chantools rescueclosed](chantools_rescueclosed.md) - Try finding the private keys for funds that are in outputs of remotely force-closed channels
4444
* [chantools rescuefunding](chantools_rescuefunding.md) - Rescue funds locked in a funding multisig output that never resulted in a proper channel; this is the command the initiator of the channel needs to run
4545
* [chantools rescuetweakedkey](chantools_rescuetweakedkey.md) - Attempt to rescue funds locked in an address with a key that was affected by a specific bug in lnd
46+
* [chantools scbforceclose](chantools_scbforceclose.md) - Force-close the last state that is in the SCB provided
4647
* [chantools showrootkey](chantools_showrootkey.md) - Extract and show the BIP32 HD root key from the 24 word lnd aezeed
4748
* [chantools signmessage](chantools_signmessage.md) - Sign a message with the node's private key.
4849
* [chantools signpsbt](chantools_signpsbt.md) - Sign a Partially Signed Bitcoin Transaction (PSBT)

doc/chantools_forceclose.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ Force-close the last state that is in the channel.db provided
44

55
### Synopsis
66

7-
If you are certain that a node is offline for good (AFTER
8-
you've tried SCB!) and a channel is still open, you can use this method to
9-
force-close your latest state that you have in your channel.db.
7+
8+
If you are certain that a node is offline for good (AFTER you've tried SCB!)
9+
and a channel is still open, you can use this method to force-close your
10+
latest state that you have in your channel.db.
1011

1112
**!!! WARNING !!! DANGER !!! WARNING !!!**
1213

doc/chantools_scbforceclose.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## chantools scbforceclose
2+
3+
Force-close the last state that is in the SCB provided
4+
5+
### Synopsis
6+
7+
8+
If you are certain that a node is offline for good (AFTER you've tried SCB!)
9+
and a channel is still open, you can use this method to force-close your
10+
latest state that you have in your channel.db.
11+
12+
**!!! WARNING !!! DANGER !!! WARNING !!!**
13+
14+
If you do this and the state that you publish is *not* the latest state, then
15+
the remote node *could* punish you by taking the whole channel amount *if* they
16+
come online before you can sweep the funds from the time locked (144 - 2000
17+
blocks) transaction *or* they have a watch tower looking out for them.
18+
19+
**This should absolutely be the last resort and you have been warned!**
20+
21+
```
22+
chantools scbforceclose [flags]
23+
```
24+
25+
### Examples
26+
27+
```
28+
chantools scbforceclose --multi_file channel.backup
29+
```
30+
31+
### Options
32+
33+
```
34+
--apiurl string API URL to use (must be esplora compatible) (default "https://api.node-recovery.com")
35+
--bip39 read a classic BIP39 seed and passphrase from the terminal instead of asking for lnd seed format or providing the --rootkey flag
36+
-h, --help help for scbforceclose
37+
--multi_backup string a hex encoded multi-channel backup obtained from exportchanbackup for force-closing channels
38+
--multi_file string the path to a single-channel backup file (channel.backup)
39+
--publish publish force-closing TX to the chain API instead of just printing the TX
40+
--rootkey string BIP32 HD root key of the wallet to use for decrypting the backup and signing tx; leave empty to prompt for lnd 24 word aezeed
41+
--single_backup string a hex encoded single channel backup obtained from exportchanbackup for force-closing channels
42+
--single_file string the path to a single-channel backup file
43+
--walletdb string read the seed/master root key to use for decrypting the backup and signing tx from an lnd wallet.db file instead of asking for a seed or providing the --rootkey flag
44+
```
45+
46+
### Options inherited from parent commands
47+
48+
```
49+
-r, --regtest Indicates if regtest parameters should be used
50+
-s, --signet Indicates if the public signet parameters should be used
51+
-t, --testnet Indicates if testnet parameters should be used
52+
```
53+
54+
### SEE ALSO
55+
56+
* [chantools](chantools.md) - Chantools helps recover funds from lightning channels
57+

go.mod

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,36 @@
11
module github.com/lightninglabs/chantools
22

3-
go 1.23.6
3+
go 1.23.9
44

55
require (
6-
github.com/btcsuite/btcd v0.24.3-0.20241210095828-e646d437e95b
6+
github.com/btcsuite/btcd v0.24.3-0.20250318170759-4f4ea81776d6
77
github.com/btcsuite/btcd/btcec/v2 v2.3.4
88
github.com/btcsuite/btcd/btcutil v1.1.5
99
github.com/btcsuite/btcd/btcutil/psbt v1.1.10
1010
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
1111
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c // indirect
12-
github.com/btcsuite/btcwallet v0.16.10-0.20241127094224-93c858b2ad63
12+
github.com/btcsuite/btcwallet v0.16.13
1313
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 // indirect
14-
github.com/btcsuite/btcwallet/walletdb v1.4.4
14+
github.com/btcsuite/btcwallet/walletdb v1.5.1
1515
github.com/coreos/bbolt v1.3.3
1616
github.com/davecgh/go-spew v1.1.1
1717
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
1818
github.com/gogo/protobuf v1.3.2 // indirect
1919
github.com/hasura/go-graphql-client v0.9.1
20-
github.com/lightninglabs/loop v0.29.0-beta.rc2.0.20250306160707-1091a628755c
21-
github.com/lightninglabs/pool v0.6.5-beta.0.20250305125211-4e860ec4e77f
20+
github.com/lightninglabs/loop v0.31.1-beta.0.20250527112532-ca8610e68e18
21+
github.com/lightninglabs/loop/swapserverrpc v1.0.14 // indirect
22+
github.com/lightninglabs/pool v0.6.6-beta
2223
// The current version of lnd we are compatible with, mostly affects the
2324
// commands that touch the channel DB and has an impact on the DB schema.
2425
// NOTE: When updating this version, make sure to also update the string in
2526
// cmd/chantools/root.go and run "make docs".
26-
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20250304192711-9feb761b4ec4
27-
github.com/lightningnetwork/lnd/kvdb v1.4.12
27+
github.com/lightningnetwork/lnd v0.19.0-beta
28+
github.com/lightningnetwork/lnd/kvdb v1.4.16
2829
github.com/lightningnetwork/lnd/queue v1.1.1
2930
github.com/lightningnetwork/lnd/ticker v1.1.1
30-
github.com/lightningnetwork/lnd/tor v1.1.4
31+
github.com/lightningnetwork/lnd/tor v1.1.6
3132
github.com/spf13/cobra v1.1.3
32-
github.com/stretchr/testify v1.9.0
33+
github.com/stretchr/testify v1.10.0
3334
go.etcd.io/bbolt v1.3.11
3435
golang.org/x/crypto v0.36.0
3536
golang.org/x/oauth2 v0.22.0
@@ -45,30 +46,29 @@ require (
4546
dario.cat/mergo v1.0.1 // indirect
4647
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
4748
github.com/Masterminds/semver/v3 v3.2.0 // indirect
48-
github.com/Microsoft/go-winio v0.6.1 // indirect
49+
github.com/Microsoft/go-winio v0.6.2 // indirect
4950
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
5051
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344 // indirect
5152
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
5253
github.com/aead/siphash v1.0.1 // indirect
5354
github.com/beorn7/perks v1.0.1 // indirect
5455
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 // indirect
5556
github.com/btcsuite/btcwallet/wallet/txsizes v1.2.5 // indirect
56-
github.com/btcsuite/btcwallet/wtxmgr v1.5.4 // indirect
57+
github.com/btcsuite/btcwallet/wtxmgr v1.5.6 // indirect
5758
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect
5859
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect
5960
github.com/btcsuite/winsvc v1.0.0 // indirect
6061
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
6162
github.com/cespare/xxhash/v2 v2.3.0 // indirect
6263
github.com/containerd/continuity v0.3.0 // indirect
6364
github.com/coreos/go-semver v0.3.0 // indirect
64-
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
65-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
65+
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
66+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
6667
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
6768
github.com/decred/dcrd/lru v1.1.2 // indirect
68-
github.com/distribution/reference v0.6.0 // indirect
69-
github.com/docker/cli v27.1.1+incompatible // indirect
70-
github.com/docker/docker v27.1.1+incompatible // indirect
71-
github.com/docker/go-connections v0.4.0 // indirect
69+
github.com/docker/cli v28.0.1+incompatible // indirect
70+
github.com/docker/docker v28.0.1+incompatible // indirect
71+
github.com/docker/go-connections v0.5.0 // indirect
7272
github.com/docker/go-units v0.5.0 // indirect
7373
github.com/dustin/go-humanize v1.0.1 // indirect
7474
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
@@ -77,6 +77,7 @@ require (
7777
github.com/go-errors/errors v1.0.1 // indirect
7878
github.com/go-logr/logr v1.4.2 // indirect
7979
github.com/go-logr/stdr v1.2.2 // indirect
80+
github.com/go-macaroon-bakery/macaroonpb v1.0.0 // indirect
8081
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
8182
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
8283
github.com/golang-migrate/migrate/v4 v4.17.0 // indirect
@@ -108,33 +109,32 @@ require (
108109
github.com/jonboulle/clockwork v0.2.2 // indirect
109110
github.com/jrick/logrotate v1.1.2 // indirect
110111
github.com/json-iterator/go v1.1.12 // indirect
111-
github.com/juju/loggo v0.0.0-20210728185423-eebad3a902c4 // indirect
112112
github.com/kkdai/bstream v1.0.0 // indirect
113113
github.com/klauspost/compress v1.17.9 // indirect
114114
github.com/lib/pq v1.10.9 // indirect
115115
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
116-
github.com/lightninglabs/lndclient v0.19.0-2 // indirect
117-
github.com/lightninglabs/loop/swapserverrpc v1.0.12 // indirect
118-
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd // indirect
116+
github.com/lightninglabs/lndclient v0.19.0-7 // indirect
117+
github.com/lightninglabs/neutrino v0.16.1 // indirect
119118
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
120-
github.com/lightninglabs/pool/auctioneerrpc v1.1.2 // indirect
119+
github.com/lightninglabs/pool/auctioneerrpc v1.1.3 // indirect
121120
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect
122121
github.com/lightningnetwork/lnd/clock v1.1.1 // indirect
123122
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
124-
github.com/lightningnetwork/lnd/sqldb v1.0.7 // indirect
125-
github.com/lightningnetwork/lnd/tlv v1.3.0 // indirect
123+
github.com/lightningnetwork/lnd/sqldb v1.0.9 // indirect
124+
github.com/lightningnetwork/lnd/tlv v1.3.1 // indirect
126125
github.com/ltcsuite/ltcd v0.0.0-20191228044241-92166e412499 // indirect
127126
github.com/mattn/go-isatty v0.0.20 // indirect
128127
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
129128
github.com/miekg/dns v1.1.50 // indirect
130129
github.com/moby/docker-image-spec v1.3.1 // indirect
130+
github.com/moby/sys/user v0.3.0 // indirect
131131
github.com/moby/term v0.5.0 // indirect
132132
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
133133
github.com/modern-go/reflect2 v1.0.2 // indirect
134134
github.com/ncruces/go-strftime v0.1.9 // indirect
135135
github.com/opencontainers/go-digest v1.0.0 // indirect
136-
github.com/opencontainers/image-spec v1.0.2 // indirect
137-
github.com/opencontainers/runc v1.1.14 // indirect
136+
github.com/opencontainers/image-spec v1.1.0 // indirect
137+
github.com/opencontainers/runc v1.2.0 // indirect
138138
github.com/ory/dockertest/v3 v3.10.0 // indirect
139139
github.com/pkg/errors v0.9.1 // indirect
140140
github.com/pmezard/go-difflib v1.0.0 // indirect
@@ -144,16 +144,14 @@ require (
144144
github.com/prometheus/procfs v0.8.0 // indirect
145145
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
146146
github.com/rogpeppe/fastuuid v1.2.0 // indirect
147-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
147+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
148148
github.com/shopspring/decimal v1.3.1 // indirect
149-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
150-
github.com/sirupsen/logrus v1.9.2 // indirect
149+
github.com/sirupsen/logrus v1.9.3 // indirect
151150
github.com/soheilhy/cmux v0.1.5 // indirect
152151
github.com/spf13/pflag v1.0.5 // indirect
153152
github.com/stretchr/objx v0.5.2 // indirect
154153
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
155154
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
156-
github.com/xdg-go/stringprep v1.0.4 // indirect
157155
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
158156
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
159157
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
@@ -167,35 +165,35 @@ require (
167165
go.etcd.io/etcd/pkg/v3 v3.5.12 // indirect
168166
go.etcd.io/etcd/raft/v3 v3.5.12 // indirect
169167
go.etcd.io/etcd/server/v3 v3.5.12 // indirect
170-
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
171-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect
172-
go.opentelemetry.io/otel v1.32.0 // indirect
173-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.20.0 // indirect
168+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
169+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
170+
go.opentelemetry.io/otel v1.35.0 // indirect
171+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect
174172
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.20.0 // indirect
175-
go.opentelemetry.io/otel/metric v1.32.0 // indirect
176-
go.opentelemetry.io/otel/sdk v1.21.0 // indirect
177-
go.opentelemetry.io/otel/trace v1.32.0 // indirect
178-
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
173+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
174+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
175+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
176+
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
179177
go.uber.org/atomic v1.10.0 // indirect
180178
go.uber.org/mock v0.4.0 // indirect
181179
go.uber.org/multierr v1.6.0 // indirect
182180
go.uber.org/zap v1.23.0 // indirect
183181
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8 // indirect
184-
golang.org/x/mod v0.17.0 // indirect
182+
golang.org/x/mod v0.21.0 // indirect
185183
golang.org/x/net v0.38.0 // indirect
186184
golang.org/x/sync v0.12.0 // indirect
187185
golang.org/x/sys v0.31.0 // indirect
188186
golang.org/x/term v0.30.0 // indirect
189187
golang.org/x/text v0.23.0 // indirect
190-
golang.org/x/time v0.3.0 // indirect
191-
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
192-
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
188+
golang.org/x/time v0.5.0 // indirect
189+
golang.org/x/tools v0.24.0 // indirect
190+
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
193191
google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect
194192
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
195193
google.golang.org/grpc v1.65.0 // indirect
196194
google.golang.org/protobuf v1.34.2 // indirect
197195
gopkg.in/errgo.v1 v1.0.1 // indirect
198-
gopkg.in/macaroon-bakery.v2 v2.1.0 // indirect
196+
gopkg.in/macaroon-bakery.v2 v2.3.0 // indirect
199197
gopkg.in/macaroon.v2 v2.1.0 // indirect
200198
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
201199
gopkg.in/yaml.v2 v2.4.0 // indirect
@@ -205,6 +203,7 @@ require (
205203
modernc.org/memory v1.8.0 // indirect
206204
modernc.org/sqlite v1.34.5 // indirect
207205
nhooyr.io/websocket v1.8.7 // indirect
206+
pgregory.net/rapid v1.2.0 // indirect
208207
sigs.k8s.io/yaml v1.2.0 // indirect
209208
)
210209

0 commit comments

Comments
 (0)