Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CountDownLatch;
import lombok.extern.log4j.Log4j2;
Expand Down Expand Up @@ -332,15 +333,15 @@ private List<PeerOfConsensusStatus> getPeerOfConsensusStatus(int chainId, int gr
if (StringUtils.isBlank(consensusStatusJson)) {
return null;
}
List jsonArr = JacksonUtils.stringToObj(consensusStatusJson, List.class);
Map jsonArr = JacksonUtils.stringToObj(consensusStatusJson, Map.class);
if (jsonArr == null) {
return null;
}
List<PeerOfConsensusStatus> dataIsList = new ArrayList<>();
for (int i = 0; i < jsonArr.size(); i++) {
if (jsonArr.get(i) instanceof List) {
if (jsonArr.get("viewInfos") instanceof List) {
List<PeerOfConsensusStatus> tempList =
JacksonUtils.stringToObj(JacksonUtils.objToString(jsonArr.get(i)),
JacksonUtils.stringToObj(JacksonUtils.objToString(jsonArr.get("viewInfos")),
new TypeReference<List<PeerOfConsensusStatus>>() {});
if (tempList != null) {
dataIsList.addAll(tempList);
Expand Down