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

This commit is contained in:
Wilmer Paulino 2018-04-23 12:44:14 -04:00
parent 377e770db4
commit d635994272
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

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