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