use of io.nuls.consensus.entity.tx.RedPunishTransaction in project nuls by nuls-io.
the class ConsensusMeetingRunner method redPunishTx.
private void redPunishTx(Block bestBlock, List<Transaction> txList) throws NulsException, IOException {
// todo check it
for (long height : punishMap.keySet()) {
RedPunishData data = punishMap.get(height);
punishMap.remove(height);
if (data.getHeight() < (bestBlock.getHeader().getHeight() + 1)) {
continue;
}
RedPunishTransaction tx = new RedPunishTransaction();
tx.setTxData(data);
tx.setTime(TimeService.currentTimeMillis());
tx.setFee(Na.ZERO);
tx.setHash(NulsDigestData.calcDigestData(tx));
tx.setScriptSig(accountService.createP2PKHScriptSigFromDigest(tx.getHash(), consensusManager.getConsensusStatusInfo().getAccount(), NulsContext.CACHED_PASSWORD_OF_WALLET).serialize());
txList.add(tx);
}
}
Aggregations