input+lnwallet: modify musig2 interfaces use explicit optional local nonces

In this commit, we modify the musig2 interfaces to instead use an
explicit value for the local nonces. Before this commit, we used the
functional option, but we want to also support specifying this value
over RPC for the remote signer. The functional option pattern is opaque,
so we can't get the nonce value we need. To get around this, we'll just
make this an explicit pointer, then map this to the functional option at
the very last moment.
This commit is contained in:
Olaoluwa Osuntokun
2023-09-15 17:51:45 -07:00
parent 2d5c0c9b4e
commit ce93b236aa
6 changed files with 23 additions and 15 deletions

View File

@@ -260,7 +260,7 @@ func (m *MusigSession) FinalizeSession(signingNonce musig2.Nonces) error {
m.session, err = m.signer.MuSig2CreateSession(
input.MuSig2Version100RC2, m.localKey.KeyLocator, m.signerKeys,
&tweakDesc, [][musig2.PubNonceSize]byte{remoteNonce.PubNonce},
musig2.WithPreGeneratedNonce(&localNonce),
&localNonce,
)
if err != nil {
return err