lnwire: add missing record LocalNonce

This record was never added to the `DynCommit`, but it's inherited from
the embedding msg `DynAck`.
This commit is contained in:
yyforyongyu committed 2025-07-11 04:11:30 +03:00
1 parent f39c3679f2
commit e6ab37305c
2 files changed
+23 -4

No files matched your search

+12 -2
View File
@@ -1004,11 +1004,21 @@ func (dc *DynCommit) RandTestMessage(t *rapid.T) Message {
dp.ChannelType = tlv.SomeRecordT(chanType)
}
includeLocalNonce := rapid.Bool().Draw(t, "includeLocalNonce")
if includeLocalNonce {
nonce := RandMusig2Nonce(t)
rec := tlv.NewRecordT[tlv.TlvType14](nonce)
da.LocalNonce = tlv.SomeRecordT(rec)
}
// Create a tlv type lists to hold all known records which will be
// ignored when creating ExtraData records.
ignoreRecords := fn.NewSet[uint64]()
for i := range uint64(13) {
ignoreRecords.Add(i)
for i := range uint64(15) {
// Ignore known records.
if i%2 == 0 {
ignoreRecords.Add(i)
}
}
msg := &DynCommit{
DynPropose: *dp,