File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,10 +87,6 @@ const MAX_BAN_COUNT: u32 = 1000;
8787
8888const MAX_ACTION_COUNT : u64 = 1_000_000 ;
8989
90- fn default_instant ( ) -> Instant {
91- Instant :: now ( )
92- }
93-
9490fn clamp_peer_score < ' de , D > ( deserializer : D ) -> Result < i32 , D :: Error >
9591where
9692 D : Deserializer < ' de > ,
@@ -149,7 +145,7 @@ pub struct PeerReputation {
149145 pub banned_until : Option < Instant > ,
150146
151147 /// Last time the reputation was updated
152- #[ serde( skip, default = "default_instant " ) ]
148+ #[ serde( skip, default = "Instant::now " ) ]
153149 pub last_update : Instant ,
154150
155151 /// Total number of positive actions
@@ -176,7 +172,7 @@ impl Default for PeerReputation {
176172 score : 0 ,
177173 ban_count : 0 ,
178174 banned_until : None ,
179- last_update : default_instant ( ) ,
175+ last_update : Instant :: now ( ) ,
180176 positive_actions : 0 ,
181177 negative_actions : 0 ,
182178 connection_attempts : 0 ,
You can’t perform that action at this time.
0 commit comments