From d38b4471c22bdfb31f58dfe0dd79d1b740ec99bd Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 5 Aug 2017 15:06:01 -0700 Subject: [PATCH] server: if a fresh announcement is requested, ensure seqno increases --- server.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server.go b/server.go index f0fccf6f..90ec4655 100644 --- a/server.go +++ b/server.go @@ -403,9 +403,15 @@ func (s *server) genNodeAnnouncement(refresh bool) (*lnwire.NodeAnnouncement, er } var err error - s.currentNodeAnn.Timestamp = uint32(time.Now().Unix()) - s.currentNodeAnn.Signature, err = discovery.SignAnnouncement(s.nodeSigner, - s.identityPriv.PubKey(), s.currentNodeAnn, + + newStamp := uint32(time.Now().Unix()) + if newStamp <= s.currentNodeAnn.Timestamp { + newStamp = s.currentNodeAnn.Timestamp + 1 + } + + s.currentNodeAnn.Timestamp = newStamp + s.currentNodeAnn.Signature, err = discovery.SignAnnouncement( + s.nodeSigner, s.identityPriv.PubKey(), s.currentNodeAnn, ) return s.currentNodeAnn, err