optimize verifykey

This commit is contained in:
CaiHQ 2021-11-30 17:17:55 +08:00
parent f35c257697
commit 3c4c33bb1b

View File

@ -1295,13 +1295,19 @@ public class ContractManager {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
// 9000 // 9000
if (client.contractMeta.sigRequired) { if (client.contractMeta.sigRequired) {
if (!request.verifySignature()) { if (!request.verifySignature()) {
cr = new ContractResult(Status.Error, new JsonPrimitive("sign verified failed")); cr = new ContractResult(Status.Error, new JsonPrimitive("sign verified failed"));
rcb.onResult(JsonUtil.parseObjectAsJsonObject(cr)); rcb.onResult(JsonUtil.parseObjectAsJsonObject(cr));
return; return;
} }
} else {
if (request.getPublicKey() != null) {
if (!request.verifySignature()) {
request.setPublicKey(null);
request.setRequester(null);
}
}
} }
client.times++; client.times++;
client.contractStatus = ContractStatus.Executing; client.contractStatus = ContractStatus.Executing;
@ -1358,6 +1364,13 @@ public class ContractManager {
cr = new ContractResult(Status.Error, new JsonPrimitive("sign verified failed")); cr = new ContractResult(Status.Error, new JsonPrimitive("sign verified failed"));
return JsonUtil.toJson(cr); return JsonUtil.toJson(cr);
} }
} else {
if (request.getPublicKey() != null) {
if (!request.verifySignature()) {
request.setPublicKey(null);
request.setRequester(null);
}
}
} }
client.times++; client.times++;
// 将合约状态改为Executing // 将合约状态改为Executing