We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4876e7 commit c14d42eCopy full SHA for c14d42e
1 file changed
framework/src/main/java/org/tron/core/net/service/sync/SyncService.java
@@ -209,11 +209,12 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws P2p
209
}
210
211
private BlockId getBlockIdByNum(long num) throws P2pException {
212
- BlockId head = tronNetDelegate.getHeadBlockId();
213
- if (num > head.getNum()) {
214
- return tronNetDelegate.getKhaosDbHeadBlockId();
215
- } else if (num == head.getNum()) {
216
- return head;
+ BlockId head1 = tronNetDelegate.getKhaosDbHeadBlockId();
+ BlockId head2 = tronNetDelegate.getHeadBlockId();
+ if (num == head1.getNum()) {
+ return head1;
+ } else if (num == head2.getNum()) {
217
+ return head2;
218
219
return tronNetDelegate.getBlockIdByNum(num);
220
0 commit comments