mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
server: include optional updates when generating a new node announcement
This commit is contained in:
parent
d635994272
commit
2ad9823945
1 changed files with 5 additions and 3 deletions
|
@ -987,8 +987,8 @@ func (s *server) initTorController() error {
|
|||
// genNodeAnnouncement generates and returns the current fully signed node
|
||||
// announcement. If refresh is true, then the time stamp of the announcement
|
||||
// will be updated in order to ensure it propagates through the network.
|
||||
func (s *server) genNodeAnnouncement(
|
||||
refresh bool) (lnwire.NodeAnnouncement, error) {
|
||||
func (s *server) genNodeAnnouncement(refresh bool,
|
||||
updates ...func(*lnwire.NodeAnnouncement)) (lnwire.NodeAnnouncement, error) {
|
||||
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
@ -997,7 +997,9 @@ func (s *server) genNodeAnnouncement(
|
|||
return *s.currentNodeAnn, nil
|
||||
}
|
||||
|
||||
var err error
|
||||
for _, update := range updates {
|
||||
update(s.currentNodeAnn)
|
||||
}
|
||||
|
||||
newStamp := uint32(time.Now().Unix())
|
||||
if newStamp <= s.currentNodeAnn.Timestamp {
|
||||
|
|
Loading…
Add table
Reference in a new issue