mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-11 12:20:50 +02:00
init: set nMaxOutboundLimit connection option directly
DEFAULT_MAX_UPLOAD_TARGET is a compile time constant.
This commit is contained in:
parent
173d0d35f1
commit
f805933e70
@ -1513,11 +1513,6 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
|||||||
RegisterValidationInterface(g_zmq_notification_interface);
|
RegisterValidationInterface(g_zmq_notification_interface);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
uint64_t nMaxOutboundLimit = 0; //unlimited unless -maxuploadtarget is set
|
|
||||||
|
|
||||||
if (args.IsArgSet("-maxuploadtarget")) {
|
|
||||||
nMaxOutboundLimit = args.GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET) * 1024 * 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ********************************************************* Step 7: load block chain
|
// ********************************************************* Step 7: load block chain
|
||||||
|
|
||||||
@ -1920,7 +1915,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
|||||||
connOptions.nReceiveFloodSize = 1000 * args.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
|
connOptions.nReceiveFloodSize = 1000 * args.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
|
||||||
connOptions.m_added_nodes = args.GetArgs("-addnode");
|
connOptions.m_added_nodes = args.GetArgs("-addnode");
|
||||||
|
|
||||||
connOptions.nMaxOutboundLimit = nMaxOutboundLimit;
|
connOptions.nMaxOutboundLimit = 1024 * 1024 * args.GetArg("-maxuploadtarget", DEFAULT_MAX_UPLOAD_TARGET);
|
||||||
connOptions.m_peer_connect_timeout = peer_connect_timeout;
|
connOptions.m_peer_connect_timeout = peer_connect_timeout;
|
||||||
|
|
||||||
for (const std::string& bind_arg : args.GetArgs("-bind")) {
|
for (const std::string& bind_arg : args.GetArgs("-bind")) {
|
||||||
|
@ -75,7 +75,7 @@ static const bool DEFAULT_UPNP = false;
|
|||||||
/** The maximum number of peer connections to maintain. */
|
/** The maximum number of peer connections to maintain. */
|
||||||
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
|
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
|
||||||
/** The default for -maxuploadtarget. 0 = Unlimited */
|
/** The default for -maxuploadtarget. 0 = Unlimited */
|
||||||
static const uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;
|
static constexpr uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;
|
||||||
/** Default for blocks only*/
|
/** Default for blocks only*/
|
||||||
static const bool DEFAULT_BLOCKSONLY = false;
|
static const bool DEFAULT_BLOCKSONLY = false;
|
||||||
/** -peertimeout default */
|
/** -peertimeout default */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user