Package com.bitsofproof.supernode.common

Examples of com.bitsofproof.supernode.common.Hash


    BCSAPIMessage.TransactionOutput.Builder builder = BCSAPIMessage.TransactionOutput.newBuilder ();
    builder.setScript (ByteString.copyFrom (script));
    builder.setValue (value);
    if ( color != null )
    {
      builder.setColor (ByteString.copyFrom (new Hash (color).toByteArray ()));
    }
    return builder.build ();
  }
View Full Code Here


    TransactionOutput output = new TransactionOutput ();
    output.setScript (po.getScript ().toByteArray ());
    output.setValue (po.getValue ());
    if ( po.hasColor () )
    {
      output.color = new Hash (po.getColor ().toByteArray ()).toString ();
    }
    return output;
  }
View Full Code Here

  public void toWire (WireFormat.Writer writer)
  {
    if ( sourceHash != null && !sourceHash.equals (Hash.ZERO_HASH.toString ()) )
    {
      writer.writeHash (new Hash (sourceHash));
      writer.writeUint32 (ix);
    }
    else
    {
      writer.writeBytes (Hash.ZERO_HASH.toByteArray ());
View Full Code Here

  public BCSAPIMessage.TransactionInput toProtobuf ()
  {
    BCSAPIMessage.TransactionInput.Builder builder = BCSAPIMessage.TransactionInput.newBuilder ();
    builder.setScript (ByteString.copyFrom (script));
    builder.setSequence ((int) sequence);
    builder.setSource (ByteString.copyFrom (new Hash (sourceHash).toByteArray ()));
    builder.setSourceix ((int) ix);
    return builder.build ();
  }
View Full Code Here

  {
    TransactionInput input = new TransactionInput ();
    input.setIx (pi.getSourceix ());
    input.setScript (pi.getScript ().toByteArray ());
    input.setSequence (pi.getSequence ());
    input.setSourceHash (new Hash (pi.getSource ().toByteArray ()).toString ());
    return input;
  }
View Full Code Here

        builder.addOutputs (o.toProtobuf ());
      }
    }
    if ( blockHash != null )
    {
      builder.setBlock (ByteString.copyFrom (new Hash (blockHash).toByteArray ()));
    }
    if ( doubleSpend )
    {
      builder.setDoubleSpend (true);
    }
View Full Code Here

        transaction.getOutputs ().add (TransactionOutput.fromProtobuf (o));
      }
    }
    if ( pt.hasBlock () )
    {
      transaction.blockHash = new Hash (pt.getBlock ().toByteArray ()).toString ();
    }
    if ( pt.hasDoubleSpend () && pt.getDoubleSpend () )
    {
      transaction.doubleSpend = true;
    }
View Full Code Here

      MessageProducer transactionRequestProducer = session.createProducer (session.createQueue ("catchUpRequest"));

      m = session.createBytesMessage ();
      BCSAPIMessage.Hash.Builder builder = BCSAPIMessage.Hash.newBuilder ();
      builder.setBcsapiversion (1);
      builder.addHash (ByteString.copyFrom (new Hash (hash).toByteArray ()));
      m.writeBytes (builder.build ().toByteArray ());
      byte[] response = synchronousRequest (session, transactionRequestProducer, m);
      if ( response != null )
      {
        TrunkUpdateMessage tu = TrunkUpdateMessage.fromProtobuf (BCSAPIMessage.TrunkUpdate.parseFrom (response));
View Full Code Here

      MessageProducer transactionRequestProducer = session.createProducer (session.createQueue ("transactionRequest"));

      m = session.createBytesMessage ();
      BCSAPIMessage.Hash.Builder builder = BCSAPIMessage.Hash.newBuilder ();
      builder.setBcsapiversion (1);
      builder.addHash (ByteString.copyFrom (new Hash (hash).toByteArray ()));
      m.writeBytes (builder.build ().toByteArray ());
      byte[] response = synchronousRequest (session, transactionRequestProducer, m);
      if ( response != null )
      {
        Transaction t;
View Full Code Here

      MessageProducer blockRequestProducer = session.createProducer (session.createQueue ("blockRequest"));

      BytesMessage m = session.createBytesMessage ();
      BCSAPIMessage.Hash.Builder builder = BCSAPIMessage.Hash.newBuilder ();
      builder.setBcsapiversion (1);
      builder.addHash (ByteString.copyFrom (new Hash (hash).toByteArray ()));
      m.writeBytes (builder.build ().toByteArray ());
      byte[] response = synchronousRequest (session, blockRequestProducer, m);
      if ( response != null )
      {
        Block b = Block.fromProtobuf (BCSAPIMessage.Block.parseFrom (response));
View Full Code Here

TOP

Related Classes of com.bitsofproof.supernode.common.Hash

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.