diff --git a/common/nuls-base-protocol-update/src/main/java/io/nuls/base/protocol/ProtocolGroupManager.java b/common/nuls-base-protocol-update/src/main/java/io/nuls/base/protocol/ProtocolGroupManager.java index b52aa5c65..e1bfd1118 100644 --- a/common/nuls-base-protocol-update/src/main/java/io/nuls/base/protocol/ProtocolGroupManager.java +++ b/common/nuls-base-protocol-update/src/main/java/io/nuls/base/protocol/ProtocolGroupManager.java @@ -66,6 +66,7 @@ public static void init(int chainId, Map protocolMap, short ver /** * 获取当前生效的协议版本号 + * * @param chainId * @return */ @@ -75,6 +76,7 @@ public static Short getCurrentVersion(int chainId) { /** * 获取当前生效的协议版本(包含消息、交易详细信息) + * * @param chainId * @return */ @@ -103,13 +105,13 @@ public static void updateProtocol(int chainId, short protocolVersion) { ProtocolGroup protocolGroup = protocolGroupMap.get(chainId); Protocol protocol = protocolGroup.getProtocolsMap().get(protocolVersion); //如果不存在给定版本号的协议信息,则取比当前版本号小的最大的一个协议 - if(protocol == null){ + if (protocol == null) { Set sortKey = new TreeSet<>(protocolGroup.getProtocolsMap().keySet()); short effectiveVersion = 1; - for (Short version : sortKey){ - if(version <= protocolVersion){ + for (Short version : sortKey) { + if (version <= protocolVersion) { effectiveVersion = version; - }else{ + } else { break; } } @@ -132,13 +134,11 @@ public static void updateProtocol(int chainId, short protocolVersion) { } }); messageDispatcher.setProcessors(messageProcessors); - //try { - // if (ConnectManager.getConnectByRole(ModuleE.TX.abbr) != null) { - // RegisterHelper.registerTx(chainId, protocol); - // } - //} catch (Exception e) { - // Log.warn(e.getMessage()); - //} + try { + RegisterHelper.registerTx(chainId, protocol); + } catch (Exception e) { + Log.warn(e.getMessage()); + } } } } diff --git a/module/nuls-cores/src/main/resources/protocol-config.json b/module/nuls-cores/src/main/resources/protocol-config.json index b0547f5b1..ace637bd8 100644 --- a/module/nuls-cores/src/main/resources/protocol-config.json +++ b/module/nuls-cores/src/main/resources/protocol-config.json @@ -1,4 +1,12 @@ [ + { + "version": "17", + "extend": "16", + "validTxs": [], + "validMsgs": [], + "invalidTxs": "", + "invalidMsgs": "" + }, { "version": "16", "extend": "15", @@ -115,7 +123,6 @@ "invalidTxs": "", "invalidMsgs": "" }, - { "version": "12", "extend": "11", @@ -141,7 +148,6 @@ "invalidTxs": "", "invalidMsgs": "" }, - { "version": "11", "extend": "10", @@ -373,7 +379,6 @@ "invalidTxs": "", "invalidMsgs": "" }, - { "version": "3", "extend": "2", @@ -429,7 +434,6 @@ "invalidTxs": "", "invalidMsgs": "" }, - { "version": "2", "extend": "1", diff --git a/version b/version index d76bd2ba3..94c60781e 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.17.0 +2.17.1 \ No newline at end of file