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