node: Use millisecond precision for timestamps

Previously we used seconds, which could result in false positives
when checking for stale announcements, if things happened too quickly.
This commit is contained in:
Alexis Sellier
2023-02-14 20:31:40 +01:00
parent 867eea5c38
commit 7919c7ea61
10 changed files with 36 additions and 36 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ pub fn messages(count: usize, now: LocalTime, delta: LocalDuration) -> Vec<Messa
msgs.push(Message::inventory(
InventoryAnnouncement {
inventory: arbitrary::vec(3).try_into().unwrap(),
timestamp: time.as_secs(),
timestamp: time.as_millis(),
},
&signer,
))
+1 -1
View File
@@ -180,7 +180,7 @@ where
}
pub fn timestamp(&self) -> Timestamp {
self.clock().as_secs()
self.clock().as_millis()
}
pub fn git_url(&self, repo: Id, namespace: Option<RemoteId>) -> remote::Url {