org.bitcoinj.core.Block.calculateMerkleRoot()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(137)

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

Block.calculateMerkleRoot介绍

暂无

代码示例

代码示例来源:origin: fr.acinq/bitcoinj-core

private Sha256Hash calculateMerkleRoot() {
  return calculateMerkleRoot(false);
}

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

/**
 * Returns the merkle root in big endian form, calculating it from transactions if necessary.
 */
public Sha256Hash getMerkleRoot() {
  if (merkleRoot == null) {
    //TODO check if this is really necessary.
    unCacheHeader();
    merkleRoot = calculateMerkleRoot();
  }
  return merkleRoot;
}

代码示例来源:origin: HashEngineering/dashj

/**
 * Returns the merkle root in big endian form, calculating it from transactions if necessary.
 */
public Sha256Hash getMerkleRoot() {
  if (merkleRoot == null) {
    //TODO check if this is really necessary.
    unCacheHeader();
    merkleRoot = calculateMerkleRoot();
  }
  return merkleRoot;
}

代码示例来源:origin: fr.acinq/bitcoinj-core

/**
 * Returns the merkle root in big endian form, calculating it from transactions if necessary.
 */
public Sha256Hash getMerkleRoot() {
  if (merkleRoot == null) {
    //TODO check if this is really necessary.
    unCacheHeader();
    merkleRoot = calculateMerkleRoot();
  }
  return merkleRoot;
}

代码示例来源:origin: greenaddress/GreenBits

/**
 * Returns the merkle root in big endian form, calculating it from transactions if necessary.
 */
public Sha256Hash getMerkleRoot() {
  if (merkleRoot == null) {
    //TODO check if this is really necessary.
    unCacheHeader();
    merkleRoot = calculateMerkleRoot();
  }
  return merkleRoot;
}

代码示例来源:origin: cash.bitcoinj/bitcoinj-core

private void checkMerkleRoot() throws VerificationException {
  Sha256Hash calculatedRoot = calculateMerkleRoot();
  if (!calculatedRoot.equals(merkleRoot)) {
    log.error("Merkle tree did not verify");
    throw new VerificationException("Merkle hashes do not match: " + calculatedRoot + " vs " + merkleRoot);
  }
}

代码示例来源:origin: greenaddress/GreenBits

private void checkMerkleRoot() throws VerificationException {
  Sha256Hash calculatedRoot = calculateMerkleRoot();
  if (!calculatedRoot.equals(merkleRoot)) {
    log.error("Merkle tree did not verify");
    throw new VerificationException("Merkle hashes do not match: " + calculatedRoot + " vs " + merkleRoot);
  }
}

代码示例来源:origin: fr.acinq/bitcoinj-core

private void checkMerkleRoot() throws VerificationException {
  Sha256Hash calculatedRoot = calculateMerkleRoot();
  if (!calculatedRoot.equals(merkleRoot)) {
    log.error("Merkle tree did not verify");
    throw new VerificationException("Merkle hashes do not match: " + calculatedRoot + " vs " + merkleRoot);
  }
}

代码示例来源:origin: HashEngineering/dashj

private void checkMerkleRoot() throws VerificationException {
  Sha256Hash calculatedRoot = calculateMerkleRoot();
  if (!calculatedRoot.equals(merkleRoot)) {
    log.error("Merkle tree did not verify");
    throw new VerificationException("Merkle hashes do not match: " + calculatedRoot + " vs " + merkleRoot);
  }
}

代码示例来源:origin: fr.acinq/bitcoinj-core

final byte[] witnessMerkle = calculateMerkleRoot(true).getReversedBytes();
final byte[] witnessNonce = coinBase.getWitness(0).getPush(0);
final byte[] witnessRoot = Sha256Hash.hashTwice(

相关文章