mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: rename lnwire.NodeAnnouncement
In preparation for adding a NodeAnnouncement2 struct along with a NodeAnnouncement interface, this commit renames the existing NodeAnnouncment struct to NodeAnnouncement1.
This commit is contained in:
@@ -4754,10 +4754,10 @@ func TestLightningNodePersistence(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
// Use the raw serialized node announcement message create an
|
||||
// lnwire.NodeAnnouncement instance.
|
||||
// lnwire.NodeAnnouncement1 instance.
|
||||
msg, err := lnwire.ReadMessage(bytes.NewBuffer(nodeAnnBytes), 0)
|
||||
require.NoError(t, err)
|
||||
na, ok := msg.(*lnwire.NodeAnnouncement)
|
||||
na, ok := msg.(*lnwire.NodeAnnouncement1)
|
||||
require.True(t, ok)
|
||||
|
||||
// Convert the wire message to our internal node representation.
|
||||
|
||||
@@ -96,7 +96,7 @@ func (l *Node) AddPubKey(key *btcec.PublicKey) {
|
||||
}
|
||||
|
||||
// NodeAnnouncement retrieves the latest node announcement of the node.
|
||||
func (l *Node) NodeAnnouncement(signed bool) (*lnwire.NodeAnnouncement,
|
||||
func (l *Node) NodeAnnouncement(signed bool) (*lnwire.NodeAnnouncement1,
|
||||
error) {
|
||||
|
||||
if !l.HaveNodeAnnouncement {
|
||||
@@ -108,7 +108,7 @@ func (l *Node) NodeAnnouncement(signed bool) (*lnwire.NodeAnnouncement,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
nodeAnn := &lnwire.NodeAnnouncement{
|
||||
nodeAnn := &lnwire.NodeAnnouncement1{
|
||||
Features: l.Features.RawFeatureVector,
|
||||
NodeID: l.PubKeyBytes,
|
||||
RGBColor: l.Color,
|
||||
@@ -133,8 +133,8 @@ func (l *Node) NodeAnnouncement(signed bool) (*lnwire.NodeAnnouncement,
|
||||
}
|
||||
|
||||
// NodeFromWireAnnouncement creates a Node instance from an
|
||||
// lnwire.NodeAnnouncement message.
|
||||
func NodeFromWireAnnouncement(msg *lnwire.NodeAnnouncement) *Node {
|
||||
// lnwire.NodeAnnouncement1 message.
|
||||
func NodeFromWireAnnouncement(msg *lnwire.NodeAnnouncement1) *Node {
|
||||
timestamp := time.Unix(int64(msg.Timestamp), 0)
|
||||
features := lnwire.NewFeatureVector(msg.Features, lnwire.Features)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user