From ea00a2d0d06d1afbeec650f416b6fc8df78f4510 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Tue, 20 Nov 2012 14:47:55 -0800 Subject: [PATCH] Add configuration support for peer_private. --- rippled-example.cfg | 8 +++++++- src/cpp/ripple/Config.cpp | 6 ++++++ src/cpp/ripple/Config.h | 3 ++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/rippled-example.cfg b/rippled-example.cfg index a57fa3a8c..0bbd0f5dd 100644 --- a/rippled-example.cfg +++ b/rippled-example.cfg @@ -76,6 +76,11 @@ # [peer_port]: # Port to bind to allow external connections from peers. # +# [peer_private]: +# 0 or 1. +# 0: allow peers to broadcast your address. [default] +# 1: request peers not broadcast your address. +# # [rpc_ip]: # IP address or domain to bind to allow insecure RPC connections. # Defaults to not allow RPC connections. @@ -84,7 +89,8 @@ # Port to bind to if allowing insecure RPC connections. # # [rpc_allow_remote]: -# 0 or 1. 0 only allows RPC connections from 127.0.0.1. [default 0] +# 0 or 1. +# 0: only allows RPC connections from 127.0.0.1. [default] # # [websocket_ip]: # IP address or domain to bind to allow client connections. diff --git a/src/cpp/ripple/Config.cpp b/src/cpp/ripple/Config.cpp index 68f2e3192..18c60c235 100644 --- a/src/cpp/ripple/Config.cpp +++ b/src/cpp/ripple/Config.cpp @@ -20,6 +20,7 @@ #define SECTION_PEER_CONNECT_LOW_WATER "peer_connect_low_water" #define SECTION_PEER_IP "peer_ip" #define SECTION_PEER_PORT "peer_port" +#define SECTION_PEER_PRIVATE "peer_private" #define SECTION_PEER_SCAN_INTERVAL_MIN "peer_scan_interval_min" #define SECTION_PEER_SSL_CIPHER_LIST "peer_ssl_cipher_list" #define SECTION_PEER_START_MAX "peer_start_max" @@ -143,6 +144,8 @@ void Config::setup(const std::string& strConf) PEER_START_MAX = DEFAULT_PEER_START_MAX; PEER_CONNECT_LOW_WATER = DEFAULT_PEER_CONNECT_LOW_WATER; + PEER_PRIVATE = false; + TRANSACTION_FEE_BASE = 1000; NETWORK_QUORUM = 0; // Don't need to see other nodes @@ -222,6 +225,9 @@ void Config::load() if (sectionSingleB(secConfig, SECTION_PEER_PORT, strTemp)) PEER_PORT = boost::lexical_cast(strTemp); + if (sectionSingleB(secConfig, SECTION_PEER_PRIVATE, strTemp)) + PEER_PRIVATE = boost::lexical_cast(strTemp); + (void) sectionSingleB(secConfig, SECTION_RPC_IP, RPC_IP); if (sectionSingleB(secConfig, SECTION_RPC_PORT, strTemp)) diff --git a/src/cpp/ripple/Config.h b/src/cpp/ripple/Config.h index 199b4292e..2caf47abf 100644 --- a/src/cpp/ripple/Config.h +++ b/src/cpp/ripple/Config.h @@ -66,7 +66,7 @@ public: int LEDGER_SECONDS; int LEDGER_PROPOSAL_DELAY_SECONDS; int LEDGER_AVALANCHE_SECONDS; - bool LEDGER_CREATOR; // should be false unless we are starting a new ledger + bool LEDGER_CREATOR; // Should be false unless we are starting a new ledger. bool RUN_STANDALONE; // Note: The following parameters do not relate to the UNL or trust at all @@ -81,6 +81,7 @@ public: int PEER_SCAN_INTERVAL_MIN; int PEER_START_MAX; unsigned int PEER_CONNECT_LOW_WATER; + bool PEER_PRIVATE; // True to ask peers not to relay current IP. // Websocket networking parameters std::string WEBSOCKET_PUBLIC_IP; // XXX Going away. Merge with the inbound peer connction.