For IntelliJ IDEA,
Android Studio or Eclipse



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
}
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;
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;
size += 1 * getBlockHashList().size(); size += 1 * getBlockRelativityOffsetsList().size(); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
/** * <code>required bytes hash = 2;</code> */ public Builder clearHash() { bitField0_ = (bitField0_ & ~0x00000002); hash_ = getDefaultInstance().getHash(); onChanged(); return this; }
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);
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))
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);
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()) {
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);
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()) {
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()) {
size += 1 * getBlockHashList().size(); size += 1 * getBlockRelativityOffsetsList().size(); .computeBytesSize(13, getMemoBytes()); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
size += 1 * getBlockHashList().size(); size += 1 * getBlockRelativityOffsetsList().size(); .computeBytesSize(13, getMemoBytes()); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
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);
size += 1 * getBlockHashList().size(); size += 1 * getBlockRelativityOffsetsList().size(); .computeBytesSize(13, getMemoBytes()); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
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;
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);
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;
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;
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;