From bc5dd8a1066f272ab88178b7a498d386720ee473 Mon Sep 17 00:00:00 2001 From: CaiHQ Date: Tue, 29 Nov 2022 15:14:58 +0800 Subject: [PATCH] add update node manager --- .../java/org/bdware/sc/ContractManager.java | 26 ------------------- .../sc/event/clients/ContractConsumer.java | 2 ++ 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/bdware/sc/ContractManager.java b/src/main/java/org/bdware/sc/ContractManager.java index ee042e5..206db32 100644 --- a/src/main/java/org/bdware/sc/ContractManager.java +++ b/src/main/java/org/bdware/sc/ContractManager.java @@ -1254,19 +1254,6 @@ public class ContractManager { ContractResult cr; long start = System.currentTimeMillis(); - // 9000 - if (null != request.getRequester() && !request.getRequester().startsWith("event")) { - 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 (null != request.getPublicKey() && request.getPublicKey().length() > 30 && !request.verifySignature()) { - request.setPublicKey(null); - } - } - client.times++; client.contractStatus = ContractStatus.Executing; ResultCallback acb; @@ -1316,19 +1303,6 @@ public class ContractManager { ContractResult cr; long start = System.currentTimeMillis(); LOGGER.debug(request.getContentStr()); - if (client.contractMeta.sigRequired) { - if (!request.verifySignature()) { - 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” client.contractStatus = ContractStatus.Executing; diff --git a/src/main/java/org/bdware/sc/event/clients/ContractConsumer.java b/src/main/java/org/bdware/sc/event/clients/ContractConsumer.java index 6422814..9940350 100644 --- a/src/main/java/org/bdware/sc/event/clients/ContractConsumer.java +++ b/src/main/java/org/bdware/sc/event/clients/ContractConsumer.java @@ -1,5 +1,6 @@ package org.bdware.sc.event.clients; +import com.google.gson.Gson; import com.google.gson.annotations.Expose; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -80,6 +81,7 @@ public class ContractConsumer implements IEventConsumer { return; } AtomicInteger callCount = new AtomicInteger(0); + LOGGER.info("ContractConsumer!"+new Gson().toJson(cr)); // TODO sending requests at a high frequency maybe cause that some requests are ignored ScheduledFuture future = ContractManager.scheduledThreadPool.scheduleAtFixedRate( () -> ContractManager.instance.executeContractInternal(cr, new ResultCallback() {