mirror of
https://github.com/FlipsideCrypto/dcrd.git
synced 2026-02-06 10:56:47 +00:00
server: Remove unused dynamicTickDuration func.
This commit is contained in:
parent
20caedc344
commit
b39c637145
22
server.go
22
server.go
@ -2737,28 +2737,6 @@ func addrStringToNetAddr(addr string) (net.Addr, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// dynamicTickDuration is a convenience function used to dynamically choose a
|
||||
// tick duration based on remaining time. It is primarily used during
|
||||
// server shutdown to make shutdown warnings more frequent as the shutdown time
|
||||
// approaches.
|
||||
func dynamicTickDuration(remaining time.Duration) time.Duration {
|
||||
switch {
|
||||
case remaining <= time.Second*5:
|
||||
return time.Second
|
||||
case remaining <= time.Second*15:
|
||||
return time.Second * 5
|
||||
case remaining <= time.Minute:
|
||||
return time.Second * 15
|
||||
case remaining <= time.Minute*5:
|
||||
return time.Minute
|
||||
case remaining <= time.Minute*15:
|
||||
return time.Minute * 5
|
||||
case remaining <= time.Hour:
|
||||
return time.Minute * 15
|
||||
}
|
||||
return time.Hour
|
||||
}
|
||||
|
||||
// isWhitelisted returns whether the IP address is included in the whitelisted
|
||||
// networks and IPs.
|
||||
func isWhitelisted(addr net.Addr) bool {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user