mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 21:51:27 +02:00
lnwire: add signature to DynAck
This commit is contained in:
committed by
yyforyongyu
parent
c6861770de
commit
60887ad3ef
@@ -24,6 +24,10 @@ type DynAck struct {
|
||||
// a dynamic commitment negotiation
|
||||
ChanID ChannelID
|
||||
|
||||
// Sig is a signature that acknowledges and approves the parameters
|
||||
// that were requested in the DynPropose
|
||||
Sig Sig
|
||||
|
||||
// LocalNonce is an optional field that is transmitted when accepting
|
||||
// a dynamic commitment upgrade to Taproot Channels. This nonce will be
|
||||
// used to verify the first commitment transaction signature. This will
|
||||
@@ -54,6 +58,10 @@ func (da *DynAck) Encode(w *bytes.Buffer, _ uint32) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := WriteSig(w, da.Sig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var tlvRecords []tlv.Record
|
||||
da.LocalNonce.WhenSome(func(nonce Musig2Nonce) {
|
||||
tlvRecords = append(
|
||||
@@ -88,7 +96,7 @@ func (da *DynAck) Encode(w *bytes.Buffer, _ uint32) error {
|
||||
// This is a part of the lnwire.Message interface.
|
||||
func (da *DynAck) Decode(r io.Reader, _ uint32) error {
|
||||
// Parse out main message.
|
||||
if err := ReadElements(r, &da.ChanID); err != nil {
|
||||
if err := ReadElements(r, &da.ChanID, &da.Sig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user