Make validators opt out of crawl:

If a server is configured to support crawl, it will report the
IP addresses of all peers it is connected to, unless those peers
have explicitly opted out by setting the `peer_private` option
in their config file.

This commit makes servers that are configured as validators
opt out of crawling.
This commit is contained in:
Nik Bougalis
2019-02-24 10:49:32 -08:00
parent c6ab880c03
commit b335adb674

View File

@@ -481,8 +481,17 @@ OverlayImpl::onPrepare()
auto const port = serverHandler_.setup().overlay.port;
config.peerPrivate = app_.config().PEER_PRIVATE;
config.wantIncoming =
(! config.peerPrivate) && (port != 0);
// Servers with peer privacy don't want to allow incoming connections
config.wantIncoming = (! config.peerPrivate) && (port != 0);
// This will cause servers configured as validators to request that
// peers they connect to never report their IP address. We set this
// after we set the 'wantIncoming' because we want a "soft" version
// of peer privacy unless the operator explicitly asks for it.
if (!app_.getValidationPublicKey().empty())
config.peerPrivate = true;
// if it's a private peer or we are running as standalone
// automatic connections would defeat the purpose.
config.autoConnect =