Skip to content

Commit b0715f1

Browse files
committed
multi: use lnwire.AnnouncementSigs interface throughout
1 parent 1073702 commit b0715f1

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

discovery/gossiper.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
14351435
switch announcement.msg.(type) {
14361436
// Channel announcement signatures are amongst the only
14371437
// messages that we'll process serially.
1438-
case *lnwire.AnnounceSignatures1:
1438+
case lnwire.AnnounceSignatures:
14391439
emittedAnnouncements, _ := d.processNetworkAnnouncement(
14401440
announcement,
14411441
)
@@ -2186,9 +2186,9 @@ func (d *AuthenticatedGossiper) fetchNodeAnn(
21862186
// MessageStore is seen as stale by the current graph.
21872187
func (d *AuthenticatedGossiper) isMsgStale(msg lnwire.Message) bool {
21882188
switch msg := msg.(type) {
2189-
case *lnwire.AnnounceSignatures1:
2189+
case lnwire.AnnounceSignatures:
21902190
chanInfo, _, _, err := d.cfg.Router.GetChannelByID(
2191-
msg.ShortChannelID,
2191+
msg.SCID(),
21922192
)
21932193

21942194
// If the channel cannot be found, it is most likely a leftover

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
@@ -4053,7 +4053,7 @@ func (f *Manager) ensureInitialForwardingPolicy(chanID lnwire.ChannelID,
40534053
type chanAnnouncement struct {
40544054
chanAnn lnwire.ChannelAnnouncement
40554055
chanUpdateAnn *lnwire.ChannelUpdate1
4056-
chanProof *lnwire.AnnounceSignatures1
4056+
chanProof lnwire.AnnounceSignatures
40574057
}
40584058

40594059
// newChanAnnouncement creates the authenticated channel announcement messages

peer/brontide.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,7 @@ out:
17151715
*lnwire.ChannelAnnouncement2,
17161716
*lnwire.NodeAnnouncement1,
17171717
*lnwire.AnnounceSignatures1,
1718+
*lnwire.AnnounceSignatures2,
17181719
*lnwire.GossipTimestampRange,
17191720
*lnwire.QueryShortChanIDs,
17201721
*lnwire.QueryChannelRange,
@@ -1961,9 +1962,9 @@ func messageSummary(msg lnwire.Message) string {
19611962
case *lnwire.Error:
19621963
return fmt.Sprintf("%v", msg.Error())
19631964

1964-
case *lnwire.AnnounceSignatures1:
1965-
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.ChannelID,
1966-
msg.ShortChannelID.ToUint64())
1965+
case lnwire.AnnounceSignatures:
1966+
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.SCID(),
1967+
msg.SCID().ToUint64())
19671968

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

routing/validation_barrier.go

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

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

305-
case *lnwire.AnnounceSignatures1:
305+
case lnwire.AnnounceSignatures:
306306
return
307307
}
308308
}

0 commit comments

Comments
 (0)