Skip to content

Commit fdcfc45

Browse files
committed
multi: use lnwire.AnnouncementSigs interface throughout
1 parent 2767c4e commit fdcfc45

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

discovery/gossiper.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
14421442
switch announcement.msg.(type) {
14431443
// Channel announcement signatures are amongst the only
14441444
// messages that we'll process serially.
1445-
case *lnwire.AnnounceSignatures1:
1445+
case lnwire.AnnounceSignatures:
14461446
emittedAnnouncements, _ := d.processNetworkAnnouncement(
14471447
announcement,
14481448
)
@@ -2183,10 +2183,8 @@ func (d *AuthenticatedGossiper) fetchNodeAnn(
21832183
// MessageStore is seen as stale by the current graph.
21842184
func (d *AuthenticatedGossiper) isMsgStale(msg lnwire.Message) bool {
21852185
switch msg := msg.(type) {
2186-
case *lnwire.AnnounceSignatures1:
2187-
chanInfo, _, _, err := d.cfg.Graph.GetChannelByID(
2188-
msg.ShortChannelID,
2189-
)
2186+
case lnwire.AnnounceSignatures:
2187+
chanInfo, _, _, err := d.cfg.Graph.GetChannelByID(msg.SCID())
21902188

21912189
// If the channel cannot be found, it is most likely a leftover
21922190
// message for a channel that was closed, so we can consider it

discovery/message_store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ func NewMessageStore(db kvdb.Backend) (*MessageStore, error) {
8383
func msgShortChanID(msg lnwire.Message) (lnwire.ShortChannelID, error) {
8484
var shortChanID lnwire.ShortChannelID
8585
switch msg := msg.(type) {
86-
case *lnwire.AnnounceSignatures1:
87-
shortChanID = msg.ShortChannelID
86+
case lnwire.AnnounceSignatures:
87+
shortChanID = msg.SCID()
8888
case *lnwire.ChannelUpdate1:
8989
shortChanID = msg.ShortChannelID
9090
default:

funding/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4145,7 +4145,7 @@ func (f *Manager) ensureInitialForwardingPolicy(chanID lnwire.ChannelID,
41454145
type chanAnnouncement struct {
41464146
chanAnn lnwire.ChannelAnnouncement
41474147
chanUpdateAnn *lnwire.ChannelUpdate1
4148-
chanProof *lnwire.AnnounceSignatures1
4148+
chanProof lnwire.AnnounceSignatures
41494149
}
41504150

41514151
// newChanAnnouncement creates the authenticated channel announcement messages

graph/validation_barrier.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func (v *ValidationBarrier) InitJobDependencies(job interface{}) {
153153
return
154154
case *channeldb.LightningNode:
155155
return
156-
case *lnwire.AnnounceSignatures1:
156+
case lnwire.AnnounceSignatures:
157157
// TODO(roasbeef): need to wait on chan ann?
158158
return
159159
}
@@ -215,7 +215,7 @@ func (v *ValidationBarrier) WaitForDependants(job interface{}) error {
215215

216216
// Other types of jobs can be executed immediately, so we'll just
217217
// return directly.
218-
case *lnwire.AnnounceSignatures1:
218+
case lnwire.AnnounceSignatures:
219219
// TODO(roasbeef): need to wait on chan ann?
220220
case models.ChannelEdgeInfo:
221221
case lnwire.ChannelAnnouncement:
@@ -301,7 +301,7 @@ func (v *ValidationBarrier) SignalDependants(job interface{}, allow bool) {
301301
case models.ChannelEdgePolicy:
302302
delete(v.chanEdgeDependencies, msg.SCID())
303303

304-
case *lnwire.AnnounceSignatures1:
304+
case lnwire.AnnounceSignatures:
305305
return
306306
}
307307
}

peer/brontide.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,7 @@ out:
19701970
*lnwire.ChannelAnnouncement2,
19711971
*lnwire.NodeAnnouncement,
19721972
*lnwire.AnnounceSignatures1,
1973+
*lnwire.AnnounceSignatures2,
19731974
*lnwire.GossipTimestampRange,
19741975
*lnwire.QueryShortChanIDs,
19751976
*lnwire.QueryChannelRange,
@@ -2227,9 +2228,9 @@ func messageSummary(msg lnwire.Message) string {
22272228
case *lnwire.Error:
22282229
return fmt.Sprintf("%v", msg.Error())
22292230

2230-
case *lnwire.AnnounceSignatures1:
2231-
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.ChannelID,
2232-
msg.ShortChannelID.ToUint64())
2231+
case lnwire.AnnounceSignatures:
2232+
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.SCID(),
2233+
msg.SCID().ToUint64())
22332234

22342235
case lnwire.ChannelAnnouncement:
22352236
return fmt.Sprintf("chain_hash=%v, short_chan_id=%v",

0 commit comments

Comments
 (0)