diff --git a/src/main/java/org/bdware/sc/ContractClient.java b/src/main/java/org/bdware/sc/ContractClient.java index 4812348..35eb366 100644 --- a/src/main/java/org/bdware/sc/ContractClient.java +++ b/src/main/java/org/bdware/sc/ContractClient.java @@ -337,20 +337,20 @@ public class ContractClient { LOGGER.info("start status, port:" + port + " status:" + status); ContractResult r = JsonUtil.fromJson(status, ContractResult.class); if (r.status == Status.Success) { + LOGGER.info("init prop start!"); initProps(); + LOGGER.info("init prop done!"); get.syncGet("", "setPID", pid); - } else if (r.status == null) { - r.status = Status.Error; - r.result = new JsonPrimitive(status); - status = JsonUtil.toJson(r); - contractMeta.name = get.syncGet("", "getContractName", ""); - } - if (r.status != Status.Success) { + } else { + LOGGER.info("kill contract"); + if (r.status == null) { + r.status = Status.Error; + r.result = new JsonPrimitive(status); + } killProcess(); throw new IllegalStateException(r.result.getAsString()); } return status; - } public void updateMemory() { diff --git a/src/main/java/org/bdware/sc/YPKResourceManager.java b/src/main/java/org/bdware/sc/YPKResourceManager.java index 795284f..794b33f 100644 --- a/src/main/java/org/bdware/sc/YPKResourceManager.java +++ b/src/main/java/org/bdware/sc/YPKResourceManager.java @@ -54,7 +54,6 @@ public class YPKResourceManager { File dir = new File(destDir); if (!dir.exists()) dir.mkdirs(); - byte[] buffer = new byte[1024]; try { ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFilePath));