feat(config): p2p replication client and server separate for performance optimization

This commit is contained in:
Alexey Kasyanchuk
2018-07-02 04:48:28 +03:00
parent 352213ae0e
commit f8c6a401bc
8 changed files with 73 additions and 42 deletions

View File

@ -16,6 +16,7 @@ let config = {
p2pConnections: 10,
p2pBootstrap: true,
p2pReplication: true,
p2pReplicationServer: true,
upnp: true,
@ -76,7 +77,11 @@ const configProxy = new Proxy(config, {
value = 10
if(prop == 'p2pConnections' && value > 300)
value = 300
if(prop == 'p2pReplication' && value)
target['p2pReplicationServer'] = true
if(prop == 'p2pReplicationServer' && !value)
target['p2pReplication'] = false
target[prop] = value