multi: rename ChannelUpdate to ChannelUpdate1

In preparation for adding a new ChannelUpdate2 message and a
ChannelUpdate interface, we rename the existing message to
ChannelUpdate1.
This commit is contained in:
Elle Mouton committed 2024-09-18 16:13:17 +02:00
1 parent bb44efa21f
commit 60f331edb1
43 files changed
+198 -172

No files matched your search

+9 -3
View File
@@ -85,7 +85,7 @@ func msgShortChanID(msg lnwire.Message) (lnwire.ShortChannelID, error) {
switch msg := msg.(type) {
case *lnwire.AnnounceSignatures1:
shortChanID = msg.ShortChannelID
case *lnwire.ChannelUpdate:
case *lnwire.ChannelUpdate1:
shortChanID = msg.ShortChannelID
default:
return shortChanID, ErrUnsupportedMessage
@@ -160,7 +160,7 @@ func (s *MessageStore) DeleteMessage(msg lnwire.Message,
// In the event that we're attempting to delete a ChannelUpdate
// from the store, we'll make sure that we're actually deleting
// the correct one as it can be overwritten.
if msg, ok := msg.(*lnwire.ChannelUpdate); ok {
if msg, ok := msg.(*lnwire.ChannelUpdate1); ok {
// Deleting a value from a bucket that doesn't exist
// acts as a NOP, so we'll return if a message doesn't
// exist under this key.
@@ -176,7 +176,13 @@ func (s *MessageStore) DeleteMessage(msg lnwire.Message,
// If the timestamps don't match, then the update stored
// should be the latest one, so we'll avoid deleting it.
if msg.Timestamp != dbMsg.(*lnwire.ChannelUpdate).Timestamp {
m, ok := dbMsg.(*lnwire.ChannelUpdate1)
if !ok {
return fmt.Errorf("expected "+
"*lnwire.ChannelUpdate1, got: %T",
dbMsg)
}
if msg.Timestamp != m.Timestamp {
return nil
}
}