mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-16 00:00:37 +08:00
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:
@@ -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,
|
||||
))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user