1919 */
2020#include < bitcoin/server/config/settings.hpp>
2121
22+ #include < cstdint>
2223#include < iostream>
2324#include < string>
2425#include < vector>
@@ -133,29 +134,29 @@ const options_description config_type::load_settings()
133134 value<bool >(&settings.log_requests )->default_value (false ),
134135 " Write service requests to the log, impacts performance, defaults to false."
135136 )
136- (
137- " general.listener_enabled" ,
138- value<bool >(&settings.listener_enabled )->default_value (true ),
139- " Enable the listening for incoming connections, defaults to true."
140- )
141137 (
142138 " general.publisher_enabled" ,
143139 value<bool >(&settings.publisher_enabled )->default_value (false ),
144140 " Enable the publisher, defaults to false."
145141 )
142+ (
143+ " general.listen_port" ,
144+ value<uint16_t >(&settings.listen_port )->default_value (BN_LISTEN_PORT ),
145+ " Set the port for incoming connections, set to 0 to disable listener, defaults to 8333 (18333 for testnet)."
146+ )
146147 (
147148 " general.tx_pool_capacity" ,
148- value<uint32_t >(&settings.tx_pool_capacity )->default_value (2000 ),
149+ value<uint32_t >(&settings.tx_pool_capacity )->default_value (BN_P2P_TX_POOL ),
149150 " The maximum number of transactions in the pool, defaults to 2000."
150151 )
151152 (
152153 " general.out_connections" ,
153- value<uint32_t >(&settings.out_connections )->default_value (8 ),
154+ value<uint32_t >(&settings.out_connections )->default_value (BN_P2P_OUTBOUND ),
154155 " The maximum number of outgoing P2P network connections, defaults to 8."
155156 )
156157 (
157158 " general.history_height" ,
158- value<uint32_t >(&settings.history_height )->default_value (0 ),
159+ value<uint32_t >(&settings.history_height )->default_value (BN_HISTORY_START_HEIGHT ),
159160 " The minimum height of the history database, defaults to 0."
160161 )
161162 (
@@ -185,8 +186,8 @@ const options_description config_type::load_settings()
185186 )
186187 (
187188 " general.hosts_file" ,
188- value<path>(&settings.hosts_file )->default_value (" hosts " ),
189- " The peer cache file path, defaults to 'hosts '."
189+ value<path>(&settings.hosts_file )->default_value (BN_HOSTS_FILENAME ),
190+ " The peer cache file path, defaults to 'peers '."
190191 )
191192 (
192193 " logging.debug_file" ,
@@ -210,7 +211,7 @@ const options_description config_type::load_settings()
210211 )
211212 (
212213 " general.blockchain_path" ,
213- value<path>(&settings.blockchain_path )->default_value (" blockchain " ),
214+ value<path>(&settings.blockchain_path )->default_value (BN_DIRECTORY ),
214215 " The blockchain directory, defaults to 'blockchain'."
215216 )
216217 (
0 commit comments