File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -313,19 +313,23 @@ Bitcoin.prototype._parseBitcoinConf = function(configPath) {
313
313
return options ;
314
314
} ;
315
315
316
+ Bitcoin . prototype . _expandRelativeDatadir = function ( ) {
317
+ if ( ! utils . isAbsolutePath ( this . options . spawn . datadir ) ) {
318
+ $ . checkState ( this . node . configPath ) ;
319
+ $ . checkState ( utils . isAbsolutePath ( this . node . configPath ) ) ;
320
+ var baseConfigPath = path . dirname ( this . node . configPath ) ;
321
+ this . options . spawn . datadir = path . resolve ( baseConfigPath , this . options . spawn . datadir ) ;
322
+ }
323
+ } ;
324
+
316
325
Bitcoin . prototype . _loadSpawnConfiguration = function ( node ) {
317
326
/* jshint maxstatements: 25 */
318
327
319
328
$ . checkArgument ( this . options . spawn , 'Please specify "spawn" in bitcoind config options' ) ;
320
329
$ . checkArgument ( this . options . spawn . datadir , 'Please specify "spawn.datadir" in bitcoind config options' ) ;
321
330
$ . checkArgument ( this . options . spawn . exec , 'Please specify "spawn.exec" in bitcoind config options' ) ;
322
331
323
- if ( ! utils . isAbsolutePath ( this . options . spawn . datadir ) ) {
324
- $ . checkState ( this . node . configPath ) ;
325
- $ . checkState ( utils . isAbsolutePath ( this . node . configPath ) ) ;
326
- var baseConfigPath = path . dirname ( this . node . configPath ) ;
327
- this . options . spawn . datadir = path . resolve ( baseConfigPath , this . options . spawn . datadir ) ;
328
- }
332
+ this . _expandRelativeDatadir ( ) ;
329
333
330
334
var spawnOptions = this . options . spawn ;
331
335
var configPath = path . resolve ( spawnOptions . datadir , './bitcoin.conf' ) ;
You can’t perform that action at this time.
0 commit comments