diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2021-01-04 13:14:32 +0100 |
---|---|---|
committer | Vasil Dimov <vd@FreeBSD.org> | 2021-02-10 11:00:12 +0100 |
commit | aa17a44551c03b00a47854438afe9f2f89b6ea74 (patch) | |
tree | 32818a531a860f31a2ada1ae8fdef4341cc5296f /src/netbase.cpp | |
parent | 29d2aeb4a2b1830be4724aab3a84a62f072056f4 (diff) | |
download | bitcoin-aa17a44551c03b00a47854438afe9f2f89b6ea74.tar.xz |
net: move MillisToTimeval() from netbase to util/time
Move `MillisToTimeval()` from `netbase.{h,cpp}` to
`src/util/system.{h,cpp}`.
This is necessary in order to use `MillisToTimeval()` from a newly
introduced `src/util/sock.{h,cpp}` which cannot depend on netbase
because netbase will depend on it.
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r-- | src/netbase.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp index 264029d8a2..93c395b9ec 100644 --- a/src/netbase.cpp +++ b/src/netbase.cpp @@ -10,6 +10,7 @@ #include <util/strencodings.h> #include <util/string.h> #include <util/system.h> +#include <util/time.h> #include <atomic> #include <cstdint> @@ -271,14 +272,6 @@ CService LookupNumeric(const std::string& name, int portDefault) return addr; } -struct timeval MillisToTimeval(int64_t nTimeout) -{ - struct timeval timeout; - timeout.tv_sec = nTimeout / 1000; - timeout.tv_usec = (nTimeout % 1000) * 1000; - return timeout; -} - /** SOCKS version */ enum SOCKSVersion: uint8_t { SOCKS4 = 0x04, |