File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,27 @@ class EnforcerLive extends EnforcerRPC {
100100 '--node-rpc-pass=${mainchainConf .password }' ,
101101 '--node-rpc-user=${mainchainConf .username }' ,
102102 '--node-rpc-addr=$host :${mainchainConf .port }' ,
103+ '--node-blocks-dir=${coreBlocksDir (mainchainConf )}' ,
103104 '--enable-wallet' ,
104105 if (binary.extraBootArgs.isNotEmpty) ...binary.extraBootArgs,
105106 ];
106107 }
107108
109+ String coreBlocksDir (CoreConnectionSettings mainchainConf) {
110+ // Determine the blocks directory
111+ if (mainchainConf.configValues.containsKey ('blocksdir' )) {
112+ // If blocksdir is explicitly set, use it directly
113+ return mainchainConf.configValues['blocksdir' ]! ;
114+ } else if (mainchainConf.configValues.containsKey ('datadir' )) {
115+ // If datadir is set, use datadir/blocks
116+ return path.join (mainchainConf.configValues['datadir' ]! , 'blocks' );
117+ } else {
118+ // If neither is set, use default datadir/blocks
119+ final defaultDatadir = BitcoinCore ().datadir ();
120+ return path.join (defaultDatadir, 'blocks' );
121+ }
122+ }
123+
108124 @override
109125 Map <String , String > get environment {
110126 return {'RUST_BACKTRACE' : '1' };
You can’t perform that action at this time.
0 commit comments