@@ -46,8 +46,6 @@ type TcpOnionTx = mpsc::Sender<(InnerOnionResponse, SocketAddr)>;
46
46
/// After random requests count exceeds this number `NODES_REQ_INTERVAL` will be
47
47
/// used.
48
48
pub const MAX_BOOTSTRAP_TIMES : u32 = 5 ;
49
- /// Interval in seconds of sending `NatPingRequest` packet.
50
- pub const NAT_PING_REQ_INTERVAL : u64 = 3 ;
51
49
/// How often onion key should be refreshed.
52
50
pub const ONION_REFRESH_KEY_INTERVAL : u64 = 7200 ;
53
51
/// Interval in seconds for random `NodesRequest`.
@@ -69,6 +67,8 @@ pub const PRECOMPUTED_LRU_CACHE_SIZE: usize = KBUCKET_DEFAULT_SIZE as usize * KB
69
67
KBUCKET_DEFAULT_SIZE as usize * ( 2 + 10 ) ; // For friend's close_nodes of 2 fake friends + 10 friends reserved
70
68
/// Timeout in seconds for packet sending
71
69
pub const DHT_SEND_TIMEOUT : u64 = 1 ;
70
+ /// How often DHT main loop should be called.
71
+ const MAIN_LOOP_INTERVAL : u64 = 1 ;
72
72
73
73
/// Struct that contains necessary data for `BootstrapInfo` packet.
74
74
#[ derive( Clone ) ]
@@ -371,7 +371,7 @@ impl Server {
371
371
/// Run DHT main loop periodically. Result future will never be completed
372
372
/// successfully.
373
373
fn run_main_loop ( self ) -> impl Future < Item = ( ) , Error = Error > + Send {
374
- let interval = Duration :: from_secs ( 1 ) ;
374
+ let interval = Duration :: from_secs ( MAIN_LOOP_INTERVAL ) ;
375
375
let wakeups = Interval :: new ( Instant :: now ( ) , interval) ;
376
376
wakeups
377
377
. map_err ( |e| Error :: new ( ErrorKind :: Other , format ! ( "DHT server timer error: {:?}" , e) ) )
0 commit comments