Skip to content

Commit b4876e7

Browse files
committed
fix(net):if num is bigger than head num, get blockid from khaosdb
1 parent de45672 commit b4876e7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws P2p
210210

211211
private BlockId getBlockIdByNum(long num) throws P2pException {
212212
BlockId head = tronNetDelegate.getHeadBlockId();
213-
if (num == head.getNum()) {
213+
if (num > head.getNum()) {
214+
return tronNetDelegate.getKhaosDbHeadBlockId();
215+
} else if (num == head.getNum()) {
214216
return head;
215217
}
216218
return tronNetDelegate.getBlockIdByNum(num);

0 commit comments

Comments
 (0)