mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 02:02:10 +02:00
lnrpc/peers: handle color changes in updateNodeAnnouncement
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package netann
|
||||
|
||||
import (
|
||||
"image/color"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
@@ -29,6 +30,14 @@ func NodeAnnSetAddrs(addrs []net.Addr) func(*lnwire.NodeAnnouncement) {
|
||||
}
|
||||
}
|
||||
|
||||
// NodeAnnSetColor is a functional option that sets the color of the
|
||||
// given node announcment.
|
||||
func NodeAnnSetColor(newColor color.RGBA) func(*lnwire.NodeAnnouncement) {
|
||||
return func(nodeAnn *lnwire.NodeAnnouncement) {
|
||||
nodeAnn.RGBColor = newColor
|
||||
}
|
||||
}
|
||||
|
||||
// NodeAnnSetTimestamp is a functional option that sets the timestamp of the
|
||||
// announcement to the current time, or increments it if the timestamp is
|
||||
// already in the future.
|
||||
|
Reference in New Issue
Block a user