server: set default color for self NodeAnnouncements

This commit is contained in:
Olaoluwa Osuntokun committed 2017-12-02 18:38:20 -08:00
1 parent a034febde0
commit c57eda4c6d
1 file changed
+9
+9
View File
@@ -5,6 +5,7 @@ import (
"crypto/sha256" "crypto/sha256"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"image/color"
"net" "net"
"strconv" "strconv"
"sync" "sync"
@@ -219,6 +220,12 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
chanGraph := chanDB.ChannelGraph() chanGraph := chanDB.ChannelGraph()
defaultColor := color.RGBA{ // #3399FF
R: 51,
G: 153,
B: 255,
}
// TODO(roasbeef): make alias configurable // TODO(roasbeef): make alias configurable
alias, err := lnwire.NewNodeAlias(hex.EncodeToString(serializedPubKey[:10])) alias, err := lnwire.NewNodeAlias(hex.EncodeToString(serializedPubKey[:10]))
if err != nil { if err != nil {
@@ -231,6 +238,7 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
PubKey: privKey.PubKey(), PubKey: privKey.PubKey(),
Alias: alias.String(), Alias: alias.String(),
Features: s.globalFeatures, Features: s.globalFeatures,
Color: defaultColor,
} }
// If our information has changed since our last boot, then we'll // If our information has changed since our last boot, then we'll
@@ -244,6 +252,7 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
NodeID: selfNode.PubKey, NodeID: selfNode.PubKey,
Alias: alias, Alias: alias,
Features: selfNode.Features.RawFeatureVector, Features: selfNode.Features.RawFeatureVector,
RGBColor: defaultColor,
} }
selfNode.AuthSig, err = discovery.SignAnnouncement(s.nodeSigner, selfNode.AuthSig, err = discovery.SignAnnouncement(s.nodeSigner,
s.identityPriv.PubKey(), nodeAnn, s.identityPriv.PubKey(), nodeAnn,