multi: rename ChannelAnnouncement to ChannelAnnouncment1

In preparation for adding the new ChannelAnnouncement2 message along
with a ChannelAnnouncement interface, we rename the existing message to
ChannelAnnouncement1.
This commit is contained in:
Elle Mouton
2024-08-21 08:37:50 +02:00
parent 05d76b696d
commit bb44efa21f
17 changed files with 55 additions and 54 deletions

View File

@@ -15,7 +15,7 @@ import (
// ValidateChannelAnn validates the channel announcement message and checks
// that node signatures covers the announcement message, and that the bitcoin
// signatures covers the node keys.
func ValidateChannelAnn(a *lnwire.ChannelAnnouncement) error {
func ValidateChannelAnn(a *lnwire.ChannelAnnouncement1) error {
// First, we'll compute the digest (h) which is to be signed by each of
// the keys included within the node announcement message. This hash
// digest includes all the keys, so the (up to 4 signatures) will

View File

@@ -102,7 +102,7 @@ func (v *ValidationBarrier) InitJobDependencies(job interface{}) {
// ChannelUpdates for the same channel, or NodeAnnouncements of nodes
// that are involved in this channel. This goes for both the wire
// type,s and also the types that we use within the database.
case *lnwire.ChannelAnnouncement:
case *lnwire.ChannelAnnouncement1:
// We ensure that we only create a new announcement signal iff,
// one doesn't already exist, as there may be duplicate
@@ -219,7 +219,7 @@ func (v *ValidationBarrier) WaitForDependants(job interface{}) error {
case *lnwire.AnnounceSignatures1:
// TODO(roasbeef): need to wait on chan ann?
case *models.ChannelEdgeInfo:
case *lnwire.ChannelAnnouncement:
case *lnwire.ChannelAnnouncement1:
}
// Release the lock once the above read is finished.
@@ -275,7 +275,7 @@ func (v *ValidationBarrier) SignalDependants(job interface{}, allow bool) {
}
delete(v.chanAnnFinSignal, shortID)
}
case *lnwire.ChannelAnnouncement:
case *lnwire.ChannelAnnouncement1:
finSignals, ok := v.chanAnnFinSignal[msg.ShortChannelID]
if ok {
if allow {

View File

@@ -73,9 +73,9 @@ func TestValidationBarrierQuit(t *testing.T) {
// Create a set of unique channel announcements that we will prep for
// validation.
anns := make([]*lnwire.ChannelAnnouncement, 0, numTasks)
anns := make([]*lnwire.ChannelAnnouncement1, 0, numTasks)
for i := 0; i < numTasks; i++ {
anns = append(anns, &lnwire.ChannelAnnouncement{
anns = append(anns, &lnwire.ChannelAnnouncement1{
ShortChannelID: lnwire.NewShortChanIDFromInt(uint64(i)),
NodeID1: nodeIDFromInt(uint64(2 * i)),
NodeID2: nodeIDFromInt(uint64(2*i + 1)),