server: make sure timestamp always increases when creating new ChannelUpdate

This commit is contained in:
Johan T. Halseth 2018-08-09 10:03:13 +02:00
parent 8826db32e8
commit 304577f617
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -2899,7 +2899,12 @@ func (s *server) disableChannel(op wire.OutPoint) error {
// We must now update the message's timestamp and generate a new
// signature.
chanUpdate.Timestamp = uint32(time.Now().Unix())
newTimestamp := uint32(time.Now().Unix())
if newTimestamp <= chanUpdate.Timestamp {
// Timestamp must increase for message to propagate.
newTimestamp = chanUpdate.Timestamp + 1
}
chanUpdate.Timestamp = newTimestamp
chanUpdateMsg, err := chanUpdate.DataToSign()
if err != nil {