Skip to content

DynComms [2/n]: lnwire: add authenticated wire messages for Dyn* #9148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
lnwire: remove no longer used initiator field
  • Loading branch information
ProofOfKeags authored and yyforyongyu committed Jun 24, 2025
commit c6861770debd6996a4b6374bec4457486909ee3e
12 changes: 1 addition & 11 deletions lnwire/dyn_propose.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ type DynPropose struct {
// re-negotiate.
ChanID ChannelID

// Initiator is a byte that identifies whether this message was sent as
// the initiator of a dynamic commitment negotiation or the responder
// of a dynamic commitment negotiation. bool true indicates it is the
// initiator
Initiator bool

// DustLimit, if not nil, proposes a change to the dust_limit_satoshis
// for the sender's commitment transaction.
DustLimit fn.Option[btcutil.Amount]
Expand Down Expand Up @@ -195,10 +189,6 @@ func (dp *DynPropose) Encode(w *bytes.Buffer, _ uint32) error {
return err
}

if err := WriteBool(w, dp.Initiator); err != nil {
return err
}

return WriteBytes(w, dp.ExtraData)
}

Expand All @@ -209,7 +199,7 @@ func (dp *DynPropose) Encode(w *bytes.Buffer, _ uint32) error {
// This is a part of the lnwire.Message interface.
func (dp *DynPropose) Decode(r io.Reader, _ uint32) error {
// Parse out the only required field.
if err := ReadElements(r, &dp.ChanID, &dp.Initiator); err != nil {
if err := ReadElements(r, &dp.ChanID); err != nil {
return err
}

Expand Down
1 change: 0 additions & 1 deletion lnwire/test_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,6 @@ var _ TestMessage = (*DynPropose)(nil)
func (dp *DynPropose) RandTestMessage(t *rapid.T) Message {
msg := &DynPropose{
ChanID: RandChannelID(t),
Initiator: rapid.Bool().Draw(t, "initiator"),
ExtraData: RandExtraOpaqueData(t, nil),
}

Expand Down