Skip to content

Commit 76cf24f

Browse files
authored
Merge pull request #5283 from 317787106/hotfix/block_chain_failed
fix(net):prefer to get blockId from khaosdb in SyncService
2 parents de45672 + cb3df71 commit 76cf24f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,11 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws P2p
209209
}
210210

211211
private BlockId getBlockIdByNum(long num) throws P2pException {
212-
BlockId head = tronNetDelegate.getHeadBlockId();
212+
BlockId head = tronNetDelegate.getKhaosDbHeadBlockId();
213+
if (num == head.getNum()) {
214+
return head;
215+
}
216+
head = tronNetDelegate.getHeadBlockId();
213217
if (num == head.getNum()) {
214218
return head;
215219
}

0 commit comments

Comments
 (0)