Skip to content

Commit 179d625

Browse files
authored
Merge pull request #7155 from Roasbeef/v0-15-5-branch-rc1
release: create v0.15.5-rc1 release branch
2 parents 96fe51e + 24b0b6d commit 179d625

File tree

12 files changed

+148
-70
lines changed

12 files changed

+148
-70
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Release Notes
2+
3+
## Bug Fixes
4+
5+
* [A Taproot related key tweak issue was fixed in `btcd` that affected remote
6+
signing setups](https://github.com/lightningnetwork/lnd/pull/7130).
7+
8+
* [Sleep for one second when funding locked message is not
9+
received](https://github.com/lightningnetwork/lnd/pull/7095) to avoid CPU
10+
spike.
11+
12+
# Contributors (Alphabetical Order)
13+
14+
* Oliver Gugger
15+
* Yong Yu

funding/config_rpctest.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build rpctest
2+
3+
package funding
4+
5+
import "time"
6+
7+
func init() {
8+
// For itest, we will use a much shorter checking interval here as
9+
// local communications are very fast.
10+
checkPeerFundingLockInterval = 10 * time.Millisecond
11+
}

funding/manager.go

Lines changed: 59 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ var (
3939
// byteOrder defines the endian-ness we use for encoding to and from
4040
// buffers.
4141
byteOrder = binary.BigEndian
42+
43+
// checkPeerFundingLockInterval is used when we are waiting for the
44+
// peer to send us FundingLocked. We will check every 1 second to see
45+
// if the message is received.
46+
//
47+
// NOTE: for itest, this value is changed to 10ms.
48+
checkPeerFundingLockInterval = 1 * time.Second
4249
)
4350

4451
// WriteOutpoint writes an outpoint to an io.Writer. This is not the same as
@@ -993,7 +1000,14 @@ func (f *Manager) stateStep(channel *channeldb.OpenChannel,
9931000

9941001
if !received {
9951002
// We haven't received FundingLocked, so we'll continue
996-
// to the next iteration of the loop.
1003+
// to the next iteration of the loop after sleeping for
1004+
// checkPeerFundingLockInterval.
1005+
select {
1006+
case <-time.After(checkPeerFundingLockInterval):
1007+
case <-f.quit:
1008+
return ErrFundingManagerShuttingDown
1009+
}
1010+
9971011
return nil
9981012
}
9991013

@@ -2416,18 +2430,22 @@ func (f *Manager) fundingTimeout(c *channeldb.OpenChannel,
24162430
go func() {
24172431
defer f.wg.Done()
24182432

2419-
peerChan := make(chan lnpeer.Peer, 1)
2420-
var peerKey [33]byte
2421-
copy(peerKey[:], c.IdentityPub.SerializeCompressed())
2433+
peer, err := f.waitForPeerOnline(c.IdentityPub)
2434+
switch err {
2435+
// We're already shutting down, so we can just return.
2436+
case ErrFundingManagerShuttingDown:
2437+
return
24222438

2423-
f.cfg.NotifyWhenOnline(peerKey, peerChan)
2439+
// nil error means we continue on.
2440+
case nil:
24242441

2425-
var peer lnpeer.Peer
2426-
select {
2427-
case peer = <-peerChan:
2428-
case <-f.quit:
2429-
return
2442+
// For unexpected errors, we print the error and still try to
2443+
// fail the funding flow.
2444+
default:
2445+
log.Errorf("Unexpected error while waiting for peer "+
2446+
"to come online: %v", err)
24302447
}
2448+
24312449
// TODO(halseth): should this send be made
24322450
// reliable?
24332451

@@ -2818,14 +2836,9 @@ func (f *Manager) sendFundingLocked(completeChan *channeldb.OpenChannel,
28182836
// send fundingLocked until we succeed, or the fundingManager is shut
28192837
// down.
28202838
for {
2821-
connected := make(chan lnpeer.Peer, 1)
2822-
f.cfg.NotifyWhenOnline(peerKey, connected)
2823-
2824-
var peer lnpeer.Peer
2825-
select {
2826-
case peer = <-connected:
2827-
case <-f.quit:
2828-
return ErrFundingManagerShuttingDown
2839+
peer, err := f.waitForPeerOnline(completeChan.IdentityPub)
2840+
if err != nil {
2841+
return err
28292842
}
28302843

28312844
localAlias := peer.LocalFeatures().HasFeature(
@@ -2901,18 +2914,10 @@ func (f *Manager) receivedFundingLocked(node *btcec.PublicKey,
29012914
default:
29022915
}
29032916

2904-
// Check whether the peer is online. If it's not, we'll wait for them
2905-
// to come online before proceeding. This is to avoid a tight loop if
2906-
// they're offline.
2907-
connected := make(chan lnpeer.Peer, 1)
2908-
var peerKey [33]byte
2909-
copy(peerKey[:], node.SerializeCompressed())
2910-
f.cfg.NotifyWhenOnline(peerKey, connected)
2911-
2912-
select {
2913-
case <-connected:
2914-
case <-f.quit:
2915-
return false, ErrFundingManagerShuttingDown
2917+
// Avoid a tight loop if peer is offline.
2918+
if _, err := f.waitForPeerOnline(node); err != nil {
2919+
log.Errorf("Wait for peer online failed: %v", err)
2920+
return false, err
29162921
}
29172922

29182923
channel, err := f.cfg.FindChannel(node, chanID)
@@ -3046,18 +3051,9 @@ func (f *Manager) annAfterSixConfs(completeChan *channeldb.OpenChannel,
30463051
log.Debugf("Will not announce private channel %v.",
30473052
shortChanID.ToUint64())
30483053

3049-
peerChan := make(chan lnpeer.Peer, 1)
3050-
3051-
var peerKey [33]byte
3052-
copy(peerKey[:], completeChan.IdentityPub.SerializeCompressed())
3053-
3054-
f.cfg.NotifyWhenOnline(peerKey, peerChan)
3055-
3056-
var peer lnpeer.Peer
3057-
select {
3058-
case peer = <-peerChan:
3059-
case <-f.quit:
3060-
return ErrFundingManagerShuttingDown
3054+
peer, err := f.waitForPeerOnline(completeChan.IdentityPub)
3055+
if err != nil {
3056+
return err
30613057
}
30623058

30633059
nodeAnn, err := f.cfg.CurrentNodeAnnouncement()
@@ -4338,3 +4334,24 @@ func (f *Manager) selectShutdownScript(taprootOK bool,
43384334

43394335
return txscript.PayToAddrScript(addr)
43404336
}
4337+
4338+
// waitForPeerOnline blocks until the peer specified by peerPubkey comes online
4339+
// and then returns the online peer.
4340+
func (f *Manager) waitForPeerOnline(peerPubkey *btcec.PublicKey) (lnpeer.Peer,
4341+
error) {
4342+
4343+
peerChan := make(chan lnpeer.Peer, 1)
4344+
4345+
var peerKey [33]byte
4346+
copy(peerKey[:], peerPubkey.SerializeCompressed())
4347+
4348+
f.cfg.NotifyWhenOnline(peerKey, peerChan)
4349+
4350+
var peer lnpeer.Peer
4351+
select {
4352+
case peer = <-peerChan:
4353+
case <-f.quit:
4354+
return peer, ErrFundingManagerShuttingDown
4355+
}
4356+
return peer, nil
4357+
}

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ module github.com/lightningnetwork/lnd
33
require (
44
github.com/NebulousLabs/go-upnp v0.0.0-20180202185039-29b680b06c82
55
github.com/Yawning/aez v0.0.0-20211027044916-e49e68abd344
6-
github.com/btcsuite/btcd v0.23.3
7-
github.com/btcsuite/btcd/btcec/v2 v2.2.1
6+
github.com/btcsuite/btcd v0.23.4
7+
github.com/btcsuite/btcd/btcec/v2 v2.2.2
88
github.com/btcsuite/btcd/btcutil v1.1.2
99
github.com/btcsuite/btcd/btcutil/psbt v1.1.5
1010
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
1111
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
12-
github.com/btcsuite/btcwallet v0.16.1
12+
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816
1313
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2
1414
github.com/btcsuite/btcwallet/wallet/txrules v1.2.0
1515
github.com/btcsuite/btcwallet/walletdb v1.4.0
@@ -44,7 +44,7 @@ require (
4444
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796
4545
github.com/miekg/dns v1.1.43
4646
github.com/prometheus/client_golang v1.11.0
47-
github.com/stretchr/testify v1.7.1
47+
github.com/stretchr/testify v1.8.0
4848
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02
4949
github.com/urfave/cli v1.22.9
5050
go.etcd.io/etcd/client/pkg/v3 v3.5.0
@@ -119,7 +119,7 @@ require (
119119
github.com/sirupsen/logrus v1.7.0 // indirect
120120
github.com/soheilhy/cmux v0.1.5 // indirect
121121
github.com/spf13/pflag v1.0.5 // indirect
122-
github.com/stretchr/objx v0.2.0 // indirect
122+
github.com/stretchr/objx v0.4.0 // indirect
123123
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
124124
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
125125
github.com/ulikunitz/xz v0.5.10 // indirect
@@ -153,7 +153,7 @@ require (
153153
gopkg.in/errgo.v1 v1.0.1 // indirect
154154
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
155155
gopkg.in/yaml.v2 v2.4.0 // indirect
156-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
156+
gopkg.in/yaml.v3 v3.0.1 // indirect
157157
sigs.k8s.io/yaml v1.2.0 // indirect
158158
)
159159

go.sum

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ github.com/btcsuite/btcd v0.22.0-beta.0.20220207191057-4dc4ff7963b4/go.mod h1:7a
7777
github.com/btcsuite/btcd v0.22.0-beta.0.20220316175102-8d5c75c28923/go.mod h1:taIcYprAW2g6Z9S0gGUxyR+zDwimyDMK5ePOX+iJ2ds=
7878
github.com/btcsuite/btcd v0.23.0/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
7979
github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
80-
github.com/btcsuite/btcd v0.23.3 h1:4KH/JKy9WiCd+iUS9Mu0Zp7Dnj17TGdKrg9xc/FGj24=
81-
github.com/btcsuite/btcd v0.23.3/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
80+
github.com/btcsuite/btcd v0.23.4 h1:IzV6qqkfwbItOS/sg/aDfPDsjPP8twrCOE2R93hxMlQ=
81+
github.com/btcsuite/btcd v0.23.4/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY=
8282
github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA=
8383
github.com/btcsuite/btcd/btcec/v2 v2.1.1/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
8484
github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE=
85-
github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh2R/Yv3E=
86-
github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8=
85+
github.com/btcsuite/btcd/btcec/v2 v2.2.2 h1:5uxe5YjoCq+JeOpg0gZSNHuFgeogrocBYxvg6w9sAgc=
86+
github.com/btcsuite/btcd/btcec/v2 v2.2.2/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8=
8787
github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A=
8888
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
8989
github.com/btcsuite/btcd/btcutil v1.1.1/go.mod h1:nbKlBMNm9FGsdvKvu0essceubPiAcI57pYBNnsLAa34=
@@ -98,8 +98,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtyd
9898
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo=
9999
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
100100
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg=
101-
github.com/btcsuite/btcwallet v0.16.1 h1:nD8qXJeAU8c7a0Jlx5jwI2ufbf/9ouy29XGapRLTmos=
102-
github.com/btcsuite/btcwallet v0.16.1/go.mod h1:NCO8+5rIcbUm5CtVNSQM0xrtK4iYprlyuvpGzhkejaM=
101+
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816 h1:t4wbkXekvTc1eOGDv2h8l6mkLPnqP93hnRHvNtgpiHQ=
102+
github.com/btcsuite/btcwallet v0.16.2-0.20221109224534-84bf4e34c816/go.mod h1:d8AETQyIIWTtC9CnoCMBmDARp9P65oX4IoBdEP3fDK4=
103103
github.com/btcsuite/btcwallet/wallet/txauthor v1.2.3/go.mod h1:T2xSiKGpUkSLCh68aF+FMXmKK9mFqNdHl9VaqOr+JjU=
104104
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2 h1:etuLgGEojecsDOYTII8rYiGHjGyV5xTqsXi+ZQ715UU=
105105
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.2/go.mod h1:Zpk/LOb2sKqwP2lmHjaZT9AdaKsHPSbNLm2Uql5IQ/0=
@@ -638,16 +638,18 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An
638638
github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg=
639639
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
640640
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
641-
github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48=
642641
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
642+
github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
643+
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
643644
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
644645
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
645646
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
646647
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
647648
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
648649
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
649-
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
650650
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
651+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
652+
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
651653
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
652654
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
653655
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
@@ -1128,8 +1130,9 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
11281130
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
11291131
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
11301132
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1131-
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
11321133
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1134+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
1135+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
11331136
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
11341137
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
11351138
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

keychain/btcwallet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func (b *BtcWalletKeyRing) SignMessageSchnorr(keyLoc KeyLocator,
473473
}
474474

475475
if len(taprootTweak) > 0 {
476-
privKey = txscript.TweakTaprootPrivKey(privKey, taprootTweak)
476+
privKey = txscript.TweakTaprootPrivKey(*privKey, taprootTweak)
477477
}
478478

479479
var digest []byte

lntest/itest/assertions.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ func openChannelAndAssert(t *harnessTest, net *lntest.NetworkHarness,
9090
"unable to assert channel existence",
9191
)
9292

93+
// They should also notice this channel from topology subscription.
94+
err = alice.WaitForNetworkChannelOpen(fundingChanPoint)
95+
require.NoError(t.t, err)
96+
97+
err = bob.WaitForNetworkChannelOpen(fundingChanPoint)
98+
require.NoError(t.t, err)
99+
93100
return fundingChanPoint
94101
}
95102

lntest/itest/lnd_channel_policy_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,10 @@ func testUpdateChannelPolicyForPrivateChannel(net *lntest.NetworkHarness,
738738
)
739739
defer closeChannelAndAssert(t, net, net.Bob, chanPointBobCarol, false)
740740

741+
// Carol should be aware of the channel between Alice and Bob.
742+
err = carol.WaitForNetworkChannelOpen(chanPointAliceBob)
743+
require.NoError(t.t, err)
744+
741745
// Get Bob's funding point.
742746
bobChanTXID, err := lnrpc.GetChanPointFundingTxid(chanPointBobCarol)
743747
require.NoError(t.t, err, "unable to get txid")

lntest/itest/lnd_psbt_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,21 @@ func assertPsbtSpend(ctx context.Context, t *harnessTest,
11511151
finalTx, err := psbt.Extract(signedPacket)
11521152
require.NoError(t.t, err)
11531153

1154+
// Make sure we can also sign a second time. This makes sure any key
1155+
// tweaking that happened for the signing didn't affect any keys in the
1156+
// cache.
1157+
signResp2, err := alice.WalletKitClient.SignPsbt(
1158+
ctx, &walletrpc.SignPsbtRequest{
1159+
FundedPsbt: buf.Bytes(),
1160+
},
1161+
)
1162+
require.NoError(t.t, err)
1163+
signedPacket2, err := psbt.NewFromRawBytes(
1164+
bytes.NewReader(signResp2.SignedPsbt), false,
1165+
)
1166+
require.NoError(t.t, err)
1167+
verifySigned(signedPacket2)
1168+
11541169
buf.Reset()
11551170
err = finalTx.Serialize(&buf)
11561171
require.NoError(t.t, err)

lntest/itest/lnd_remote_signer_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ func testRemoteSigner(net *lntest.NetworkHarness, t *harnessTest) {
103103
runCPFP(net, tt, wo, carol)
104104
},
105105
}, {
106-
name: "psbt",
106+
name: "psbt",
107+
randomSeed: true,
107108
fn: func(tt *harnessTest, wo, carol *lntest.HarnessNode) {
108109
runPsbtChanFunding(net, tt, carol, wo)
109110
runSignPsbtSegWitV0P2WKH(tt, net, wo)
@@ -124,8 +125,9 @@ func testRemoteSigner(net *lntest.NetworkHarness, t *harnessTest) {
124125
runSignVerifyMessage(tt, net, wo)
125126
},
126127
}, {
127-
name: "taproot",
128-
sendCoins: true,
128+
name: "taproot",
129+
sendCoins: true,
130+
randomSeed: true,
129131
fn: func(tt *harnessTest, wo, carol *lntest.HarnessNode) {
130132
ctxt, cancel := context.WithTimeout(
131133
ctxb, 3*defaultTimeout,

lntest/mock/secretkeyring.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func (s *SecretKeyRing) SignMessageSchnorr(_ keychain.KeyLocator,
8686

8787
privKey := s.RootKey
8888
if len(taprootTweak) > 0 {
89-
privKey = txscript.TweakTaprootPrivKey(privKey, taprootTweak)
89+
privKey = txscript.TweakTaprootPrivKey(*privKey, taprootTweak)
9090
}
9191

9292
return schnorr.Sign(privKey, digest)

0 commit comments

Comments
 (0)