Skip to content

Commit 7fe685f

Browse files
committed
fix(net): use equals to compare BlockId
1 parent bacd8c2 commit 7fe685f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

framework/src/main/java/org/tron/core/net/service/sync/SyncService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws P2p
169169
if (beginBlockId.getNum() == 0) {
170170
highNoFork = high = tronNetDelegate.getHeadBlockId().getNum();
171171
} else {
172-
if (tronNetDelegate.getKhaosDbHeadBlockId().compareTo(beginBlockId) == 0
172+
if (tronNetDelegate.getKhaosDbHeadBlockId().equals(beginBlockId)
173173
|| tronNetDelegate.containBlockInMainChain(beginBlockId)) {
174174
highNoFork = high = beginBlockId.getNum();
175175
} else {

0 commit comments

Comments
 (0)