Protos$Transaction
Code IndexAdd Codota to your IDE (free)

Best Java code snippets using org.bitcoinj.wallet.Protos$Transaction (Showing top 20 results out of 315)

  • Common ways to obtain Protos$Transaction
private void myMethod () {
Protos$Transaction p =
  • InvalidProtocolBufferException invalidProtocolBufferException;(org.bitcoinj.wallet.Protos.Transaction) invalidProtocolBufferException.getUnfinishedMessage()
  • Protos.Transaction$Builder protosTransaction$Builder;new org.bitcoinj.wallet.Protos.Transaction(protosTransaction$Builder)
  • Protos.Transaction$Builder protosTransaction$Builder;protosTransaction$Builder.build()
  • Smart code suggestions by Codota
}
origin: com.google/bitcoinj

public Builder mergeFrom(org.bitcoinj.wallet.Protos.Transaction other) {
 if (other == org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()) return this;
 if (other.hasVersion()) {
  setVersion(other.getVersion());
 if (other.hasHash()) {
  setHash(other.getHash());
 if (other.hasPool()) {
  setPool(other.getPool());
 if (other.hasLockTime()) {
  setLockTime(other.getLockTime());
 if (other.hasUpdatedAt()) {
  setUpdatedAt(other.getUpdatedAt());
 if (other.hasConfidence()) {
  mergeConfidence(other.getConfidence());
 if (other.hasPurpose()) {
  setPurpose(other.getPurpose());
 this.mergeUnknownFields(other.getUnknownFields());
 return this;
origin: com.google/bitcoinj

public org.bitcoinj.wallet.Protos.Transaction buildPartial() {
 org.bitcoinj.wallet.Protos.Transaction result = new org.bitcoinj.wallet.Protos.Transaction(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
origin: com.google/bitcoinj

 size += 1 * getBlockHashList().size();
 size += 1 * getBlockRelativityOffsetsList().size();
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
origin: com.google/bitcoinj

/**
 * <code>required bytes hash = 2;</code>
 */
public Builder clearHash() {
 bitField0_ = (bitField0_ & ~0x00000002);
 hash_ = getDefaultInstance().getHash();
 onChanged();
 return this;
}
origin: cash.bitcoinj/bitcoinj-core

private WalletTransaction connectTransactionOutputs(final NetworkParameters params,
                          final org.bitcoinj.wallet.Protos.Transaction txProto) throws UnreadableWalletException {
  Transaction tx = txMap.get(txProto.getHash());
  final WalletTransaction.Pool pool;
  switch (txProto.getPool()) {
    case DEAD: pool = WalletTransaction.Pool.DEAD; break;
    case PENDING: pool = WalletTransaction.Pool.PENDING; break;
      break;
    default:
      throw new UnreadableWalletException("Unknown transaction pool: " + txProto.getPool());
    final Protos.TransactionOutput transactionOutput = txProto.getTransactionOutput(i);
    if (transactionOutput.hasSpentByTransactionHash()) {
      final ByteString spentByTransactionHash = transactionOutput.getSpentByTransactionHash();
  if (txProto.hasConfidence()) {
    Protos.TransactionConfidence confidenceProto = txProto.getConfidence();
    TransactionConfidence confidence = tx.getConfidence();
    readConfidence(params, tx, confidenceProto, confidence);
origin: com.google/bitcoinj

private void readTransaction(Protos.Transaction txProto, NetworkParameters params) throws UnreadableWalletException {
  Transaction tx = new Transaction(params);
  if (txProto.hasUpdatedAt()) {
    tx.setUpdateTime(new Date(txProto.getUpdatedAt()));
  for (Protos.TransactionOutput outputProto : txProto.getTransactionOutputList()) {
    BigInteger value = BigInteger.valueOf(outputProto.getValue());
    byte[] scriptBytes = outputProto.getScriptBytes().toByteArray();
  for (Protos.TransactionInput transactionInput : txProto.getTransactionInputList()) {
    byte[] scriptBytes = transactionInput.getScriptBytes().toByteArray();
    TransactionOutPoint outpoint = new TransactionOutPoint(params,
  for (int i = 0; i < txProto.getBlockHashCount(); i++) {
    ByteString blockHash = txProto.getBlockHash(i);
    int relativityOffset = 0;
    if (txProto.getBlockRelativityOffsetsCount() > 0)
      relativityOffset = txProto.getBlockRelativityOffsets(i);
    tx.addBlockAppearance(byteStringToHash(blockHash), relativityOffset);
  if (txProto.hasLockTime()) {
    tx.setLockTime(0xffffffffL & txProto.getLockTime());
  if (txProto.hasPurpose()) {
    switch (txProto.getPurpose()) {
      case UNKNOWN: tx.setPurpose(Transaction.Purpose.UNKNOWN); break;
      case USER_PAYMENT: tx.setPurpose(Transaction.Purpose.USER_PAYMENT); break;
  Sha256Hash protoHash = byteStringToHash(txProto.getHash());
  if (!tx.getHash().equals(protoHash))
origin: greenaddress/GreenBits

private WalletTransaction connectTransactionOutputs(final NetworkParameters params,
                          final org.bitcoinj.wallet.Protos.Transaction txProto) throws UnreadableWalletException {
  Transaction tx = txMap.get(txProto.getHash());
  final WalletTransaction.Pool pool;
  switch (txProto.getPool()) {
    case DEAD: pool = WalletTransaction.Pool.DEAD; break;
    case PENDING: pool = WalletTransaction.Pool.PENDING; break;
      break;
    default:
      throw new UnreadableWalletException("Unknown transaction pool: " + txProto.getPool());
    final Protos.TransactionOutput transactionOutput = txProto.getTransactionOutput(i);
    if (transactionOutput.hasSpentByTransactionHash()) {
      final ByteString spentByTransactionHash = transactionOutput.getSpentByTransactionHash();
  if (txProto.hasConfidence()) {
    Protos.TransactionConfidence confidenceProto = txProto.getConfidence();
    TransactionConfidence confidence = tx.getConfidence();
    readConfidence(params, tx, confidenceProto, confidence);
origin: cash.bitcoinj/bitcoinj-core

tx.setVersion(txProto.getVersion());
if (txProto.hasUpdatedAt()) {
  tx.setUpdateTime(new Date(txProto.getUpdatedAt()));
for (Protos.TransactionOutput outputProto : txProto.getTransactionOutputList()) {
  Coin value = Coin.valueOf(outputProto.getValue());
  byte[] scriptBytes = outputProto.getScriptBytes().toByteArray();
for (Protos.TransactionInput inputProto : txProto.getTransactionInputList()) {
  byte[] scriptBytes = inputProto.getScriptBytes().toByteArray();
  TransactionOutPoint outpoint = new TransactionOutPoint(params,
for (int i = 0; i < txProto.getBlockHashCount(); i++) {
  ByteString blockHash = txProto.getBlockHash(i);
  int relativityOffset = 0;
  if (txProto.getBlockRelativityOffsetsCount() > 0)
    relativityOffset = txProto.getBlockRelativityOffsets(i);
  tx.addBlockAppearance(byteStringToHash(blockHash), relativityOffset);
if (txProto.hasLockTime()) {
  tx.setLockTime(0xffffffffL & txProto.getLockTime());
if (txProto.hasPurpose()) {
  switch (txProto.getPurpose()) {
    case UNKNOWN: tx.setPurpose(Transaction.Purpose.UNKNOWN); break;
    case USER_PAYMENT: tx.setPurpose(Transaction.Purpose.USER_PAYMENT); break;
if (txProto.hasExchangeRate()) {
origin: fr.acinq/bitcoinj-core

private WalletTransaction connectTransactionOutputs(final NetworkParameters params,
                          final org.bitcoinj.wallet.Protos.Transaction txProto) throws UnreadableWalletException {
  Transaction tx = txMap.get(txProto.getHash());
  final WalletTransaction.Pool pool;
  switch (txProto.getPool()) {
    case DEAD: pool = WalletTransaction.Pool.DEAD; break;
    case PENDING: pool = WalletTransaction.Pool.PENDING; break;
      break;
    default:
      throw new UnreadableWalletException("Unknown transaction pool: " + txProto.getPool());
    final Protos.TransactionOutput transactionOutput = txProto.getTransactionOutput(i);
    if (transactionOutput.hasSpentByTransactionHash()) {
      final ByteString spentByTransactionHash = transactionOutput.getSpentByTransactionHash();
  if (txProto.hasConfidence()) {
    Protos.TransactionConfidence confidenceProto = txProto.getConfidence();
    TransactionConfidence confidence = tx.getConfidence();
    readConfidence(params, tx, confidenceProto, confidence);
origin: greenaddress/GreenBits

tx.setVersion(txProto.getVersion());
if (txProto.hasUpdatedAt()) {
  tx.setUpdateTime(new Date(txProto.getUpdatedAt()));
for (Protos.TransactionOutput outputProto : txProto.getTransactionOutputList()) {
  Coin value = Coin.valueOf(outputProto.getValue());
  byte[] scriptBytes = outputProto.getScriptBytes().toByteArray();
for (Protos.TransactionInput inputProto : txProto.getTransactionInputList()) {
  byte[] scriptBytes = inputProto.getScriptBytes().toByteArray();
  TransactionOutPoint outpoint = new TransactionOutPoint(params,
for (int i = 0; i < txProto.getBlockHashCount(); i++) {
  ByteString blockHash = txProto.getBlockHash(i);
  int relativityOffset = 0;
  if (txProto.getBlockRelativityOffsetsCount() > 0)
    relativityOffset = txProto.getBlockRelativityOffsets(i);
  tx.addBlockAppearance(byteStringToHash(blockHash), relativityOffset);
if (txProto.hasLockTime()) {
  tx.setLockTime(0xffffffffL & txProto.getLockTime());
if (txProto.hasPurpose()) {
  switch (txProto.getPurpose()) {
    case UNKNOWN: tx.setPurpose(Transaction.Purpose.UNKNOWN); break;
    case USER_PAYMENT: tx.setPurpose(Transaction.Purpose.USER_PAYMENT); break;
if (txProto.hasExchangeRate()) {
origin: fr.acinq/bitcoinj-core

tx.setVersion(txProto.getVersion());
if (txProto.hasUpdatedAt()) {
  tx.setUpdateTime(new Date(txProto.getUpdatedAt()));
for (Protos.TransactionOutput outputProto : txProto.getTransactionOutputList()) {
  Coin value = Coin.valueOf(outputProto.getValue());
  byte[] scriptBytes = outputProto.getScriptBytes().toByteArray();
for (Protos.TransactionInput inputProto : txProto.getTransactionInputList()) {
  byte[] scriptBytes = inputProto.getScriptBytes().toByteArray();
  TransactionOutPoint outpoint = new TransactionOutPoint(params,
for (int i = 0; i < txProto.getTransactionInputCount(); i++) {
  Protos.ScriptWitness witnessProto = txProto.getTransactionInput(i).getWitness();
  if (witnessProto.getDataCount() > 0) {
    TransactionWitness witness = new TransactionWitness(witnessProto.getDataCount());
for (int i = 0; i < txProto.getBlockHashCount(); i++) {
  ByteString blockHash = txProto.getBlockHash(i);
  int relativityOffset = 0;
  if (txProto.getBlockRelativityOffsetsCount() > 0)
    relativityOffset = txProto.getBlockRelativityOffsets(i);
  tx.addBlockAppearance(byteStringToHash(blockHash), relativityOffset);
if (txProto.hasLockTime()) {
  tx.setLockTime(0xffffffffL & txProto.getLockTime());
if (txProto.hasPurpose()) {
origin: cash.bitcoinj/bitcoinj-core

 size += 1 * getBlockHashList().size();
 size += 1 * getBlockRelativityOffsetsList().size();
  .computeBytesSize(13, getMemoBytes());
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
origin: greenaddress/GreenBits

 size += 1 * getBlockHashList().size();
 size += 1 * getBlockRelativityOffsetsList().size();
  .computeBytesSize(13, getMemoBytes());
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
origin: com.google/bitcoinj

private WalletTransaction connectTransactionOutputs(org.bitcoinj.wallet.Protos.Transaction txProto) throws UnreadableWalletException {
  Transaction tx = txMap.get(txProto.getHash());
  final WalletTransaction.Pool pool;
  switch (txProto.getPool()) {
    case DEAD: pool = WalletTransaction.Pool.DEAD; break;
    case PENDING: pool = WalletTransaction.Pool.PENDING; break;
      break;
    default:
      throw new UnreadableWalletException("Unknown transaction pool: " + txProto.getPool());
    final Protos.TransactionOutput transactionOutput = txProto.getTransactionOutput(i);
    if (transactionOutput.hasSpentByTransactionHash()) {
      final ByteString spentByTransactionHash = transactionOutput.getSpentByTransactionHash();
  if (txProto.hasConfidence()) {
    Protos.TransactionConfidence confidenceProto = txProto.getConfidence();
    TransactionConfidence confidence = tx.getConfidence();
    readConfidence(tx, confidenceProto, confidence);
origin: fr.acinq/bitcoinj-core

 size += 1 * getBlockHashList().size();
 size += 1 * getBlockRelativityOffsetsList().size();
  .computeBytesSize(13, getMemoBytes());
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
origin: fr.acinq/bitcoinj-core

if (!hasVersion()) {
 memoizedIsInitialized = 0;
 return false;
if (!hasHash()) {
 memoizedIsInitialized = 0;
 return false;
for (int i = 0; i < getTransactionInputCount(); i++) {
 if (!getTransactionInput(i).isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
for (int i = 0; i < getTransactionOutputCount(); i++) {
 if (!getTransactionOutput(i).isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
if (hasConfidence()) {
 if (!getConfidence().isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
if (hasExchangeRate()) {
 if (!getExchangeRate().isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
origin: HashEngineering/dashj

private WalletTransaction connectTransactionOutputs(final NetworkParameters params,
                          final org.bitcoinj.wallet.Protos.Transaction txProto) throws UnreadableWalletException {
  Transaction tx = txMap.get(txProto.getHash());
  final WalletTransaction.Pool pool;
  switch (txProto.getPool()) {
    case DEAD: pool = WalletTransaction.Pool.DEAD; break;
    case PENDING: pool = WalletTransaction.Pool.PENDING; break;
      break;
    default:
      throw new UnreadableWalletException("Unknown transaction pool: " + txProto.getPool());
    final Protos.TransactionOutput transactionOutput = txProto.getTransactionOutput(i);
    if (transactionOutput.hasSpentByTransactionHash()) {
      final ByteString spentByTransactionHash = transactionOutput.getSpentByTransactionHash();
  if (txProto.hasConfidence()) {
    Protos.TransactionConfidence confidenceProto = txProto.getConfidence();
    TransactionConfidence confidence = tx.getConfidence();
    readConfidence(params, tx, confidenceProto, confidence);
origin: cash.bitcoinj/bitcoinj-core

public org.bitcoinj.wallet.Protos.Transaction buildPartial() {
 org.bitcoinj.wallet.Protos.Transaction result = new org.bitcoinj.wallet.Protos.Transaction(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
origin: HashEngineering/dashj

if (!hasVersion()) {
 memoizedIsInitialized = 0;
 return false;
if (!hasHash()) {
 memoizedIsInitialized = 0;
 return false;
for (int i = 0; i < getTransactionInputCount(); i++) {
 if (!getTransactionInput(i).isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
for (int i = 0; i < getTransactionOutputCount(); i++) {
 if (!getTransactionOutput(i).isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
if (hasConfidence()) {
 if (!getConfidence().isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
if (hasExchangeRate()) {
 if (!getExchangeRate().isInitialized()) {
  memoizedIsInitialized = 0;
  return false;
origin: fr.acinq/bitcoinj-core

public org.bitcoinj.wallet.Protos.Transaction buildPartial() {
 org.bitcoinj.wallet.Protos.Transaction result = new org.bitcoinj.wallet.Protos.Transaction(this);
 int from_bitField0_ = bitField0_;
 int to_bitField0_ = 0;
org.bitcoinj.walletProtos$Transaction

Javadoc

Protobuf type wallet.Transaction

Most used methods

  • getBlockHashCount
    repeated bytes block_hash = 8; A list of blocks in which the transaction has been observed (on any
  • getHash
    required bytes hash = 2;
  • getPool
    optional .wallet.Transaction.Pool pool = 3; If pool is not present, that means either: - This Tran
  • getTransactionInput
    repeated .wallet.TransactionInput transaction_input = 6;
  • getTransactionOutput
    repeated .wallet.TransactionOutput transaction_output = 7;
  • hasLockTime
    optional uint32 lock_time = 4; The nLockTime field is useful for contracts.
  • <init>
  • getBlockHash
    repeated bytes block_hash = 8; A list of blocks in which the transaction has been observed (on any
  • getBlockHashList
    repeated bytes block_hash = 8; A list of blocks in which the transaction has been observed (on any
  • getBlockRelativityOffsets
    repeated int32 block_relativity_offsets = 11;
  • getBlockRelativityOffsetsCount
    repeated int32 block_relativity_offsets = 11;
  • getBlockRelativityOffsetsList
    repeated int32 block_relativity_offsets = 11;
  • getBlockRelativityOffsetsCount,
  • getBlockRelativityOffsetsList,
  • getConfidence,
  • getDefaultInstance,
  • getDescriptor,
  • getLockTime,
  • getPurpose,
  • getSerializedSize,
  • getTransactionInputCount,
  • getTransactionInputList

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • getApplicationContext (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid

For IntelliJ IDEA,
Android Studio or Eclipse

  • Search for JavaScript code betaCodota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutBlogContact Us
  • Plugin user guideTerms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)