server: make sure timestamp always increases when creating new ChannelUpdate

This commit is contained in:
Johan T. Halseth committed 2018-08-17 23:24:12 +02:00
1 parent 8826db32e8
commit 304577f617
1 file changed
+6 -1
+6 -1
View File
@@ -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 {