use humantime_serde
This commit is contained in:
parent
d385e9f855
commit
51d8029048
|
@ -15,6 +15,7 @@ nomos-mix-message = { path = "../message" }
|
|||
futures = "0.3"
|
||||
x25519-dalek = { version = "2", features = ["getrandom", "static_secrets"] }
|
||||
fixed = { version = "1", features = ["serde-str"] }
|
||||
humantime-serde = "1"
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -233,6 +233,7 @@ pub struct ConnectionMonitor {
|
|||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
pub struct ConnectionMonitorSettings {
|
||||
/// Time interval to measure/evaluate the number of messages sent by each peer.
|
||||
#[serde(with = "humantime_serde")]
|
||||
pub time_window: Duration,
|
||||
/// The number of effective (data or cover) messages that a peer is expected to send in a given time window.
|
||||
/// If the measured count is greater than (expected * (1 + tolerance)), the peer is considered malicious.
|
||||
|
|
Loading…
Reference in New Issue