Package org.ethereum.db

Examples of org.ethereum.db.ByteArrayWrapper


    public void setTotalDifficulty(BigInteger totalDifficulty) {
        this.totalDifficulty = totalDifficulty;
    }

    public boolean isParentOnTheChain(Block block){
        return (index.get(new ByteArrayWrapper( block.getParentHash() )) != null);
    }
View Full Code Here


    public static byte[] sha256(byte[] input) {
      return sha256digest.digest(input);
    }

  public static byte[] sha3(byte[] input) {
        ByteArrayWrapper inputByteArray = new ByteArrayWrapper(input);
        byte[] result = sha3Cache.get(inputByteArray);
        if(result != null)
            return result;
        result = SHA3Helper.sha3(input);
        sha3Cache.put(inputByteArray, result);
View Full Code Here

  }

  @Override
  public void update(byte[] key, byte[] value) {
    if (trackingChanges)
      changes.put(new ByteArrayWrapper(key), value);
    else
      trie.update(key, value);
  }
View Full Code Here

  }

  @Override
  public byte[] get(byte[] key) {
    if (trackingChanges) {
      ByteArrayWrapper wKey = new ByteArrayWrapper(key);
      if (deletes.contains(wKey))
        return null;
      if (changes.get(wKey) != null)
        return changes.get(wKey);
      return trie.get(key);
View Full Code Here

  }

  @Override
  public void delete(byte[] key) {
    if (trackingChanges) {
      ByteArrayWrapper wKey = new ByteArrayWrapper(key);
      deletes.add(wKey);
    } else
      trie.delete(key);
  }
View Full Code Here

        walletTransactions.remove(hash);
    }

    public void applyTransaction(Transaction transaction) {

        transactionMap.put(new ByteArrayWrapper(transaction.getHash()), transaction);

        byte[] senderAddress = transaction.getSender();
        Account sender =  rows.get(Hex.toHexString(senderAddress));
        if (sender != null) {
            sender.addPendingTransaction(transaction);
View Full Code Here

TOP

Related Classes of org.ethereum.db.ByteArrayWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.