mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
lnwire: add support for Features in NodeAnnouncement
Add support for Features in NodeAnnouncment according to spec.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
3087bec4db
commit
085b7333cb
@@ -24,6 +24,8 @@ var (
|
||||
Port: 9000}
|
||||
testAddrs = []net.Addr{testAddr}
|
||||
|
||||
testFeatures = lnwire.NewFeatureVector([]lnwire.Feature{})
|
||||
|
||||
testHash = [32]byte{
|
||||
0xb7, 0x94, 0x38, 0x5f, 0x2d, 0x1e, 0xf7, 0xab,
|
||||
0x4d, 0x92, 0x73, 0xd1, 0x90, 0x63, 0x81, 0xb4,
|
||||
@@ -47,6 +49,7 @@ func createGraphNode() (*channeldb.LightningNode, error) {
|
||||
PubKey: priv.PubKey(),
|
||||
Color: color.RGBA{1, 2, 3, 0},
|
||||
Alias: "kek" + string(pub[:]),
|
||||
Features: testFeatures,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -68,6 +71,7 @@ func createTestWireNode() (*lnwire.NodeAnnouncement, error) {
|
||||
Addresses: testAddrs,
|
||||
NodeID: priv.PubKey(),
|
||||
Alias: alias,
|
||||
Features: testFeatures,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@@ -167,6 +167,7 @@ func parseTestGraph(path string) (*channeldb.ChannelGraph, func(), aliasMap, err
|
||||
Addresses: testAddrs,
|
||||
PubKey: pub,
|
||||
Alias: node.Alias,
|
||||
Features: testFeatures,
|
||||
}
|
||||
|
||||
// We require all aliases within the graph to be unique for our
|
||||
|
@@ -696,6 +696,7 @@ func (r *ChannelRouter) processNetworkAnnouncement(msg lnwire.Message) bool {
|
||||
Addresses: msg.Addresses,
|
||||
PubKey: msg.NodeID,
|
||||
Alias: msg.Alias.String(),
|
||||
Features: msg.Features,
|
||||
}
|
||||
|
||||
if err = r.cfg.Graph.AddLightningNode(node); err != nil {
|
||||
@@ -945,9 +946,10 @@ func (r *ChannelRouter) syncChannelGraph(syncReq *syncRequest) error {
|
||||
ann := &lnwire.NodeAnnouncement{
|
||||
Signature: r.fakeSig,
|
||||
Timestamp: uint32(node.LastUpdate.Unix()),
|
||||
Addresses: node.Addresses,
|
||||
NodeID: node.PubKey,
|
||||
Alias: alias,
|
||||
Features: node.Features,
|
||||
Addresses: node.Addresses,
|
||||
}
|
||||
announceMessages = append(announceMessages, ann)
|
||||
|
||||
|
Reference in New Issue
Block a user