mirror of
https://gitee.com/BDWare/cm
synced 2025-01-10 09:54:03 +00:00
optimize verifykey
This commit is contained in:
parent
f35c257697
commit
3c4c33bb1b
@ -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”
|
||||||
|
Loading…
Reference in New Issue
Block a user