multi: use lnwire.AnnouncementSigs interface throughout

This commit is contained in:
Elle Mouton 2023-11-07 09:09:01 +02:00
parent 2767c4e8a5
commit fdcfc45862
No known key found for this signature in database
GPG Key ID: D7D916376026F177
5 changed files with 13 additions and 14 deletions

View File

@ -1442,7 +1442,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
switch announcement.msg.(type) {
// Channel announcement signatures are amongst the only
// messages that we'll process serially.
case *lnwire.AnnounceSignatures1:
case lnwire.AnnounceSignatures:
emittedAnnouncements, _ := d.processNetworkAnnouncement(
announcement,
)
@ -2183,10 +2183,8 @@ func (d *AuthenticatedGossiper) fetchNodeAnn(
// MessageStore is seen as stale by the current graph.
func (d *AuthenticatedGossiper) isMsgStale(msg lnwire.Message) bool {
switch msg := msg.(type) {
case *lnwire.AnnounceSignatures1:
chanInfo, _, _, err := d.cfg.Graph.GetChannelByID(
msg.ShortChannelID,
)
case lnwire.AnnounceSignatures:
chanInfo, _, _, err := d.cfg.Graph.GetChannelByID(msg.SCID())
// If the channel cannot be found, it is most likely a leftover
// message for a channel that was closed, so we can consider it

View File

@ -83,8 +83,8 @@ func NewMessageStore(db kvdb.Backend) (*MessageStore, error) {
func msgShortChanID(msg lnwire.Message) (lnwire.ShortChannelID, error) {
var shortChanID lnwire.ShortChannelID
switch msg := msg.(type) {
case *lnwire.AnnounceSignatures1:
shortChanID = msg.ShortChannelID
case lnwire.AnnounceSignatures:
shortChanID = msg.SCID()
case *lnwire.ChannelUpdate1:
shortChanID = msg.ShortChannelID
default:

View File

@ -4145,7 +4145,7 @@ func (f *Manager) ensureInitialForwardingPolicy(chanID lnwire.ChannelID,
type chanAnnouncement struct {
chanAnn lnwire.ChannelAnnouncement
chanUpdateAnn *lnwire.ChannelUpdate1
chanProof *lnwire.AnnounceSignatures1
chanProof lnwire.AnnounceSignatures
}
// newChanAnnouncement creates the authenticated channel announcement messages

View File

@ -153,7 +153,7 @@ func (v *ValidationBarrier) InitJobDependencies(job interface{}) {
return
case *channeldb.LightningNode:
return
case *lnwire.AnnounceSignatures1:
case lnwire.AnnounceSignatures:
// TODO(roasbeef): need to wait on chan ann?
return
}
@ -215,7 +215,7 @@ func (v *ValidationBarrier) WaitForDependants(job interface{}) error {
// Other types of jobs can be executed immediately, so we'll just
// return directly.
case *lnwire.AnnounceSignatures1:
case lnwire.AnnounceSignatures:
// TODO(roasbeef): need to wait on chan ann?
case models.ChannelEdgeInfo:
case lnwire.ChannelAnnouncement:
@ -301,7 +301,7 @@ func (v *ValidationBarrier) SignalDependants(job interface{}, allow bool) {
case models.ChannelEdgePolicy:
delete(v.chanEdgeDependencies, msg.SCID())
case *lnwire.AnnounceSignatures1:
case lnwire.AnnounceSignatures:
return
}
}

View File

@ -1970,6 +1970,7 @@ out:
*lnwire.ChannelAnnouncement2,
*lnwire.NodeAnnouncement,
*lnwire.AnnounceSignatures1,
*lnwire.AnnounceSignatures2,
*lnwire.GossipTimestampRange,
*lnwire.QueryShortChanIDs,
*lnwire.QueryChannelRange,
@ -2227,9 +2228,9 @@ func messageSummary(msg lnwire.Message) string {
case *lnwire.Error:
return fmt.Sprintf("%v", msg.Error())
case *lnwire.AnnounceSignatures1:
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.ChannelID,
msg.ShortChannelID.ToUint64())
case lnwire.AnnounceSignatures:
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.SCID(),
msg.SCID().ToUint64())
case lnwire.ChannelAnnouncement:
return fmt.Sprintf("chain_hash=%v, short_chan_id=%v",