lnwire: make LocalNonce an optional tlv record and fix extra data

It should be an optional record instead of an fn option. In addition,
its tlv type is bumped to be 14 as this record is also included in the
`DynCommit`. If we use tlv type 0, it will create a conflict in the msg
`DynCommit`, which is fixed in the following commit.
This commit is contained in:
yyforyongyu committed 2025-07-11 04:11:30 +03:00
1 parent b7d2f68ed0
commit f39c3679f2
2 files changed
+26 -46

No files matched your search

+3 -2
View File
@@ -796,9 +796,10 @@ func (da *DynAck) RandTestMessage(t *rapid.T) Message {
}
includeLocalNonce := rapid.Bool().Draw(t, "includeLocalNonce")
if includeLocalNonce {
msg.LocalNonce = fn.Some(RandMusig2Nonce(t))
nonce := RandMusig2Nonce(t)
rec := tlv.NewRecordT[tlv.TlvType14](nonce)
msg.LocalNonce = tlv.SomeRecordT(rec)
}
// Create a tlv type lists to hold all known records which will be