File tree Expand file tree Collapse file tree 1 file changed +8
-18
lines changed Expand file tree Collapse file tree 1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -46,9 +46,9 @@ GethCommands.prototype.newAccountCommand = function() {
4646 return cmd + "account new " ;
4747} ;
4848
49- GethCommands . prototype . listAccountsCommand = function ( ) {
49+ GethCommands . prototype . commonOptions = function ( ) {
5050 var config = this . config ;
51- var cmd = "geth " ;
51+ var cmd = "" ;
5252
5353 if ( config . networkType === 'testnet' ) {
5454 cmd += "--testnet " ;
@@ -66,29 +66,19 @@ GethCommands.prototype.listAccountsCommand = function() {
6666 cmd += "--password " + config . account . password + " " ;
6767 }
6868
69- return cmd + "account list " ;
69+ return cmd ;
70+ } ;
71+
72+ GethCommands . prototype . listAccountsCommand = function ( ) {
73+ return "geth " + this . commonOptions ( ) + "account list " ;
7074} ;
7175
7276GethCommands . prototype . mainCommand = function ( address ) {
7377 var config = this . config ;
7478 var cmd = "geth " ;
7579 var rpc_api = [ 'eth' , 'web3' ] ;
7680
77- if ( config . datadir ) {
78- cmd += "--datadir=\"" + config . datadir + "\" " ;
79- }
80-
81- if ( config . networkType === 'testnet' ) {
82- cmd += "--testnet " ;
83- } else if ( config . networkType === 'olympic' ) {
84- cmd += "--olympic " ;
85- } else if ( config . networkType === 'custom' ) {
86- cmd += "--networkid " + config . networkId + " " ;
87- }
88-
89- if ( config . account && config . account . password ) {
90- cmd += "--password " + config . account . password + " " ;
91- }
81+ cmd += this . commonOptions ( ) ;
9282
9383 cmd += "--port " + "30303" + " " ;
9484 cmd += "--rpc " ;
You can’t perform that action at this time.
0 commit comments