mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-28 14:40:51 +02:00
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:
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user