77import java .util .ArrayList ;
88import java .util .Collections ;
99import java .util .HashMap ;
10- import java .util .HashSet ;
1110import java .util .LinkedList ;
1211import java .util .List ;
1312import java .util .Map ;
2120import org .springframework .beans .factory .annotation .Autowired ;
2221import org .springframework .stereotype .Component ;
2322import org .tron .common .overlay .server .Channel .TronState ;
24- import org .tron .common .utils .Sha256Hash ;
2523import org .tron .core .capsule .BlockCapsule ;
2624import org .tron .core .capsule .BlockCapsule .BlockId ;
2725import org .tron .core .config .Parameter .NodeConstant ;
@@ -194,7 +192,6 @@ private LinkedList<BlockId> getBlockChainSummary(PeerConnection peer) throws Exc
194192
195193 private void startFetchSyncBlock () {
196194 HashMap <PeerConnection , List <BlockId >> send = new HashMap <>();
197- // HashSet<BlockId> request = new HashSet<>();
198195
199196 tronProxy .getActivePeer ().stream ()
200197 .filter (peer -> peer .isNeedSyncFromPeer () && peer .isIdle ())
@@ -207,7 +204,6 @@ private void startFetchSyncBlock() {
207204 requestBlockIds .put (blockId , System .currentTimeMillis ());
208205 peer .getSyncBlockRequested ().put (blockId , System .currentTimeMillis ());
209206 send .get (peer ).add (blockId );
210- // request.add(blockId);
211207 if (send .get (peer ).size () >= MAX_BLOCK_FETCH_PER_PEER ) {
212208 break ;
213209 }
@@ -216,16 +212,10 @@ private void startFetchSyncBlock() {
216212 });
217213
218214 send .forEach ((peer , blockIds ) -> {
219- // blockIds.forEach(blockId -> {
220- // requestBlockIds.put(blockId, System.currentTimeMillis());
221- // peer.getSyncBlockRequested().put(blockId, System.currentTimeMillis());
222- // });
223215 if (!blockIds .isEmpty ()) {
224216 peer .sendMessage (new FetchInvDataMessage (new LinkedList <>(blockIds ), InventoryType .BLOCK ));
225217 }
226218 });
227-
228- // send.clear();
229219 }
230220
231221 private synchronized void handleSyncBlock () {
0 commit comments