mirror of
https://gitee.com/BDWare/cp.git
synced 2025-01-10 01:44:08 +00:00
fix: rocksdb null
This commit is contained in:
parent
6673cedf0f
commit
dff61f8246
@ -168,6 +168,12 @@ public class ContractProcess {
|
||||
return res;
|
||||
}
|
||||
|
||||
public static String getContractDir() {
|
||||
if (instance!=null && instance.cn!=null && instance.cn.getContractName()!=null)
|
||||
return instance.cn.getContractName();
|
||||
return "debug";
|
||||
}
|
||||
|
||||
public String getContractName() {
|
||||
return cn.getContractName();
|
||||
}
|
||||
|
@ -30,7 +30,8 @@ public class RocksDBUtil {
|
||||
this.path = path;
|
||||
Options options = new Options();
|
||||
options.setCreateIfMissing(true);
|
||||
File parent = new File("./ContractDB/" + ContractProcess.instance.getContractName());
|
||||
|
||||
File parent = new File("./ContractDB/" + ContractProcess.getContractDir());
|
||||
File dir = new File(parent, path);
|
||||
if (!dir.exists()) dir.mkdirs();
|
||||
File lockFile = new File(dir, "LOCK");
|
||||
|
Loading…
Reference in New Issue
Block a user