Skip to content

Commit c1a9ac5

Browse files
author
Sakary Jia
committed
fix error
1 parent a71aa01 commit c1a9ac5

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

actuator/src/main/java/org/tron/core/actuator/FreezeBalanceActuator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ public boolean execute(Object result) throws ContractExeException {
9494
dynamicStore
9595
.addTotalEnergyWeight(frozenBalance / 1000_000L);
9696
break;
97-
default:
97+
default:
98+
throw new ContractExeException(
99+
"ResourceCode error,valid ResourceCode[BANDWIDTH、ENERGY]");
98100
}
99101

100102
accountCapsule.setBalance(newBalance);

framework/src/main/java/org/tron/common/net/udp/message/discover/DiscoverMessageInspector.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88

99
public class DiscoverMessageInspector {
1010

11-
public static final Pattern PATTERN_IP = Pattern.compile("^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\.(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$");
11+
public static final Pattern PATTERN_IP =
12+
Pattern.compile("^(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])\\"
13+
+ ".(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\"
14+
+ ".(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)\\"
15+
+ ".(1\\d{2}|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d)$");
1216

1317
private static boolean isFound(String str, Pattern pattern) {
1418
if (str == null || pattern == null) {

0 commit comments

Comments
 (0)