diff --git a/src/main/java/org/bdware/sc/ContractManager.java b/src/main/java/org/bdware/sc/ContractManager.java index 6a09641..4ba4203 100644 --- a/src/main/java/org/bdware/sc/ContractManager.java +++ b/src/main/java/org/bdware/sc/ContractManager.java @@ -1295,13 +1295,19 @@ public class ContractManager { long start = System.currentTimeMillis(); // 9000 - if (client.contractMeta.sigRequired) { if (!request.verifySignature()) { cr = new ContractResult(Status.Error, new JsonPrimitive("sign verified failed")); rcb.onResult(JsonUtil.parseObjectAsJsonObject(cr)); return; } + } else { + if (request.getPublicKey() != null) { + if (!request.verifySignature()) { + request.setPublicKey(null); + request.setRequester(null); + } + } } client.times++; client.contractStatus = ContractStatus.Executing; @@ -1358,6 +1364,13 @@ public class ContractManager { cr = new ContractResult(Status.Error, new JsonPrimitive("sign verified failed")); return JsonUtil.toJson(cr); } + } else { + if (request.getPublicKey() != null) { + if (!request.verifySignature()) { + request.setPublicKey(null); + request.setRequester(null); + } + } } client.times++; // 将合约状态改为“Executing”