aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-08-25 20:12:08 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-11-10 17:29:56 +0100
commit8f4e67f152a9625a1c66c20de00679286b2c187c (patch)
tree69a6b3f08d8dc830139ed169858be5f75dd20206 /src/netbase.cpp
parentb56953e9bb5a32bc35365d1f0c5de5528c0650dd (diff)
downloadbitcoin-8f4e67f152a9625a1c66c20de00679286b2c187c.tar.xz
net: Automatically create hidden service, listen on Tor
Starting with Tor version 0.2.7.1 it is possible, through Tor's control socket API, to create and destroy 'ephemeral' hidden services programmatically. https://stem.torproject.org/api/control.html#stem.control.Controller.create_ephemeral_hidden_service This means that if Tor is running (and proper authorization is available), bitcoin automatically creates a hidden service to listen on, without user manual configuration. This will positively affect the number of available .onion nodes. - When the node is started, connect to Tor through control socket - Send `ADD_ONION` command - First time: - Make it create a hidden service key - Save the key in the data directory for later usage - Make it redirect port 8333 to the local port 8333 (or whatever port we're listening on). - Keep control socket connection open for as long node is running. The hidden service will (by default) automatically go away when the connection is closed.
Diffstat (limited to 'src/netbase.cpp')
-rw-r--r--src/netbase.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/netbase.cpp b/src/netbase.cpp
index f5316965ce..83cedfb620 100644
--- a/src/netbase.cpp
+++ b/src/netbase.cpp
@@ -227,10 +227,7 @@ bool LookupNumeric(const char *pszName, CService& addr, int portDefault)
return Lookup(pszName, addr, portDefault, false);
}
-/**
- * Convert milliseconds to a struct timeval for select.
- */
-struct timeval static MillisToTimeval(int64_t nTimeout)
+struct timeval MillisToTimeval(int64_t nTimeout)
{
struct timeval timeout;
timeout.tv_sec = nTimeout / 1000;