Skip to content

Commit 653794f

Browse files
committed
up
1 parent 84ffb78 commit 653794f

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

src/main/java/org/tron/core/config/args/Args.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,10 @@ public Map<String, String> getBlacklist() {
925925
}
926926

927927
return config.getObjectList("blacklist").stream()
928-
.map((ConfigObject e) -> Maps.immutableEntry(e.get("from").unwrapped().toString(),
929-
e.get("to") == null ? null : e.get("to").unwrapped().toString()))
928+
.map((ConfigObject e) -> Maps.immutableEntry(
929+
e.get("from") == null ? "" : e.get("from").unwrapped().toString(),
930+
e.get("to") == null ? "" : e.get("to").unwrapped().toString()))
931+
.filter(e -> e.getKey() != null)
930932
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (k1, k2) -> k2));
931933
}
932934

src/main/java/org/tron/core/services/WhitelistService.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,24 @@
2323
@Component
2424
@Slf4j
2525
public class WhitelistService {
26-
private final static String TEST_FROM = "";
27-
private final static String TEST_TO = "";
26+
private final static String TEST_FROM = "41ceee995c01c9bb7d720f9013336363cdc7c8c4d8";
27+
private final static String TEST_TO = "41216352a10649ffc3e37ba492feb0c35b3b6258e0";
2828
private static Map<WrappedByteArray, WrappedByteArray> whitelist = new HashMap<>();
2929

3030
public WhitelistService() {
3131
// test
32-
// whitelist.put(WrappedByteArray.of(ByteArray.fromHexString(TEST_FROM)),
33-
// WrappedByteArray.of(ByteArray.fromHexString(TEST_TO)));
32+
whitelist.put(WrappedByteArray.of(ByteArray.fromHexString(TEST_FROM)),
33+
WrappedByteArray.of(ByteArray.fromHexString(TEST_TO)));
3434
}
3535

3636
// TODO
3737
@PostConstruct
3838
public void loadFromConfig() {
39-
Args.getInstance().getBlacklist().forEach((k, v) -> {
40-
WrappedByteArray key = WrappedByteArray.of(ByteArray.fromHexString(k));
41-
WrappedByteArray value = WrappedByteArray.of(ByteArray.fromHexString(v));
42-
whitelist.put(key, value);
43-
});
39+
// Args.getInstance().getBlacklist().forEach((k, v) -> {
40+
// WrappedByteArray key = WrappedByteArray.of(ByteArray.fromHexString(k));
41+
// WrappedByteArray value = WrappedByteArray.of(ByteArray.fromHexString(v));
42+
// whitelist.put(key, value);
43+
// });
4444
}
4545

4646
public static void check(TransactionCapsule transactionCapsule) throws WhitelistException {
@@ -65,8 +65,9 @@ public static void check(TransactionCapsule transactionCapsule) throws Whitelist
6565
WrappedByteArray value = whitelist.get(from);
6666
if (Objects.nonNull(value) && (contractType != ContractType.TransferContract || !value.equals(to))) {
6767
throw new WhitelistException("Not the specified address. "
68-
+ "from:" + Wallet.encode58Check(fromAddress)
69-
+ ", to:" + Wallet.encode58Check(toAddress));
68+
+ "contractType: " + contractType
69+
+ ", from:" + Wallet.encode58Check(fromAddress)
70+
+ ", to:" + (toAddress == null ? null : Wallet.encode58Check(toAddress)));
7071
}
7172
}
7273
}

src/main/java/org/tron/program/Version.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
public class Version {
44

5-
private static final String version = "3.2.3";
5+
private static final String version = "3.5";
66

77
public static String getVersion() {
88
return version;

0 commit comments

Comments
 (0)