lnrpc/peers: handle color changes in updateNodeAnnouncement
This commit is contained in:
4 files changed
+37
-1
No files matched your search
@@ -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