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
2025-07-02 20:52:45 +08:00
parent f39c3679f2
commit e6ab37305c
2 changed files with 23 additions and 4 deletions

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,