/** * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code> */ public Builder addTransactionOutput( org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { ensureTransactionOutputIsMutable(); transactionOutput_.add(builderForValue.build()); onChanged(); } else { transactionOutputBuilder_.addMessage(builderForValue.build()); } return this; } /**
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.bitcoinj.wallet.Protos.TransactionOutput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionOutput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
.setScriptBytes(ByteString.copyFrom(output.getScriptBytes())) .setValue(output.getValue().value); final TransactionInput spentBy = output.getSpentBy(); if (spentBy != null) { Sha256Hash spendingHash = spentBy.getParentTransaction().getHash(); int spentByTransactionIndex = spentBy.getParentTransaction().getInputs().indexOf(spentBy); outputBuilder.setSpentByTransactionHash(hashToByteString(spendingHash)) .setSpentByTransactionIndex(spentByTransactionIndex);
.setScriptBytes(ByteString.copyFrom(output.getScriptBytes())) .setValue(output.getValue().value); final TransactionInput spentBy = output.getSpentBy(); if (spentBy != null) { Sha256Hash spendingHash = spentBy.getParentTransaction().getHash(); int spentByTransactionIndex = spentBy.getParentTransaction().getInputs().indexOf(spentBy); outputBuilder.setSpentByTransactionHash(hashToByteString(spendingHash)) .setSpentByTransactionIndex(spentByTransactionIndex);
.setScriptBytes(ByteString.copyFrom(output.getScriptBytes())) .setValue(output.getValue().value); final TransactionInput spentBy = output.getSpentBy(); if (spentBy != null) { Sha256Hash spendingHash = spentBy.getParentTransaction().getHash(); int spentByTransactionIndex = spentBy.getParentTransaction().getInputs().indexOf(spentBy); outputBuilder.setSpentByTransactionHash(hashToByteString(spendingHash)) .setSpentByTransactionIndex(spentByTransactionIndex);
.setScriptBytes(ByteString.copyFrom(output.getScriptBytes())) .setValue(output.getValue().value); final TransactionInput spentBy = output.getSpentBy(); if (spentBy != null) { Sha256Hash spendingHash = spentBy.getParentTransaction().getHash(); int spentByTransactionIndex = spentBy.getParentTransaction().getInputs().indexOf(spentBy); outputBuilder.setSpentByTransactionHash(hashToByteString(spendingHash)) .setSpentByTransactionIndex(spentByTransactionIndex);
.setScriptBytes(ByteString.copyFrom(output.getScriptBytes())) .setValue(output.getValue().longValue()); final TransactionInput spentBy = output.getSpentBy(); if (spentBy != null) { Sha256Hash spendingHash = spentBy.getParentTransaction().getHash(); int spentByTransactionIndex = spentBy.getParentTransaction().getInputs().indexOf(spentBy); outputBuilder.setSpentByTransactionHash(hashToByteString(spendingHash)) .setSpentByTransactionIndex(spentByTransactionIndex);
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; } }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.bitcoinj.wallet.Protos.TransactionOutput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionOutput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.bitcoinj.wallet.Protos.TransactionOutput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionOutput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.bitcoinj.wallet.Protos.TransactionOutput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionOutput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) { if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this; if (other.hasValue()) { setValue(other.getValue()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSpentByTransactionHash()) { setSpentByTransactionHash(other.getSpentByTransactionHash()); } if (other.hasSpentByTransactionIndex()) { setSpentByTransactionIndex(other.getSpentByTransactionIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { org.bitcoinj.wallet.Protos.TransactionOutput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionOutput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) { if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this; if (other.hasValue()) { setValue(other.getValue()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSpentByTransactionHash()) { setSpentByTransactionHash(other.getSpentByTransactionHash()); } if (other.hasSpentByTransactionIndex()) { setSpentByTransactionIndex(other.getSpentByTransactionIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) { if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this; if (other.hasValue()) { setValue(other.getValue()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSpentByTransactionHash()) { setSpentByTransactionHash(other.getSpentByTransactionHash()); } if (other.hasSpentByTransactionIndex()) { setSpentByTransactionIndex(other.getSpentByTransactionIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code> */ public Builder addTransactionOutput( int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { ensureTransactionOutputIsMutable(); transactionOutput_.add(index, builderForValue.build()); onChanged(); } else { transactionOutputBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code> */ public Builder addTransactionOutput( org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { ensureTransactionOutputIsMutable(); transactionOutput_.add(builderForValue.build()); onChanged(); } else { transactionOutputBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .wallet.TransactionOutput transaction_output = 7;</code> */ public Builder setTransactionOutput( int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { ensureTransactionOutputIsMutable(); transactionOutput_.set(index, builderForValue.build()); onChanged(); } else { transactionOutputBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) { if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this; if (other.hasValue()) { setValue(other.getValue()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSpentByTransactionHash()) { setSpentByTransactionHash(other.getSpentByTransactionHash()); } if (other.hasSpentByTransactionIndex()) { setSpentByTransactionIndex(other.getSpentByTransactionIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionOutput other) { if (other == org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()) return this; if (other.hasValue()) { setValue(other.getValue()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSpentByTransactionHash()) { setSpentByTransactionHash(other.getSpentByTransactionHash()); } if (other.hasSpentByTransactionIndex()) { setSpentByTransactionIndex(other.getSpentByTransactionIndex()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }