use of io.nuls.consensus.event.TxGroupEvent in project nuls by nuls-io.
the class GetTxGroupHandler method onEvent.
@Override
public void onEvent(GetTxGroupRequest event, String fromId) {
GetTxGroupParam eventBody = event.getEventBody();
Block block = blockService.getBlock(eventBody.getBlockHash().getDigestHex());
if (null == block) {
return;
}
TxGroupEvent txGroupEvent = new TxGroupEvent();
TxGroup txGroup = new TxGroup();
txGroup.setBlockHash(block.getHeader().getHash());
List<Transaction> txList = getTxList(block, eventBody.getTxHashList());
txGroup.setTxList(txList);
txGroupEvent.setEventBody(txGroup);
eventBroadcaster.sendToNode(txGroupEvent, fromId);
}
Aggregations