server: make sure timestamp always increases when creating new ChannelUpdate
This commit is contained in:
1 file changed
+6
-1
@@ -2899,7 +2899,12 @@ func (s *server) disableChannel(op wire.OutPoint) error {
|
|||||||
|
|
||||||
// We must now update the message's timestamp and generate a new
|
// We must now update the message's timestamp and generate a new
|
||||||
// signature.
|
// 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()
|
chanUpdateMsg, err := chanUpdate.DataToSign()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user