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()); if (other.hasExchangeRate()) { mergeExchangeRate(other.getExchangeRate()); if (other.hasMemo()) { bitField0_ |= 0x00001000; memo_ = other.memo_; onChanged();
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(); .computeBytesSize(13, getMemoBytes()); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
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()); if (other.hasExchangeRate()) { mergeExchangeRate(other.getExchangeRate()); if (other.hasMemo()) { bitField0_ |= 0x00001000; memo_ = other.memo_; onChanged();
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()); if (other.hasExchangeRate()) { mergeExchangeRate(other.getExchangeRate()); if (other.hasMemo()) { bitField0_ |= 0x00001000; memo_ = other.memo_; onChanged();
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()); if (other.hasExchangeRate()) { mergeExchangeRate(other.getExchangeRate()); if (other.hasMemo()) { bitField0_ |= 0x00001000; memo_ = other.memo_; onChanged();
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;
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;
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;
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(); .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;
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(); size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size;
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()) {
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 void readTransaction(Protos.Transaction txProto, NetworkParameters params) throws UnreadableWalletException { boolean isIX = txProto.getConfidence().hasIxType() && txProto.getConfidence().getIxType() != Protos.TransactionConfidence.IXType.IX_NONE; Transaction tx = !isIX ? new Transaction(params) : new TransactionLockRequest(params); 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;
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);