Skip to content

Commit 2ecf868

Browse files
committed
multi: use lnwire.AnnouncementSigs interface throughout
1 parent 4d0d6e9 commit 2ecf868

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
@@ -1434,7 +1434,7 @@ func (d *AuthenticatedGossiper) networkHandler() {
14341434
switch announcement.msg.(type) {
14351435
// Channel announcement signatures are amongst the only
14361436
// messages that we'll process serially.
1437-
case *lnwire.AnnounceSignatures1:
1437+
case lnwire.AnnounceSignatures:
14381438
emittedAnnouncements, _ := d.processNetworkAnnouncement(
14391439
announcement,
14401440
)
@@ -2170,9 +2170,9 @@ func (d *AuthenticatedGossiper) fetchNodeAnn(
21702170
// MessageStore is seen as stale by the current graph.
21712171
func (d *AuthenticatedGossiper) isMsgStale(msg lnwire.Message) bool {
21722172
switch msg := msg.(type) {
2173-
case *lnwire.AnnounceSignatures1:
2173+
case lnwire.AnnounceSignatures:
21742174
chanInfo, _, _, err := d.cfg.Router.GetChannelByID(
2175-
msg.ShortChannelID,
2175+
msg.SCID(),
21762176
)
21772177

21782178
// 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
@@ -4052,7 +4052,7 @@ func (f *Manager) ensureInitialForwardingPolicy(chanID lnwire.ChannelID,
40524052
type chanAnnouncement struct {
40534053
chanAnn lnwire.ChannelAnnouncement
40544054
chanUpdateAnn *lnwire.ChannelUpdate1
4055-
chanProof *lnwire.AnnounceSignatures1
4055+
chanProof lnwire.AnnounceSignatures
40564056
}
40574057

40584058
// newChanAnnouncement creates the authenticated channel announcement messages

peer/brontide.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,7 @@ out:
17251725
*lnwire.ChannelAnnouncement2,
17261726
*lnwire.NodeAnnouncement1,
17271727
*lnwire.AnnounceSignatures1,
1728+
*lnwire.AnnounceSignatures2,
17281729
*lnwire.GossipTimestampRange,
17291730
*lnwire.QueryShortChanIDs,
17301731
*lnwire.QueryChannelRange,
@@ -1971,9 +1972,9 @@ func messageSummary(msg lnwire.Message) string {
19711972
case *lnwire.Error:
19721973
return fmt.Sprintf("%v", msg.Error())
19731974

1974-
case *lnwire.AnnounceSignatures1:
1975-
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.ChannelID,
1976-
msg.ShortChannelID.ToUint64())
1975+
case lnwire.AnnounceSignatures:
1976+
return fmt.Sprintf("chan_id=%v, short_chan_id=%v", msg.SCID(),
1977+
msg.SCID().ToUint64())
19771978

19781979
case lnwire.ChannelAnnouncement:
19791980
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)