Skip to content

Commit 60887ad

Browse files
ProofOfKeagsyyforyongyu
authored andcommitted
lnwire: add signature to DynAck
1 parent c686177 commit 60887ad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lnwire/dyn_ack.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ type DynAck struct {
2424
// a dynamic commitment negotiation
2525
ChanID ChannelID
2626

27+
// Sig is a signature that acknowledges and approves the parameters
28+
// that were requested in the DynPropose
29+
Sig Sig
30+
2731
// LocalNonce is an optional field that is transmitted when accepting
2832
// a dynamic commitment upgrade to Taproot Channels. This nonce will be
2933
// used to verify the first commitment transaction signature. This will
@@ -54,6 +58,10 @@ func (da *DynAck) Encode(w *bytes.Buffer, _ uint32) error {
5458
return err
5559
}
5660

61+
if err := WriteSig(w, da.Sig); err != nil {
62+
return err
63+
}
64+
5765
var tlvRecords []tlv.Record
5866
da.LocalNonce.WhenSome(func(nonce Musig2Nonce) {
5967
tlvRecords = append(
@@ -88,7 +96,7 @@ func (da *DynAck) Encode(w *bytes.Buffer, _ uint32) error {
8896
// This is a part of the lnwire.Message interface.
8997
func (da *DynAck) Decode(r io.Reader, _ uint32) error {
9098
// Parse out main message.
91-
if err := ReadElements(r, &da.ChanID); err != nil {
99+
if err := ReadElements(r, &da.ChanID, &da.Sig); err != nil {
92100
return err
93101
}
94102

0 commit comments

Comments
 (0)