/** * <code>repeated .wallet.TransactionInput transaction_input = 6;</code> */ public Builder addTransactionInput( org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { ensureTransactionInputIsMutable(); transactionInput_.add(builderForValue.build()); onChanged(); } else { transactionInputBuilder_.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.TransactionInput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionInput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes())) .setTransactionOutPointHash(hashToByteString(input.getOutpoint().getHash())) .setTransactionOutPointIndex((int) input.getOutpoint().getIndex()); if (input.hasSequence()) inputBuilder.setSequence((int) input.getSequenceNumber()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); txBuilder.addTransactionInput(inputBuilder);
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes())) .setTransactionOutPointHash(hashToByteString(input.getOutpoint().getHash())) .setTransactionOutPointIndex((int) input.getOutpoint().getIndex()); if (input.hasSequence()) inputBuilder.setSequence((int) input.getSequenceNumber()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); txBuilder.addTransactionInput(inputBuilder);
TransactionInput input = tx.getInput(i); Protos.TransactionInput.Builder inputBuilder = Protos.TransactionInput.newBuilder() .setScriptBytes(ByteString.copyFrom(input.getScriptBytes())) .setTransactionOutPointHash(hashToByteString(input.getOutpoint().getHash())) .setTransactionOutPointIndex((int) input.getOutpoint().getIndex()); if (input.hasSequence()) inputBuilder.setSequence((int) input.getSequenceNumber()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); if (tx.hasWitness() && tx.getWitness(i).getPushCount() > 0) { TransactionWitness witness = tx.getWitness(i); witnessBuilder.addData(ByteString.copyFrom(witness.getPush(j))); inputBuilder.setWitness(witnessBuilder);
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes())) .setTransactionOutPointHash(hashToByteString(input.getOutpoint().getHash())) .setTransactionOutPointIndex((int) input.getOutpoint().getIndex()); if (input.hasSequence()) inputBuilder.setSequence((int) input.getSequenceNumber()); if (input.getValue() != null) inputBuilder.setValue(input.getValue().value); txBuilder.addTransactionInput(inputBuilder);
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes())) .setTransactionOutPointHash(hashToByteString(input.getOutpoint().getHash())) .setTransactionOutPointIndex((int) input.getOutpoint().getIndex()); if (input.hasSequence()) { inputBuilder.setSequence((int)input.getSequenceNumber());
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(org.bitcoinj.wallet.Protos.TransactionInput other) { if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this; if (other.hasTransactionOutPointHash()) { setTransactionOutPointHash(other.getTransactionOutPointHash()); } if (other.hasTransactionOutPointIndex()) { setTransactionOutPointIndex(other.getTransactionOutPointIndex()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSequence()) { setSequence(other.getSequence()); } if (other.hasValue()) { setValue(other.getValue()); } if (other.hasWitness()) { mergeWitness(other.getWitness()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionInput other) { if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this; if (other.hasTransactionOutPointHash()) { setTransactionOutPointHash(other.getTransactionOutPointHash()); } if (other.hasTransactionOutPointIndex()) { setTransactionOutPointIndex(other.getTransactionOutPointIndex()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSequence()) { setSequence(other.getSequence()); } if (other.hasValue()) { setValue(other.getValue()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionInput other) { if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this; if (other.hasTransactionOutPointHash()) { setTransactionOutPointHash(other.getTransactionOutPointHash()); } if (other.hasTransactionOutPointIndex()) { setTransactionOutPointIndex(other.getTransactionOutPointIndex()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSequence()) { setSequence(other.getSequence()); } if (other.hasValue()) { setValue(other.getValue()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionInput other) { if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this; if (other.hasTransactionOutPointHash()) { setTransactionOutPointHash(other.getTransactionOutPointHash()); } if (other.hasTransactionOutPointIndex()) { setTransactionOutPointIndex(other.getTransactionOutPointIndex()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSequence()) { setSequence(other.getSequence()); } if (other.hasValue()) { setValue(other.getValue()); } 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.TransactionInput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionInput) 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.TransactionInput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionInput) 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.TransactionInput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionInput) 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.TransactionInput parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.bitcoinj.wallet.Protos.TransactionInput) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_;
public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionInput other) { if (other == org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()) return this; if (other.hasTransactionOutPointHash()) { setTransactionOutPointHash(other.getTransactionOutPointHash()); } if (other.hasTransactionOutPointIndex()) { setTransactionOutPointIndex(other.getTransactionOutPointIndex()); } if (other.hasScriptBytes()) { setScriptBytes(other.getScriptBytes()); } if (other.hasSequence()) { setSequence(other.getSequence()); } this.mergeUnknownFields(other.getUnknownFields()); return this; }
/** * <code>repeated .wallet.TransactionInput transaction_input = 6;</code> */ public Builder setTransactionInput( int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { ensureTransactionInputIsMutable(); transactionInput_.set(index, builderForValue.build()); onChanged(); } else { transactionInputBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * <code>repeated .wallet.TransactionInput transaction_input = 6;</code> */ public Builder addTransactionInput( org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { ensureTransactionInputIsMutable(); transactionInput_.add(builderForValue.build()); onChanged(); } else { transactionInputBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * <code>repeated .wallet.TransactionInput transaction_input = 6;</code> */ public Builder setTransactionInput( int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { ensureTransactionInputIsMutable(); transactionInput_.set(index, builderForValue.build()); onChanged(); } else { transactionInputBuilder_.setMessage(index, builderForValue.build()); } return this; } /**