lnwire: add functional option that updates a node announcement's addresses

This commit is contained in:
Wilmer Paulino committed 2018-06-12 18:36:28 -07:00
1 parent 377e770db4
commit d635994272
1 file changed
+8
+8
View File
@@ -85,6 +85,14 @@ type NodeAnnouncement struct {
Addresses []net.Addr
}
// UpdateNodeAnnAddrs is a functional option that allows updating the addresses
// of the given node announcement.
func UpdateNodeAnnAddrs(addrs []net.Addr) func(*NodeAnnouncement) {
return func(nodeAnn *NodeAnnouncement) {
nodeAnn.Addresses = addrs
}
}
// A compile time check to ensure NodeAnnouncement implements the
// lnwire.Message interface.
var _ Message = (*NodeAnnouncement)(nil)