io.nuls.kernel.model.Transaction.setBlockHeight()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(76)

本文整理了Java中io.nuls.kernel.model.Transaction.setBlockHeight()方法的一些代码示例,展示了Transaction.setBlockHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transaction.setBlockHeight()方法的具体详情如下:
包路径:io.nuls.kernel.model.Transaction
类名称:Transaction
方法名:setBlockHeight

Transaction.setBlockHeight介绍

暂无

代码示例

代码示例来源:origin: nuls-io/nuls

public static Block assemblyBlock(BlockHeader header, Map<NulsDigestData, Transaction> txMap, List<NulsDigestData> txHashList) {
    Block block = new Block();
    block.setHeader(header);
    List<Transaction> txs = new ArrayList<>();
    for (NulsDigestData txHash : txHashList) {
      Transaction tx = txMap.get(txHash);
      if (null == tx) {
        throw new NulsRuntimeException(TransactionErrorCode.TX_NOT_EXIST);
      }
      tx.setBlockHeight(header.getHeight());
      txs.add(tx);
    }
    block.setTxs(txs);
    return block;
  }
}

代码示例来源:origin: nuls-io/nuls

@Override
public void parse(NulsByteBuffer byteBuffer) throws NulsException {
  this.header = byteBuffer.readNulsData(new BlockHeader());
  this.txHashList = new ArrayList<>();
  long hashListSize = byteBuffer.readVarInt();
  for (int i = 0; i < hashListSize; i++) {
    this.txHashList.add(byteBuffer.readHash());
  }
  this.subTxList = new ArrayList<>();
  long subTxListSize = byteBuffer.readVarInt();
  for (int i = 0; i < subTxListSize; i++) {
    Transaction tx = byteBuffer.readTransaction();
    tx.setBlockHeight(header.getHeight());
    this.subTxList.add(tx);
  }
}

代码示例来源:origin: nuls-io/nuls

@Override
public void parse(NulsByteBuffer byteBuffer) throws NulsException {
  header = new BlockHeader();
  header.parse(byteBuffer);
  try {
    txs = TransactionManager.getInstances(byteBuffer, header.getTxCount());
  } catch (Exception e) {
    throw new NulsRuntimeException(KernelErrorCode.DESERIALIZE_ERROR);
  }
  for (Transaction tx : txs) {
    tx.setBlockHeight(header.getHeight());
  }
}

代码示例来源:origin: nuls-io/nuls

tx.setBlockHeight(bd.getHeight());
start = System.nanoTime();
packingTxList.add(tx);

代码示例来源:origin: nuls-io/nuls

for (int i = 0; i < blockData.getTxList().size(); i++) {
  Transaction tx = blockData.getTxList().get(i);
  tx.setBlockHeight(header.getHeight());
  txHashList.add(tx.getHash());

代码示例来源:origin: nuls-io/nuls

List<Transaction> savedList = new ArrayList<>();
for (Transaction transaction : block.getTxs()) {
  transaction.setBlockHeight(height);
  boolean needRollback = false;
  Result result = transactionService.commitTx(transaction, block.getHeader());

相关文章