use of io.nuls.consensus.event.BlockEvent in project nuls by nuls-io.
the class GetBlockHandler method onEvent.
@Override
public void onEvent(GetBlockRequest event, String fromId) throws NulsException {
List<Block> blockList = blockService.getBlockList(event.getStart(), event.getEnd());
for (Block block : blockList) {
if (null == block) {
continue;
}
BlockEvent blockEvent = new BlockEvent();
blockEvent.setEventBody(block);
eventBroadcaster.sendToNode(blockEvent, fromId);
}
}
Aggregations