mirror of
https://gitee.com/BDWare/cm
synced 2025-01-10 09:54:03 +00:00
add update node manager
This commit is contained in:
parent
8ce956a5c7
commit
bc5dd8a106
@ -1254,19 +1254,6 @@ public class ContractManager {
|
|||||||
ContractResult cr;
|
ContractResult cr;
|
||||||
|
|
||||||
long start = System.currentTimeMillis();
|
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.times++;
|
||||||
client.contractStatus = ContractStatus.Executing;
|
client.contractStatus = ContractStatus.Executing;
|
||||||
ResultCallback acb;
|
ResultCallback acb;
|
||||||
@ -1316,19 +1303,6 @@ public class ContractManager {
|
|||||||
ContractResult cr;
|
ContractResult cr;
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
LOGGER.debug(request.getContentStr());
|
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++;
|
client.times++;
|
||||||
// 将合约状态改为“Executing”
|
// 将合约状态改为“Executing”
|
||||||
client.contractStatus = ContractStatus.Executing;
|
client.contractStatus = ContractStatus.Executing;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package org.bdware.sc.event.clients;
|
package org.bdware.sc.event.clients;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@ -80,6 +81,7 @@ public class ContractConsumer implements IEventConsumer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AtomicInteger callCount = new AtomicInteger(0);
|
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
|
// TODO sending requests at a high frequency maybe cause that some requests are ignored
|
||||||
ScheduledFuture<?> future = ContractManager.scheduledThreadPool.scheduleAtFixedRate(
|
ScheduledFuture<?> future = ContractManager.scheduledThreadPool.scheduleAtFixedRate(
|
||||||
() -> ContractManager.instance.executeContractInternal(cr, new ResultCallback() {
|
() -> ContractManager.instance.executeContractInternal(cr, new ResultCallback() {
|
||||||
|
Loading…
Reference in New Issue
Block a user