Skip to content

Commit c6ffe38

Browse files
authored
Merge pull request #157 from lightninglabs/fix-sweeptimelockmanual
Fix sweeptimelockmanual, bump version to v0.13.3
2 parents 2d40071 + 984567b commit c6ffe38

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

cmd/chantools/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const (
3131
// version is the current version of the tool. It is set during build.
3232
// NOTE: When changing this, please also update the version in the
3333
// download link shown in the README.
34-
version = "0.13.2"
34+
version = "0.13.3"
3535
na = "n/a"
3636

3737
// lndVersion is the current version of lnd that we support. This is

cmd/chantools/sweeptimelockmanual.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
const (
2323
keyBasePath = "m/1017'/%d'"
2424
maxKeys = 500
25-
maxPoints = 500
25+
maxPoints = 1000
2626
)
2727

2828
type sweepTimeLockManualCommand struct {
@@ -263,7 +263,7 @@ func sweepTimeLockManual(extendedKey *hdkeychain.ExtendedKey, apiURL string,
263263
// brute force the script with the information we have. If not, we can't
264264
// continue anyway.
265265
lockScript, err := lnd.PrepareWalletAddress(
266-
sweepAddr, chainParams, nil, extendedKey, "time lock",
266+
timeLockAddr, chainParams, nil, extendedKey, "time lock",
267267
)
268268
if err != nil {
269269
return err

cmd/chantools/sweeptimelockmanual_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ var sweepTimeLockManualCases = []struct {
1818
keyIndex uint32
1919
timeLockAddr string
2020
remoteRevPubKey string
21+
params *chaincfg.Params
2122
}{{
2223
// New format with ECDH revocation root.
2324
baseKey: "tprv8dgoXnQWBN4CGGceRYMW495kWcrUZKZVFwMmbzpduFp1D4pi" +
@@ -27,6 +28,7 @@ var sweepTimeLockManualCases = []struct {
2728
"lx9xesmcl5qx",
2829
remoteRevPubKey: "03235261ed5aaaf9fec0e91d5e1a4d17f1a2c7442f1c43806d" +
2930
"32c9bd34abd002a3",
31+
params: &chaincfg.RegressionNetParams,
3032
}, {
3133
// Old format with plain private key as revocation root.
3234
baseKey: "tprv8dgoXnQWBN4CGGceRYMW495kWcrUZKZVFwMmbzpduFp1D4pi" +
@@ -36,6 +38,7 @@ var sweepTimeLockManualCases = []struct {
3638
"hs8xlsfdc3zf",
3739
remoteRevPubKey: "03e82cdf164ce5aba253890e066129f134ca8d7e072ce5ad55" +
3840
"c721b9a13545ee04",
41+
params: &chaincfg.RegressionNetParams,
3942
}, {
4043
// New format with ECDH revocation root.
4144
baseKey: "tprv8fCiPGhoYhWESQg3kgubCizcHo21drnP9Fa5j9fFKCmbME" +
@@ -45,6 +48,7 @@ var sweepTimeLockManualCases = []struct {
4548
"3rlw45qzmjqrr",
4649
remoteRevPubKey: "02dfecdc259a7e1cff36a67328ded3b4dae30369a3035e4f91" +
4750
"1ce7ac4a80b28e5d",
51+
params: &chaincfg.RegressionNetParams,
4852
}, {
4953
// Old format with plain private key as revocation root. Test data
5054
// created with lnd v0.12.0-beta (old shachain root creation)
@@ -55,6 +59,7 @@ var sweepTimeLockManualCases = []struct {
5559
"dst0wsk0xags",
5660
remoteRevPubKey: "03647afa9c04025e997a5b7ecd2dd949f8f60f6880a94af73a" +
5761
"0d4f48f166d127d1",
62+
params: &chaincfg.RegressionNetParams,
5863
}, {
5964
// New format with ECDH revocation root but this test data was created
6065
// when already the old format was present, this leads to the situation
@@ -69,6 +74,7 @@ var sweepTimeLockManualCases = []struct {
6974
"rhetju2srseqrh",
7075
remoteRevPubKey: "0341692a025ad552c62689a630ff24d9439e3752d8e0ac5cb4" +
7176
"1b5e71ab2bd46d0f",
77+
params: &chaincfg.RegressionNetParams,
7278
}, {
7379
// Anchor channel with lnd 0.18.x-beta.
7480
rootKey: "tprv8ZgxMBicQKsPdRiEUwMA71fkU9XoiPakhuSAEGCfcpgZxraB" +
@@ -79,6 +85,7 @@ var sweepTimeLockManualCases = []struct {
7985
"sup4qa2384v",
8086
remoteRevPubKey: "028a2199d9c64f21b59c01a5d5429fbe78b8709f0270deaf91" +
8187
"578f682b87a12796",
88+
params: &chaincfg.RegressionNetParams,
8289
}}
8390

8491
func TestSweepTimeLockManual(t *testing.T) {
@@ -87,7 +94,7 @@ func TestSweepTimeLockManual(t *testing.T) {
8794
// brute force the script with the information we have. If not,
8895
// we can't continue anyway.
8996
lockScript, err := lnd.GetP2WSHScript(
90-
tc.timeLockAddr, &chaincfg.RegressionNetParams,
97+
tc.timeLockAddr, tc.params,
9198
)
9299
require.NoError(t, err)
93100

@@ -108,7 +115,7 @@ func TestSweepTimeLockManual(t *testing.T) {
108115

109116
_, _, _, _, _, err = tryKey(
110117
baseKey, revPubKey, 0, defaultCsvLimit, lockScript,
111-
tc.keyIndex, 500,
118+
tc.keyIndex, 1000,
112119
)
113120
require.NoError(t, err)
114121
}

0 commit comments

Comments
 (0)