mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-26 19:56:29 +02:00
lnwire: add functional option that updates a node announcement's addresses
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user