This repository was archived by the owner on Dec 10, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +12
-16
lines changed
Expand file tree Collapse file tree 6 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -71,12 +71,12 @@ export class Config {
7171 // Also a fix for https://github.com/ethereumjs/ethereumjs-vm/issues/757
7272
7373 // TODO: map chainParams (and lib/util.parseParams) to new Common format
74- this . common = options . common ? options . common : Config . COMMON_DEFAULT
75- this . logger = options . logger ? options . logger : Config . LOGGER_DEFAULT
76- this . servers = options . servers ? options . servers : Config . SERVERS_DEFAULT
77- this . syncmode = options . syncmode ? options . syncmode : Config . SYNCMODE_DEFAULT
78- this . lightserv = options . lightserv ? options . lightserv : Config . LIGHTSERV_DEFAULT
79- this . minPeers = options . minPeers ? options . minPeers : Config . MINPEERS_DEFAULT
80- this . maxPeers = options . maxPeers ? options . maxPeers : Config . MAXPEERS_DEFAULT
74+ this . common = options . common ?? Config . COMMON_DEFAULT
75+ this . logger = options . logger ?? Config . LOGGER_DEFAULT
76+ this . servers = options . servers ?? Config . SERVERS_DEFAULT
77+ this . syncmode = options . syncmode ?? Config . SYNCMODE_DEFAULT
78+ this . lightserv = options . lightserv ?? Config . LIGHTSERV_DEFAULT
79+ this . minPeers = options . minPeers ?? Config . MINPEERS_DEFAULT
80+ this . maxPeers = options . maxPeers ?? Config . MAXPEERS_DEFAULT
8181 }
8282}
Original file line number Diff line number Diff line change @@ -41,9 +41,8 @@ export class Peer extends events.EventEmitter {
4141 constructor ( options : any ) {
4242 super ( )
4343
44- this . config = options . config
45-
4644 options = { ...defaultOptions , ...options }
45+ this . config = options . config
4746
4847 this . id = options . id
4948 this . address = options . address
Original file line number Diff line number Diff line change @@ -49,9 +49,9 @@ export class Protocol extends EventEmitter {
4949 constructor ( options ?: any ) {
5050 super ( )
5151
52+ options = { ...defaultOptions , ...options }
5253 this . config = options . config
5354
54- options = { ...defaultOptions , ...options }
5555 this . timeout = options . timeout
5656 this . opened = false
5757 }
Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ export class Server extends EventEmitter {
2424 constructor ( options : any ) {
2525 super ( )
2626
27- this . config = options . config
28-
2927 options = { ...defaultOptions , ...options }
28+ this . config = options . config
3029
3130 this . refreshInterval = options . refreshInterval
3231 this . protocols = new Set ( )
Original file line number Diff line number Diff line change @@ -48,9 +48,8 @@ export class Fetcher extends Readable {
4848 constructor ( options : any ) {
4949 super ( { ...options , objectMode : true } )
5050
51- this . config = options . config
52-
5351 options = { ...defaultOptions , ...options }
52+ this . config = options . config
5453
5554 this . pool = options . pool
5655 this . timeout = options . timeout
Original file line number Diff line number Diff line change @@ -35,9 +35,8 @@ export class Synchronizer extends EventEmitter {
3535 constructor ( options ?: any ) {
3636 super ( )
3737
38- this . config = options . config
39-
4038 options = { ...defaultOptions , ...options }
39+ this . config = options . config
4140
4241 this . pool = options . pool
4342 this . chain = options . chain
You can’t perform that action at this time.
0 commit comments