Skip to content

Commit 5970089

Browse files
committed
lnwire: make LinkUpdater a subclass of Message
Conceptually, all messages that are capable of identifying the channel_id on which they operate are themselves messages. Here we codify this.
1 parent f5f0286 commit 5970089

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lnwire/message.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ type Message interface {
193193
// LinkUpdater is an interface implemented by most messages in BOLT 2 that are
194194
// allowed to update the channel state.
195195
type LinkUpdater interface {
196+
// All LinkUpdater messages are messages and so we embed the interface
197+
// so that we can treat it as a message if all we know about it is that
198+
// it is a LinkUpdater message.
199+
Message
200+
196201
// TargetChanID returns the channel id of the link for which this
197202
// message is intended.
198203
TargetChanID() ChannelID

0 commit comments

Comments
 (0)