use of org.tron.core.net.message.SyncBlockChainMessage in project java-tron by tronprotocol.
the class NodeImpl method syncNextBatchChainIds.
private void syncNextBatchChainIds(PeerConnection peer) {
try {
Deque<BlockId> chainSummary = del.getBlockChainSummary(peer.getHeadBlockWeBothHave(), ((LinkedList<BlockId>) peer.getSyncBlockToFetch()));
peer.setSyncChainRequested(new Pair<>((LinkedList<BlockId>) chainSummary, System.currentTimeMillis()));
peer.sendMessage(new SyncBlockChainMessage((LinkedList<BlockId>) chainSummary));
} catch (Exception e) {
// TODO: use tron excpetion here
logger.debug(e.getMessage(), e);
// TODO: unlink?
disconnectPeer(peer, ReasonCode.BAD_PROTOCOL);
}
}
Aggregations