lnrpc/peers: handle color changes in updateNodeAnnouncement

This commit is contained in:
positiveblue
2022-01-20 15:01:44 -08:00
parent ce4813940d
commit aacb2565f5
4 changed files with 37 additions and 1 deletions

View File

@@ -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.