lnwire: add functional option that updates a node announcement's addresses
This commit is contained in:
parent
377e770db4
commit
d635994272
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user