lnwallet: fix bug in deriveMusig2Shachain

In this commit, we fix a bug in the `deriveMusig2Shachain` function
where it didn't actually use the passed in revocation root as part of
the hmac invocation.

We also modify the function to be more generally useable as well, as now
the caller can just pass in the revocation root things should be derived
from.
This commit is contained in:
Olaoluwa Osuntokun
2023-07-10 18:25:06 -07:00
parent 83f1bd4717
commit d2bc4f29e1
3 changed files with 19 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ func (l *LightningWallet) nextRevocationProducer(res *ChannelReservation,
// Once we have the root, we can then generate our shachain producer
// and from that generate the per-commitment point.
shaChainRoot := shachain.NewRevocationProducer(revRoot)
taprootShaChainRoot, err := deriveMusig2Shachain(revRoot)
taprootShaChainRoot, err := deriveMusig2Shachain(shaChainRoot)
if err != nil {
return nil, nil, err
}