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()); setHash(other.getHash()); setPool(other.getPool()); setLockTime(other.getLockTime()); setUpdatedAt(other.getUpdatedAt()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionInputIsMutable(); transactionInput_.addAll(other.transactionInput_); onChanged(); transactionInputBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getTransactionInputFieldBuilder() : null; } else { transactionInputBuilder_.addAllMessages(other.transactionInput_); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureTransactionOutputIsMutable(); transactionOutput_.addAll(other.transactionOutput_);
/** * <code>repeated .wallet.Transaction transaction = 4;</code> */ public Builder addTransaction( int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { if (transactionBuilder_ == null) { ensureTransactionIsMutable(); transaction_.add(index, builderForValue.build()); onChanged(); } else { transactionBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
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()); setHash(other.getHash()); setPool(other.getPool()); setLockTime(other.getLockTime()); setUpdatedAt(other.getUpdatedAt()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionInputIsMutable(); transactionInput_.addAll(other.transactionInput_); onChanged(); transactionInputBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getTransactionInputFieldBuilder() : null; } else { transactionInputBuilder_.addAllMessages(other.transactionInput_); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureTransactionOutputIsMutable(); transactionOutput_.addAll(other.transactionOutput_);
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()); setHash(other.getHash()); setPool(other.getPool()); setLockTime(other.getLockTime()); setUpdatedAt(other.getUpdatedAt()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionInputIsMutable(); transactionInput_.addAll(other.transactionInput_); onChanged(); transactionInputBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getTransactionInputFieldBuilder() : null; } else { transactionInputBuilder_.addAllMessages(other.transactionInput_); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureTransactionOutputIsMutable(); transactionOutput_.addAll(other.transactionOutput_);
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()); setHash(other.getHash()); setPool(other.getPool()); setLockTime(other.getLockTime()); setUpdatedAt(other.getUpdatedAt()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionInputIsMutable(); transactionInput_.addAll(other.transactionInput_); onChanged(); transactionInputBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getTransactionInputFieldBuilder() : null; } else { transactionInputBuilder_.addAllMessages(other.transactionInput_); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureTransactionOutputIsMutable(); transactionOutput_.addAll(other.transactionOutput_);
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()); setHash(other.getHash()); setPool(other.getPool()); setLockTime(other.getLockTime()); setUpdatedAt(other.getUpdatedAt()); bitField0_ = (bitField0_ & ~0x00000020); } else { ensureTransactionInputIsMutable(); transactionInput_.addAll(other.transactionInput_); onChanged(); transactionInputBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getTransactionInputFieldBuilder() : null; } else { transactionInputBuilder_.addAllMessages(other.transactionInput_); bitField0_ = (bitField0_ & ~0x00000040); } else { ensureTransactionOutputIsMutable(); transactionOutput_.addAll(other.transactionOutput_);
Protos.Transaction.Builder txBuilder = Protos.Transaction.newBuilder(); txBuilder.setPool(getProtoPool(wtx)) .setHash(hashToByteString(tx.getHash())) .setVersion((int) tx.getVersion()); txBuilder.setUpdatedAt(tx.getUpdateTime().getTime()); txBuilder.setLockTime((int)tx.getLockTime()); txBuilder.addTransactionInput(inputBuilder); txBuilder.addTransactionOutput(outputBuilder); if (appearsInHashes != null) { for (Map.Entry<Sha256Hash, Integer> entry : appearsInHashes.entrySet()) { txBuilder.addBlockHash(hashToByteString(entry.getKey())); txBuilder.addBlockRelativityOffsets(entry.getValue()); txBuilder.setPurpose(purpose); .setCoinValue(exchangeRate.coin.value).setFiatValue(exchangeRate.fiat.value) .setFiatCurrencyCode(exchangeRate.fiat.currencyCode); txBuilder.setExchangeRate(exchangeRateBuilder); txBuilder.setMemo(tx.getMemo()); return txBuilder.build();
txBuilder.setPool(getProtoPool(wtx)) .setHash(hashToByteString(tx.getHash())) .setVersion((int) tx.getVersion()); txBuilder.setUpdatedAt(tx.getUpdateTime().getTime()); txBuilder.setLockTime((int)tx.getLockTime()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); txBuilder.addTransactionInput(inputBuilder); txBuilder.addTransactionOutput(outputBuilder); if (appearsInHashes != null) { for (Map.Entry<Sha256Hash, Integer> entry : appearsInHashes.entrySet()) { txBuilder.addBlockHash(hashToByteString(entry.getKey())); txBuilder.addBlockRelativityOffsets(entry.getValue()); txBuilder.setPurpose(purpose); .setCoinValue(exchangeRate.coin.value).setFiatValue(exchangeRate.fiat.value) .setFiatCurrencyCode(exchangeRate.fiat.currencyCode); txBuilder.setExchangeRate(exchangeRateBuilder); txBuilder.setMemo(tx.getMemo()); return txBuilder.build();
txBuilder.setPool(getProtoPool(wtx)) .setHash(hashToByteString(tx.getHash())) .setVersion((int) tx.getVersion()); txBuilder.setUpdatedAt(tx.getUpdateTime().getTime()); txBuilder.setLockTime((int)tx.getLockTime()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); txBuilder.addTransactionInput(inputBuilder); txBuilder.addTransactionOutput(outputBuilder); if (appearsInHashes != null) { for (Map.Entry<Sha256Hash, Integer> entry : appearsInHashes.entrySet()) { txBuilder.addBlockHash(hashToByteString(entry.getKey())); txBuilder.addBlockRelativityOffsets(entry.getValue()); txBuilder.setPurpose(purpose); .setCoinValue(exchangeRate.coin.value).setFiatValue(exchangeRate.fiat.value) .setFiatCurrencyCode(exchangeRate.fiat.currencyCode); txBuilder.setExchangeRate(exchangeRateBuilder); txBuilder.setMemo(tx.getMemo()); return txBuilder.build();
txBuilder.setPool(getProtoPool(wtx)) .setHash(hashToByteString(tx.getHash())) .setVersion((int) tx.getVersion()); txBuilder.setUpdatedAt(tx.getUpdateTime().getTime()); txBuilder.setLockTime((int)tx.getLockTime()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); txBuilder.addTransactionInput(inputBuilder); txBuilder.addTransactionOutput(outputBuilder); if (appearsInHashes != null) { for (Map.Entry<Sha256Hash, Integer> entry : appearsInHashes.entrySet()) { txBuilder.addBlockHash(hashToByteString(entry.getKey())); txBuilder.addBlockRelativityOffsets(entry.getValue()); txBuilder.setPurpose(purpose); .setCoinValue(exchangeRate.coin.value).setFiatValue(exchangeRate.fiat.value) .setFiatCurrencyCode(exchangeRate.fiat.currencyCode); txBuilder.setExchangeRate(exchangeRateBuilder); txBuilder.setMemo(tx.getMemo()); return txBuilder.build();
Protos.Transaction.Builder txBuilder = Protos.Transaction.newBuilder(); txBuilder.setPool(getProtoPool(wtx)) .setHash(hashToByteString(tx.getHash())) .setVersion((int) tx.getVersion()); txBuilder.setUpdatedAt(tx.getUpdateTime().getTime()); txBuilder.setLockTime((int)tx.getLockTime()); inputBuilder.setSequence((int)input.getSequenceNumber()); txBuilder.addTransactionInput(inputBuilder); .setSpentByTransactionIndex(spentByTransactionIndex); txBuilder.addTransactionOutput(outputBuilder); if (appearsInHashes != null) { for (Map.Entry<Sha256Hash, Integer> entry : appearsInHashes.entrySet()) { txBuilder.addBlockHash(hashToByteString(entry.getKey())); txBuilder.addBlockRelativityOffsets(entry.getValue()); throw new RuntimeException("New tx purpose serialization not implemented."); txBuilder.setPurpose(purpose); return txBuilder.build();
private static Protos.Wallet attemptHexConversion(Protos.Wallet proto) { // Try to convert any raw hashes and such to textual equivalents for easier debugging. This makes it a bit // less "raw" but we will just abort on any errors. try { Protos.Wallet.Builder builder = proto.toBuilder(); for (Protos.Transaction.Builder tx : builder.getTransactionBuilderList()) { tx.setHash(bytesToHex(tx.getHash())); for (int i = 0; i < tx.getBlockHashCount(); i++) tx.setBlockHash(i, bytesToHex(tx.getBlockHash(i))); for (Protos.TransactionInput.Builder input : tx.getTransactionInputBuilderList()) input.setTransactionOutPointHash(bytesToHex(input.getTransactionOutPointHash())); for (Protos.TransactionOutput.Builder output : tx.getTransactionOutputBuilderList()) { if (output.hasSpentByTransactionHash()) output.setSpentByTransactionHash(bytesToHex(output.getSpentByTransactionHash())); } // TODO: keys, ip addresses etc. } return builder.build(); } catch (Throwable throwable) { log.error("Failed to do hex conversion on wallet proto", throwable); return proto; } }
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder setBlockHash( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.set(index, value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder setBlockHash( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.set(index, value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder addBlockHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.add(value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder setBlockHash( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.set(index, value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder setBlockHash( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.set(index, value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder addBlockHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.add(value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder addBlockHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.add(value); onChanged(); return this; } /**
/** * <code>repeated bytes block_hash = 8;</code> * * <pre> * A list of blocks in which the transaction has been observed (on any chain). Also, a number used to disambiguate * ordering within a block. * </pre> */ public Builder setBlockHash( int index, com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } ensureBlockHashIsMutable(); blockHash_.set(index, value); onChanged(); return this; } /**