mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-28 06:56:59 +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
|
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
|
// A compile time check to ensure NodeAnnouncement implements the
|
||||||
// lnwire.Message interface.
|
// lnwire.Message interface.
|
||||||
var _ Message = (*NodeAnnouncement)(nil)
|
var _ Message = (*NodeAnnouncement)(nil)
|
||||||
|
Reference in New Issue
Block a user