From 324f603cbed9e4d29ff4857c28f06c6b5f9302d7 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Sat, 21 Sep 2013 20:08:43 +0200 Subject: [PATCH] Upgrade to protobuf 2.5 --- .../protocols/channels/ClientState.java | 1457 ++- .../protocols/channels/ServerState.java | 1439 ++- .../org/bitcoin/paymentchannel/Protos.java | 5856 ++++++---- .../main/java/org/bitcoinj/wallet/Protos.java | 9486 ++++++++++++----- pom.xml | 2 +- 5 files changed, 12563 insertions(+), 5677 deletions(-) diff --git a/core/src/main/java/com/google/bitcoin/protocols/channels/ClientState.java b/core/src/main/java/com/google/bitcoin/protocols/channels/ClientState.java index cd9bced7b..abb8bf00b 100644 --- a/core/src/main/java/com/google/bitcoin/protocols/channels/ClientState.java +++ b/core/src/main/java/com/google/bitcoin/protocols/channels/ClientState.java @@ -10,66 +10,173 @@ public final class ClientState { } public interface StoredClientPaymentChannelsOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ java.util.List getChannelsList(); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ int getChannelsCount(); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ java.util.List getChannelsOrBuilderList(); + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder( int index); } + /** + * Protobuf type {@code paymentchannels.StoredClientPaymentChannels} + * + *
+   * A set of StoredPaymentChannel's
+   * 
+ */ public static final class StoredClientPaymentChannels extends com.google.protobuf.GeneratedMessage implements StoredClientPaymentChannelsOrBuilder { // Use StoredClientPaymentChannels.newBuilder() to construct. - private StoredClientPaymentChannels(Builder builder) { + private StoredClientPaymentChannels(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private StoredClientPaymentChannels(boolean noInit) {} - + private StoredClientPaymentChannels(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final StoredClientPaymentChannels defaultInstance; public static StoredClientPaymentChannels getDefaultInstance() { return defaultInstance; } - + public StoredClientPaymentChannels getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredClientPaymentChannels( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + channels_.add(input.readMessage(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = java.util.Collections.unmodifiableList(channels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable; + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public StoredClientPaymentChannels parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredClientPaymentChannels(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + // repeated .paymentchannels.StoredClientPaymentChannel channels = 1; public static final int CHANNELS_FIELD_NUMBER = 1; private java.util.List channels_; + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public java.util.List getChannelsList() { return channels_; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public java.util.List getChannelsOrBuilderList() { return channels_; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public int getChannelsCount() { return channels_.size(); } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index) { return channels_.get(index); } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder( int index) { return channels_.get(index); } - + private void initFields() { channels_ = java.util.Collections.emptyList(); } @@ -77,7 +184,7 @@ public final class ClientState { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + for (int i = 0; i < getChannelsCount(); i++) { if (!getChannels(i).isInitialized()) { memoizedIsInitialized = 0; @@ -87,7 +194,7 @@ public final class ClientState { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -96,12 +203,12 @@ public final class ClientState { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; for (int i = 0; i < channels_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -111,94 +218,87 @@ public final class ClientState { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.StoredClientPaymentChannels} + * + *
+     * A set of StoredPaymentChannel's
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelsOrBuilder { @@ -206,18 +306,21 @@ public final class ClientState { getDescriptor() { return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable; + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class); } - + // Construct using com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -229,7 +332,7 @@ public final class ClientState { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (channelsBuilder_ == null) { @@ -240,20 +343,20 @@ public final class ClientState { } return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.getDescriptor(); + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; } - + public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels getDefaultInstanceForType() { return com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.getDefaultInstance(); } - + public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels build() { com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels result = buildPartial(); if (!result.isInitialized()) { @@ -261,17 +364,7 @@ public final class ClientState { } return result; } - - private com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels buildPartial() { com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels result = new com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels(this); int from_bitField0_ = bitField0_; @@ -287,7 +380,7 @@ public final class ClientState { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels) { return mergeFrom((com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels)other); @@ -296,7 +389,7 @@ public final class ClientState { return this; } } - + public Builder mergeFrom(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels other) { if (other == com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.getDefaultInstance()) return this; if (channelsBuilder_ == null) { @@ -328,7 +421,7 @@ public final class ClientState { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { for (int i = 0; i < getChannelsCount(); i++) { if (!getChannels(i).isInitialized()) { @@ -338,42 +431,26 @@ public final class ClientState { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder subBuilder = com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addChannels(subBuilder.buildPartial()); - break; - } + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // repeated .paymentchannels.StoredClientPaymentChannel channels = 1; private java.util.List channels_ = java.util.Collections.emptyList(); @@ -383,10 +460,13 @@ public final class ClientState { bitField0_ |= 0x00000001; } } - + private com.google.protobuf.RepeatedFieldBuilder< com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder> channelsBuilder_; - + + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public java.util.List getChannelsList() { if (channelsBuilder_ == null) { return java.util.Collections.unmodifiableList(channels_); @@ -394,6 +474,9 @@ public final class ClientState { return channelsBuilder_.getMessageList(); } } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public int getChannelsCount() { if (channelsBuilder_ == null) { return channels_.size(); @@ -401,6 +484,9 @@ public final class ClientState { return channelsBuilder_.getCount(); } } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getChannels(int index) { if (channelsBuilder_ == null) { return channels_.get(index); @@ -408,6 +494,9 @@ public final class ClientState { return channelsBuilder_.getMessage(index); } } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder setChannels( int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel value) { if (channelsBuilder_ == null) { @@ -422,6 +511,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder setChannels( int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) { if (channelsBuilder_ == null) { @@ -433,6 +525,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder addChannels(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel value) { if (channelsBuilder_ == null) { if (value == null) { @@ -446,6 +541,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder addChannels( int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel value) { if (channelsBuilder_ == null) { @@ -460,6 +558,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder addChannels( com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) { if (channelsBuilder_ == null) { @@ -471,6 +572,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder addChannels( int index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder builderForValue) { if (channelsBuilder_ == null) { @@ -482,6 +586,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder addAllChannels( java.lang.Iterable values) { if (channelsBuilder_ == null) { @@ -493,6 +600,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder clearChannels() { if (channelsBuilder_ == null) { channels_ = java.util.Collections.emptyList(); @@ -503,6 +613,9 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public Builder removeChannels(int index) { if (channelsBuilder_ == null) { ensureChannelsIsMutable(); @@ -513,10 +626,16 @@ public final class ClientState { } return this; } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder getChannelsBuilder( int index) { return getChannelsFieldBuilder().getBuilder(index); } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder getChannelsOrBuilder( int index) { if (channelsBuilder_ == null) { @@ -524,6 +643,9 @@ public final class ClientState { return channelsBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public java.util.List getChannelsOrBuilderList() { if (channelsBuilder_ != null) { @@ -532,15 +654,24 @@ public final class ClientState { return java.util.Collections.unmodifiableList(channels_); } } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder addChannelsBuilder() { return getChannelsFieldBuilder().addBuilder( com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()); } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder addChannelsBuilder( int index) { return getChannelsFieldBuilder().addBuilder( index, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()); } + /** + * repeated .paymentchannels.StoredClientPaymentChannel channels = 1; + */ public java.util.List getChannelsBuilderList() { return getChannelsFieldBuilder().getBuilderList(); @@ -559,513 +690,134 @@ public final class ClientState { } return channelsBuilder_; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredClientPaymentChannels) } - + static { defaultInstance = new StoredClientPaymentChannels(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.StoredClientPaymentChannels) } - + public interface StoredClientPaymentChannelOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes id = 1; + /** + * required bytes id = 1; + */ boolean hasId(); + /** + * required bytes id = 1; + */ com.google.protobuf.ByteString getId(); - + // required bytes contractTransaction = 2; + /** + * required bytes contractTransaction = 2; + */ boolean hasContractTransaction(); + /** + * required bytes contractTransaction = 2; + */ com.google.protobuf.ByteString getContractTransaction(); - + // required bytes refundTransaction = 3; + /** + * required bytes refundTransaction = 3; + */ boolean hasRefundTransaction(); + /** + * required bytes refundTransaction = 3; + */ com.google.protobuf.ByteString getRefundTransaction(); - + // required bytes myKey = 4; + /** + * required bytes myKey = 4; + */ boolean hasMyKey(); + /** + * required bytes myKey = 4; + */ com.google.protobuf.ByteString getMyKey(); - + // required uint64 valueToMe = 5; + /** + * required uint64 valueToMe = 5; + */ boolean hasValueToMe(); + /** + * required uint64 valueToMe = 5; + */ long getValueToMe(); - + // required uint64 refundFees = 6; + /** + * required uint64 refundFees = 6; + */ boolean hasRefundFees(); + /** + * required uint64 refundFees = 6; + */ long getRefundFees(); } + /** + * Protobuf type {@code paymentchannels.StoredClientPaymentChannel} + * + *
+   * A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to
+   * reopen an existing channel
+   * 
+ */ public static final class StoredClientPaymentChannel extends com.google.protobuf.GeneratedMessage implements StoredClientPaymentChannelOrBuilder { // Use StoredClientPaymentChannel.newBuilder() to construct. - private StoredClientPaymentChannel(Builder builder) { + private StoredClientPaymentChannel(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private StoredClientPaymentChannel(boolean noInit) {} - + private StoredClientPaymentChannel(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final StoredClientPaymentChannel defaultInstance; public static StoredClientPaymentChannel getDefaultInstance() { return defaultInstance; } - + public StoredClientPaymentChannel getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable; - } - - private int bitField0_; - // required bytes id = 1; - public static final int ID_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString id_; - public boolean hasId() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getId() { - return id_; - } - - // required bytes contractTransaction = 2; - public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString contractTransaction_; - public boolean hasContractTransaction() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public com.google.protobuf.ByteString getContractTransaction() { - return contractTransaction_; - } - - // required bytes refundTransaction = 3; - public static final int REFUNDTRANSACTION_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString refundTransaction_; - public boolean hasRefundTransaction() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public com.google.protobuf.ByteString getRefundTransaction() { - return refundTransaction_; - } - - // required bytes myKey = 4; - public static final int MYKEY_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString myKey_; - public boolean hasMyKey() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public com.google.protobuf.ByteString getMyKey() { - return myKey_; - } - - // required uint64 valueToMe = 5; - public static final int VALUETOME_FIELD_NUMBER = 5; - private long valueToMe_; - public boolean hasValueToMe() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - public long getValueToMe() { - return valueToMe_; - } - - // required uint64 refundFees = 6; - public static final int REFUNDFEES_FIELD_NUMBER = 6; - private long refundFees_; - public boolean hasRefundFees() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - public long getRefundFees() { - return refundFees_; - } - - private void initFields() { - id_ = com.google.protobuf.ByteString.EMPTY; - contractTransaction_ = com.google.protobuf.ByteString.EMPTY; - refundTransaction_ = com.google.protobuf.ByteString.EMPTY; - myKey_ = com.google.protobuf.ByteString.EMPTY; - valueToMe_ = 0L; - refundFees_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasId()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasContractTransaction()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasRefundTransaction()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasMyKey()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasValueToMe()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasRefundFees()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, id_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, contractTransaction_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, refundTransaction_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(4, myKey_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeUInt64(5, valueToMe_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeUInt64(6, refundFees_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, id_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, contractTransaction_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, refundTransaction_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, myKey_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(5, valueToMe_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, refundFees_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + private StoredClientPaymentChannel( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable; - } - - // Construct using com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - id_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - contractTransaction_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - refundTransaction_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - myKey_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - valueToMe_ = 0L; - bitField0_ = (bitField0_ & ~0x00000010); - refundFees_ = 0L; - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDescriptor(); - } - - public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getDefaultInstanceForType() { - return com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance(); - } - - public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel build() { - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel buildPartial() { - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result = new com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.id_ = id_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.contractTransaction_ = contractTransaction_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.refundTransaction_ = refundTransaction_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.myKey_ = myKey_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.valueToMe_ = valueToMe_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.refundFees_ = refundFees_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel) { - return mergeFrom((com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel other) { - if (other == com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()) return this; - if (other.hasId()) { - setId(other.getId()); - } - if (other.hasContractTransaction()) { - setContractTransaction(other.getContractTransaction()); - } - if (other.hasRefundTransaction()) { - setRefundTransaction(other.getRefundTransaction()); - } - if (other.hasMyKey()) { - setMyKey(other.getMyKey()); - } - if (other.hasValueToMe()) { - setValueToMe(other.getValueToMe()); - } - if (other.hasRefundFees()) { - setRefundFees(other.getRefundFees()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasId()) { - - return false; - } - if (!hasContractTransaction()) { - - return false; - } - if (!hasRefundTransaction()) { - - return false; - } - if (!hasMyKey()) { - - return false; - } - if (!hasValueToMe()) { - - return false; - } - if (!hasRefundFees()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -1101,18 +853,522 @@ public final class ClientState { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public StoredClientPaymentChannel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredClientPaymentChannel(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bytes id = 1; + public static final int ID_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString id_; + /** + * required bytes id = 1; + */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes id = 1; + */ + public com.google.protobuf.ByteString getId() { + return id_; + } + + // required bytes contractTransaction = 2; + public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString contractTransaction_; + /** + * required bytes contractTransaction = 2; + */ + public boolean hasContractTransaction() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes contractTransaction = 2; + */ + public com.google.protobuf.ByteString getContractTransaction() { + return contractTransaction_; + } + + // required bytes refundTransaction = 3; + public static final int REFUNDTRANSACTION_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString refundTransaction_; + /** + * required bytes refundTransaction = 3; + */ + public boolean hasRefundTransaction() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes refundTransaction = 3; + */ + public com.google.protobuf.ByteString getRefundTransaction() { + return refundTransaction_; + } + + // required bytes myKey = 4; + public static final int MYKEY_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString myKey_; + /** + * required bytes myKey = 4; + */ + public boolean hasMyKey() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes myKey = 4; + */ + public com.google.protobuf.ByteString getMyKey() { + return myKey_; + } + + // required uint64 valueToMe = 5; + public static final int VALUETOME_FIELD_NUMBER = 5; + private long valueToMe_; + /** + * required uint64 valueToMe = 5; + */ + public boolean hasValueToMe() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * required uint64 valueToMe = 5; + */ + public long getValueToMe() { + return valueToMe_; + } + + // required uint64 refundFees = 6; + public static final int REFUNDFEES_FIELD_NUMBER = 6; + private long refundFees_; + /** + * required uint64 refundFees = 6; + */ + public boolean hasRefundFees() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required uint64 refundFees = 6; + */ + public long getRefundFees() { + return refundFees_; + } + + private void initFields() { + id_ = com.google.protobuf.ByteString.EMPTY; + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + refundTransaction_ = com.google.protobuf.ByteString.EMPTY; + myKey_ = com.google.protobuf.ByteString.EMPTY; + valueToMe_ = 0L; + refundFees_ = 0L; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasContractTransaction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRefundTransaction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMyKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasValueToMe()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRefundFees()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, contractTransaction_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, refundTransaction_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, myKey_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeUInt64(5, valueToMe_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeUInt64(6, refundFees_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, id_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, contractTransaction_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, refundTransaction_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, myKey_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(5, valueToMe_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, refundFees_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code paymentchannels.StoredClientPaymentChannel} + * + *
+     * A client-side payment channel in serialized form, which can be reloaded later if the client restarts and wants to
+     * reopen an existing channel
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.class, com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class); + } + + // Construct using com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + id_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + refundTransaction_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + myKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + valueToMe_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + refundFees_ = 0L; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.bitcoin.protocols.channels.ClientState.internal_static_paymentchannels_StoredClientPaymentChannel_descriptor; + } + + public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel getDefaultInstanceForType() { + return com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance(); + } + + public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel build() { + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel buildPartial() { + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel result = new com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.contractTransaction_ = contractTransaction_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.refundTransaction_ = refundTransaction_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.myKey_ = myKey_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.valueToMe_ = valueToMe_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.refundFees_ = refundFees_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel) { + return mergeFrom((com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel other) { + if (other == com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.getDefaultInstance()) return this; + if (other.hasId()) { + setId(other.getId()); + } + if (other.hasContractTransaction()) { + setContractTransaction(other.getContractTransaction()); + } + if (other.hasRefundTransaction()) { + setRefundTransaction(other.getRefundTransaction()); + } + if (other.hasMyKey()) { + setMyKey(other.getMyKey()); + } + if (other.hasValueToMe()) { + setValueToMe(other.getValueToMe()); + } + if (other.hasRefundFees()) { + setRefundFees(other.getRefundFees()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + + return false; + } + if (!hasContractTransaction()) { + + return false; + } + if (!hasRefundTransaction()) { + + return false; + } + if (!hasMyKey()) { + + return false; + } + if (!hasValueToMe()) { + + return false; + } + if (!hasRefundFees()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // required bytes id = 1; private com.google.protobuf.ByteString id_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes id = 1; + */ public boolean hasId() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes id = 1; + */ public com.google.protobuf.ByteString getId() { return id_; } + /** + * required bytes id = 1; + */ public Builder setId(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1122,21 +1378,33 @@ public final class ClientState { onChanged(); return this; } + /** + * required bytes id = 1; + */ public Builder clearId() { bitField0_ = (bitField0_ & ~0x00000001); id_ = getDefaultInstance().getId(); onChanged(); return this; } - + // required bytes contractTransaction = 2; private com.google.protobuf.ByteString contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes contractTransaction = 2; + */ public boolean hasContractTransaction() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes contractTransaction = 2; + */ public com.google.protobuf.ByteString getContractTransaction() { return contractTransaction_; } + /** + * required bytes contractTransaction = 2; + */ public Builder setContractTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1146,21 +1414,33 @@ public final class ClientState { onChanged(); return this; } + /** + * required bytes contractTransaction = 2; + */ public Builder clearContractTransaction() { bitField0_ = (bitField0_ & ~0x00000002); contractTransaction_ = getDefaultInstance().getContractTransaction(); onChanged(); return this; } - + // required bytes refundTransaction = 3; private com.google.protobuf.ByteString refundTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes refundTransaction = 3; + */ public boolean hasRefundTransaction() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required bytes refundTransaction = 3; + */ public com.google.protobuf.ByteString getRefundTransaction() { return refundTransaction_; } + /** + * required bytes refundTransaction = 3; + */ public Builder setRefundTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1170,21 +1450,33 @@ public final class ClientState { onChanged(); return this; } + /** + * required bytes refundTransaction = 3; + */ public Builder clearRefundTransaction() { bitField0_ = (bitField0_ & ~0x00000004); refundTransaction_ = getDefaultInstance().getRefundTransaction(); onChanged(); return this; } - + // required bytes myKey = 4; private com.google.protobuf.ByteString myKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes myKey = 4; + */ public boolean hasMyKey() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * required bytes myKey = 4; + */ public com.google.protobuf.ByteString getMyKey() { return myKey_; } + /** + * required bytes myKey = 4; + */ public Builder setMyKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1194,66 +1486,93 @@ public final class ClientState { onChanged(); return this; } + /** + * required bytes myKey = 4; + */ public Builder clearMyKey() { bitField0_ = (bitField0_ & ~0x00000008); myKey_ = getDefaultInstance().getMyKey(); onChanged(); return this; } - + // required uint64 valueToMe = 5; private long valueToMe_ ; + /** + * required uint64 valueToMe = 5; + */ public boolean hasValueToMe() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * required uint64 valueToMe = 5; + */ public long getValueToMe() { return valueToMe_; } + /** + * required uint64 valueToMe = 5; + */ public Builder setValueToMe(long value) { bitField0_ |= 0x00000010; valueToMe_ = value; onChanged(); return this; } + /** + * required uint64 valueToMe = 5; + */ public Builder clearValueToMe() { bitField0_ = (bitField0_ & ~0x00000010); valueToMe_ = 0L; onChanged(); return this; } - + // required uint64 refundFees = 6; private long refundFees_ ; + /** + * required uint64 refundFees = 6; + */ public boolean hasRefundFees() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * required uint64 refundFees = 6; + */ public long getRefundFees() { return refundFees_; } + /** + * required uint64 refundFees = 6; + */ public Builder setRefundFees(long value) { bitField0_ |= 0x00000020; refundFees_ = value; onChanged(); return this; } + /** + * required uint64 refundFees = 6; + */ public Builder clearRefundFees() { bitField0_ = (bitField0_ & ~0x00000020); refundFees_ = 0L; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredClientPaymentChannel) } - + static { defaultInstance = new StoredClientPaymentChannel(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.StoredClientPaymentChannel) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_paymentchannels_StoredClientPaymentChannels_descriptor; private static @@ -1264,7 +1583,7 @@ public final class ClientState { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -1293,17 +1612,13 @@ public final class ClientState { internal_static_paymentchannels_StoredClientPaymentChannels_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_StoredClientPaymentChannels_descriptor, - new java.lang.String[] { "Channels", }, - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.class, - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannels.Builder.class); + new java.lang.String[] { "Channels", }); internal_static_paymentchannels_StoredClientPaymentChannel_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_paymentchannels_StoredClientPaymentChannel_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_StoredClientPaymentChannel_descriptor, - new java.lang.String[] { "Id", "ContractTransaction", "RefundTransaction", "MyKey", "ValueToMe", "RefundFees", }, - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.class, - com.google.bitcoin.protocols.channels.ClientState.StoredClientPaymentChannel.Builder.class); + new java.lang.String[] { "Id", "ContractTransaction", "RefundTransaction", "MyKey", "ValueToMe", "RefundFees", }); return null; } }; @@ -1312,6 +1627,6 @@ public final class ClientState { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/core/src/main/java/com/google/bitcoin/protocols/channels/ServerState.java b/core/src/main/java/com/google/bitcoin/protocols/channels/ServerState.java index a1565bc16..99316fda1 100644 --- a/core/src/main/java/com/google/bitcoin/protocols/channels/ServerState.java +++ b/core/src/main/java/com/google/bitcoin/protocols/channels/ServerState.java @@ -10,66 +10,173 @@ public final class ServerState { } public interface StoredServerPaymentChannelsOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ java.util.List getChannelsList(); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ int getChannelsCount(); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ java.util.List getChannelsOrBuilderList(); + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder( int index); } + /** + * Protobuf type {@code paymentchannels.StoredServerPaymentChannels} + * + *
+   * A set of StoredPaymentChannel's
+   * 
+ */ public static final class StoredServerPaymentChannels extends com.google.protobuf.GeneratedMessage implements StoredServerPaymentChannelsOrBuilder { // Use StoredServerPaymentChannels.newBuilder() to construct. - private StoredServerPaymentChannels(Builder builder) { + private StoredServerPaymentChannels(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private StoredServerPaymentChannels(boolean noInit) {} - + private StoredServerPaymentChannels(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final StoredServerPaymentChannels defaultInstance; public static StoredServerPaymentChannels getDefaultInstance() { return defaultInstance; } - + public StoredServerPaymentChannels getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StoredServerPaymentChannels( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + channels_.add(input.readMessage(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.PARSER, extensionRegistry)); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + channels_ = java.util.Collections.unmodifiableList(channels_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable; + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public StoredServerPaymentChannels parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredServerPaymentChannels(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + // repeated .paymentchannels.StoredServerPaymentChannel channels = 1; public static final int CHANNELS_FIELD_NUMBER = 1; private java.util.List channels_; + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public java.util.List getChannelsList() { return channels_; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public java.util.List getChannelsOrBuilderList() { return channels_; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public int getChannelsCount() { return channels_.size(); } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index) { return channels_.get(index); } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder( int index) { return channels_.get(index); } - + private void initFields() { channels_ = java.util.Collections.emptyList(); } @@ -77,7 +184,7 @@ public final class ServerState { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + for (int i = 0; i < getChannelsCount(); i++) { if (!getChannels(i).isInitialized()) { memoizedIsInitialized = 0; @@ -87,7 +194,7 @@ public final class ServerState { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -96,12 +203,12 @@ public final class ServerState { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; for (int i = 0; i < channels_.size(); i++) { size += com.google.protobuf.CodedOutputStream @@ -111,94 +218,87 @@ public final class ServerState { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.StoredServerPaymentChannels} + * + *
+     * A set of StoredPaymentChannel's
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelsOrBuilder { @@ -206,18 +306,21 @@ public final class ServerState { getDescriptor() { return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable; + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class); } - + // Construct using com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -229,7 +332,7 @@ public final class ServerState { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (channelsBuilder_ == null) { @@ -240,20 +343,20 @@ public final class ServerState { } return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.getDescriptor(); + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; } - + public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels getDefaultInstanceForType() { return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.getDefaultInstance(); } - + public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels build() { com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels result = buildPartial(); if (!result.isInitialized()) { @@ -261,17 +364,7 @@ public final class ServerState { } return result; } - - private com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels buildPartial() { com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels result = new com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels(this); int from_bitField0_ = bitField0_; @@ -287,7 +380,7 @@ public final class ServerState { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels) { return mergeFrom((com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels)other); @@ -296,7 +389,7 @@ public final class ServerState { return this; } } - + public Builder mergeFrom(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels other) { if (other == com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.getDefaultInstance()) return this; if (channelsBuilder_ == null) { @@ -328,7 +421,7 @@ public final class ServerState { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { for (int i = 0; i < getChannelsCount(); i++) { if (!getChannels(i).isInitialized()) { @@ -338,42 +431,26 @@ public final class ServerState { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder subBuilder = com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addChannels(subBuilder.buildPartial()); - break; - } + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // repeated .paymentchannels.StoredServerPaymentChannel channels = 1; private java.util.List channels_ = java.util.Collections.emptyList(); @@ -383,10 +460,13 @@ public final class ServerState { bitField0_ |= 0x00000001; } } - + private com.google.protobuf.RepeatedFieldBuilder< com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder> channelsBuilder_; - + + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public java.util.List getChannelsList() { if (channelsBuilder_ == null) { return java.util.Collections.unmodifiableList(channels_); @@ -394,6 +474,9 @@ public final class ServerState { return channelsBuilder_.getMessageList(); } } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public int getChannelsCount() { if (channelsBuilder_ == null) { return channels_.size(); @@ -401,6 +484,9 @@ public final class ServerState { return channelsBuilder_.getCount(); } } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getChannels(int index) { if (channelsBuilder_ == null) { return channels_.get(index); @@ -408,6 +494,9 @@ public final class ServerState { return channelsBuilder_.getMessage(index); } } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder setChannels( int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel value) { if (channelsBuilder_ == null) { @@ -422,6 +511,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder setChannels( int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder builderForValue) { if (channelsBuilder_ == null) { @@ -433,6 +525,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder addChannels(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel value) { if (channelsBuilder_ == null) { if (value == null) { @@ -446,6 +541,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder addChannels( int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel value) { if (channelsBuilder_ == null) { @@ -460,6 +558,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder addChannels( com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder builderForValue) { if (channelsBuilder_ == null) { @@ -471,6 +572,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder addChannels( int index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder builderForValue) { if (channelsBuilder_ == null) { @@ -482,6 +586,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder addAllChannels( java.lang.Iterable values) { if (channelsBuilder_ == null) { @@ -493,6 +600,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder clearChannels() { if (channelsBuilder_ == null) { channels_ = java.util.Collections.emptyList(); @@ -503,6 +613,9 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public Builder removeChannels(int index) { if (channelsBuilder_ == null) { ensureChannelsIsMutable(); @@ -513,10 +626,16 @@ public final class ServerState { } return this; } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder getChannelsBuilder( int index) { return getChannelsFieldBuilder().getBuilder(index); } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder getChannelsOrBuilder( int index) { if (channelsBuilder_ == null) { @@ -524,6 +643,9 @@ public final class ServerState { return channelsBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public java.util.List getChannelsOrBuilderList() { if (channelsBuilder_ != null) { @@ -532,15 +654,24 @@ public final class ServerState { return java.util.Collections.unmodifiableList(channels_); } } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder addChannelsBuilder() { return getChannelsFieldBuilder().addBuilder( com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()); } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder addChannelsBuilder( int index) { return getChannelsFieldBuilder().addBuilder( index, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()); } + /** + * repeated .paymentchannels.StoredServerPaymentChannel channels = 1; + */ public java.util.List getChannelsBuilderList() { return getChannelsFieldBuilder().getBuilderList(); @@ -559,505 +690,133 @@ public final class ServerState { } return channelsBuilder_; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredServerPaymentChannels) } - + static { defaultInstance = new StoredServerPaymentChannels(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.StoredServerPaymentChannels) } - + public interface StoredServerPaymentChannelOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required uint64 bestValueToMe = 1; + /** + * required uint64 bestValueToMe = 1; + */ boolean hasBestValueToMe(); + /** + * required uint64 bestValueToMe = 1; + */ long getBestValueToMe(); - + // optional bytes bestValueSignature = 2; + /** + * optional bytes bestValueSignature = 2; + */ boolean hasBestValueSignature(); + /** + * optional bytes bestValueSignature = 2; + */ com.google.protobuf.ByteString getBestValueSignature(); - + // required uint64 refundTransactionUnlockTimeSecs = 3; + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ boolean hasRefundTransactionUnlockTimeSecs(); + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ long getRefundTransactionUnlockTimeSecs(); - + // required bytes contractTransaction = 4; + /** + * required bytes contractTransaction = 4; + */ boolean hasContractTransaction(); + /** + * required bytes contractTransaction = 4; + */ com.google.protobuf.ByteString getContractTransaction(); - + // required bytes clientOutput = 5; + /** + * required bytes clientOutput = 5; + */ boolean hasClientOutput(); + /** + * required bytes clientOutput = 5; + */ com.google.protobuf.ByteString getClientOutput(); - + // required bytes myKey = 6; + /** + * required bytes myKey = 6; + */ boolean hasMyKey(); + /** + * required bytes myKey = 6; + */ com.google.protobuf.ByteString getMyKey(); } + /** + * Protobuf type {@code paymentchannels.StoredServerPaymentChannel} + * + *
+   * A server-side payment channel in serialized form, which can be reloaded later if the server restarts
+   * 
+ */ public static final class StoredServerPaymentChannel extends com.google.protobuf.GeneratedMessage implements StoredServerPaymentChannelOrBuilder { // Use StoredServerPaymentChannel.newBuilder() to construct. - private StoredServerPaymentChannel(Builder builder) { + private StoredServerPaymentChannel(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private StoredServerPaymentChannel(boolean noInit) {} - + private StoredServerPaymentChannel(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final StoredServerPaymentChannel defaultInstance; public static StoredServerPaymentChannel getDefaultInstance() { return defaultInstance; } - + public StoredServerPaymentChannel getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable; - } - - private int bitField0_; - // required uint64 bestValueToMe = 1; - public static final int BESTVALUETOME_FIELD_NUMBER = 1; - private long bestValueToMe_; - public boolean hasBestValueToMe() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public long getBestValueToMe() { - return bestValueToMe_; - } - - // optional bytes bestValueSignature = 2; - public static final int BESTVALUESIGNATURE_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString bestValueSignature_; - public boolean hasBestValueSignature() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public com.google.protobuf.ByteString getBestValueSignature() { - return bestValueSignature_; - } - - // required uint64 refundTransactionUnlockTimeSecs = 3; - public static final int REFUNDTRANSACTIONUNLOCKTIMESECS_FIELD_NUMBER = 3; - private long refundTransactionUnlockTimeSecs_; - public boolean hasRefundTransactionUnlockTimeSecs() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public long getRefundTransactionUnlockTimeSecs() { - return refundTransactionUnlockTimeSecs_; - } - - // required bytes contractTransaction = 4; - public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString contractTransaction_; - public boolean hasContractTransaction() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public com.google.protobuf.ByteString getContractTransaction() { - return contractTransaction_; - } - - // required bytes clientOutput = 5; - public static final int CLIENTOUTPUT_FIELD_NUMBER = 5; - private com.google.protobuf.ByteString clientOutput_; - public boolean hasClientOutput() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - public com.google.protobuf.ByteString getClientOutput() { - return clientOutput_; - } - - // required bytes myKey = 6; - public static final int MYKEY_FIELD_NUMBER = 6; - private com.google.protobuf.ByteString myKey_; - public boolean hasMyKey() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - public com.google.protobuf.ByteString getMyKey() { - return myKey_; - } - - private void initFields() { - bestValueToMe_ = 0L; - bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; - refundTransactionUnlockTimeSecs_ = 0L; - contractTransaction_ = com.google.protobuf.ByteString.EMPTY; - clientOutput_ = com.google.protobuf.ByteString.EMPTY; - myKey_ = com.google.protobuf.ByteString.EMPTY; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasBestValueToMe()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasRefundTransactionUnlockTimeSecs()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasContractTransaction()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasClientOutput()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasMyKey()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeUInt64(1, bestValueToMe_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, bestValueSignature_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeUInt64(3, refundTransactionUnlockTimeSecs_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(4, contractTransaction_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, clientOutput_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeBytes(6, myKey_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(1, bestValueToMe_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, bestValueSignature_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, refundTransactionUnlockTimeSecs_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, contractTransaction_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, clientOutput_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(6, myKey_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + private StoredServerPaymentChannel( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable; - } - - // Construct using com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - bestValueToMe_ = 0L; - bitField0_ = (bitField0_ & ~0x00000001); - bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - refundTransactionUnlockTimeSecs_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - contractTransaction_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - clientOutput_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000010); - myKey_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDescriptor(); - } - - public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getDefaultInstanceForType() { - return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance(); - } - - public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel build() { - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel buildPartial() { - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = new com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.bestValueToMe_ = bestValueToMe_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.bestValueSignature_ = bestValueSignature_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.refundTransactionUnlockTimeSecs_ = refundTransactionUnlockTimeSecs_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.contractTransaction_ = contractTransaction_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.clientOutput_ = clientOutput_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.myKey_ = myKey_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel) { - return mergeFrom((com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel other) { - if (other == com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()) return this; - if (other.hasBestValueToMe()) { - setBestValueToMe(other.getBestValueToMe()); - } - if (other.hasBestValueSignature()) { - setBestValueSignature(other.getBestValueSignature()); - } - if (other.hasRefundTransactionUnlockTimeSecs()) { - setRefundTransactionUnlockTimeSecs(other.getRefundTransactionUnlockTimeSecs()); - } - if (other.hasContractTransaction()) { - setContractTransaction(other.getContractTransaction()); - } - if (other.hasClientOutput()) { - setClientOutput(other.getClientOutput()); - } - if (other.hasMyKey()) { - setMyKey(other.getMyKey()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasBestValueToMe()) { - - return false; - } - if (!hasRefundTransactionUnlockTimeSecs()) { - - return false; - } - if (!hasContractTransaction()) { - - return false; - } - if (!hasClientOutput()) { - - return false; - } - if (!hasMyKey()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -1093,39 +852,546 @@ public final class ServerState { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public StoredServerPaymentChannel parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StoredServerPaymentChannel(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required uint64 bestValueToMe = 1; + public static final int BESTVALUETOME_FIELD_NUMBER = 1; + private long bestValueToMe_; + /** + * required uint64 bestValueToMe = 1; + */ + public boolean hasBestValueToMe() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required uint64 bestValueToMe = 1; + */ + public long getBestValueToMe() { + return bestValueToMe_; + } + + // optional bytes bestValueSignature = 2; + public static final int BESTVALUESIGNATURE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString bestValueSignature_; + /** + * optional bytes bestValueSignature = 2; + */ + public boolean hasBestValueSignature() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional bytes bestValueSignature = 2; + */ + public com.google.protobuf.ByteString getBestValueSignature() { + return bestValueSignature_; + } + + // required uint64 refundTransactionUnlockTimeSecs = 3; + public static final int REFUNDTRANSACTIONUNLOCKTIMESECS_FIELD_NUMBER = 3; + private long refundTransactionUnlockTimeSecs_; + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public boolean hasRefundTransactionUnlockTimeSecs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ + public long getRefundTransactionUnlockTimeSecs() { + return refundTransactionUnlockTimeSecs_; + } + + // required bytes contractTransaction = 4; + public static final int CONTRACTTRANSACTION_FIELD_NUMBER = 4; + private com.google.protobuf.ByteString contractTransaction_; + /** + * required bytes contractTransaction = 4; + */ + public boolean hasContractTransaction() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * required bytes contractTransaction = 4; + */ + public com.google.protobuf.ByteString getContractTransaction() { + return contractTransaction_; + } + + // required bytes clientOutput = 5; + public static final int CLIENTOUTPUT_FIELD_NUMBER = 5; + private com.google.protobuf.ByteString clientOutput_; + /** + * required bytes clientOutput = 5; + */ + public boolean hasClientOutput() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * required bytes clientOutput = 5; + */ + public com.google.protobuf.ByteString getClientOutput() { + return clientOutput_; + } + + // required bytes myKey = 6; + public static final int MYKEY_FIELD_NUMBER = 6; + private com.google.protobuf.ByteString myKey_; + /** + * required bytes myKey = 6; + */ + public boolean hasMyKey() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * required bytes myKey = 6; + */ + public com.google.protobuf.ByteString getMyKey() { + return myKey_; + } + + private void initFields() { + bestValueToMe_ = 0L; + bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; + refundTransactionUnlockTimeSecs_ = 0L; + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + clientOutput_ = com.google.protobuf.ByteString.EMPTY; + myKey_ = com.google.protobuf.ByteString.EMPTY; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasBestValueToMe()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasRefundTransactionUnlockTimeSecs()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasContractTransaction()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasClientOutput()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMyKey()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeUInt64(1, bestValueToMe_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, bestValueSignature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, refundTransactionUnlockTimeSecs_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(4, contractTransaction_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeBytes(5, clientOutput_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeBytes(6, myKey_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(1, bestValueToMe_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, bestValueSignature_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, refundTransactionUnlockTimeSecs_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(4, contractTransaction_); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(5, clientOutput_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(6, myKey_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code paymentchannels.StoredServerPaymentChannel} + * + *
+     * A server-side payment channel in serialized form, which can be reloaded later if the server restarts
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannelOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.class, com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class); + } + + // Construct using com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + bestValueToMe_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + refundTransactionUnlockTimeSecs_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000008); + clientOutput_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000010); + myKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000020); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.bitcoin.protocols.channels.ServerState.internal_static_paymentchannels_StoredServerPaymentChannel_descriptor; + } + + public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel getDefaultInstanceForType() { + return com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance(); + } + + public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel build() { + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel buildPartial() { + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel result = new com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.bestValueToMe_ = bestValueToMe_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.bestValueSignature_ = bestValueSignature_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.refundTransactionUnlockTimeSecs_ = refundTransactionUnlockTimeSecs_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.contractTransaction_ = contractTransaction_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000010; + } + result.clientOutput_ = clientOutput_; + if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + to_bitField0_ |= 0x00000020; + } + result.myKey_ = myKey_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel) { + return mergeFrom((com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel other) { + if (other == com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.getDefaultInstance()) return this; + if (other.hasBestValueToMe()) { + setBestValueToMe(other.getBestValueToMe()); + } + if (other.hasBestValueSignature()) { + setBestValueSignature(other.getBestValueSignature()); + } + if (other.hasRefundTransactionUnlockTimeSecs()) { + setRefundTransactionUnlockTimeSecs(other.getRefundTransactionUnlockTimeSecs()); + } + if (other.hasContractTransaction()) { + setContractTransaction(other.getContractTransaction()); + } + if (other.hasClientOutput()) { + setClientOutput(other.getClientOutput()); + } + if (other.hasMyKey()) { + setMyKey(other.getMyKey()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasBestValueToMe()) { + + return false; + } + if (!hasRefundTransactionUnlockTimeSecs()) { + + return false; + } + if (!hasContractTransaction()) { + + return false; + } + if (!hasClientOutput()) { + + return false; + } + if (!hasMyKey()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // required uint64 bestValueToMe = 1; private long bestValueToMe_ ; + /** + * required uint64 bestValueToMe = 1; + */ public boolean hasBestValueToMe() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required uint64 bestValueToMe = 1; + */ public long getBestValueToMe() { return bestValueToMe_; } + /** + * required uint64 bestValueToMe = 1; + */ public Builder setBestValueToMe(long value) { bitField0_ |= 0x00000001; bestValueToMe_ = value; onChanged(); return this; } + /** + * required uint64 bestValueToMe = 1; + */ public Builder clearBestValueToMe() { bitField0_ = (bitField0_ & ~0x00000001); bestValueToMe_ = 0L; onChanged(); return this; } - + // optional bytes bestValueSignature = 2; private com.google.protobuf.ByteString bestValueSignature_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes bestValueSignature = 2; + */ public boolean hasBestValueSignature() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional bytes bestValueSignature = 2; + */ public com.google.protobuf.ByteString getBestValueSignature() { return bestValueSignature_; } + /** + * optional bytes bestValueSignature = 2; + */ public Builder setBestValueSignature(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1135,42 +1401,66 @@ public final class ServerState { onChanged(); return this; } + /** + * optional bytes bestValueSignature = 2; + */ public Builder clearBestValueSignature() { bitField0_ = (bitField0_ & ~0x00000002); bestValueSignature_ = getDefaultInstance().getBestValueSignature(); onChanged(); return this; } - + // required uint64 refundTransactionUnlockTimeSecs = 3; private long refundTransactionUnlockTimeSecs_ ; + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ public boolean hasRefundTransactionUnlockTimeSecs() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ public long getRefundTransactionUnlockTimeSecs() { return refundTransactionUnlockTimeSecs_; } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ public Builder setRefundTransactionUnlockTimeSecs(long value) { bitField0_ |= 0x00000004; refundTransactionUnlockTimeSecs_ = value; onChanged(); return this; } + /** + * required uint64 refundTransactionUnlockTimeSecs = 3; + */ public Builder clearRefundTransactionUnlockTimeSecs() { bitField0_ = (bitField0_ & ~0x00000004); refundTransactionUnlockTimeSecs_ = 0L; onChanged(); return this; } - + // required bytes contractTransaction = 4; private com.google.protobuf.ByteString contractTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes contractTransaction = 4; + */ public boolean hasContractTransaction() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * required bytes contractTransaction = 4; + */ public com.google.protobuf.ByteString getContractTransaction() { return contractTransaction_; } + /** + * required bytes contractTransaction = 4; + */ public Builder setContractTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1180,21 +1470,33 @@ public final class ServerState { onChanged(); return this; } + /** + * required bytes contractTransaction = 4; + */ public Builder clearContractTransaction() { bitField0_ = (bitField0_ & ~0x00000008); contractTransaction_ = getDefaultInstance().getContractTransaction(); onChanged(); return this; } - + // required bytes clientOutput = 5; private com.google.protobuf.ByteString clientOutput_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes clientOutput = 5; + */ public boolean hasClientOutput() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * required bytes clientOutput = 5; + */ public com.google.protobuf.ByteString getClientOutput() { return clientOutput_; } + /** + * required bytes clientOutput = 5; + */ public Builder setClientOutput(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1204,21 +1506,33 @@ public final class ServerState { onChanged(); return this; } + /** + * required bytes clientOutput = 5; + */ public Builder clearClientOutput() { bitField0_ = (bitField0_ & ~0x00000010); clientOutput_ = getDefaultInstance().getClientOutput(); onChanged(); return this; } - + // required bytes myKey = 6; private com.google.protobuf.ByteString myKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes myKey = 6; + */ public boolean hasMyKey() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * required bytes myKey = 6; + */ public com.google.protobuf.ByteString getMyKey() { return myKey_; } + /** + * required bytes myKey = 6; + */ public Builder setMyKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1228,24 +1542,27 @@ public final class ServerState { onChanged(); return this; } + /** + * required bytes myKey = 6; + */ public Builder clearMyKey() { bitField0_ = (bitField0_ & ~0x00000020); myKey_ = getDefaultInstance().getMyKey(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.StoredServerPaymentChannel) } - + static { defaultInstance = new StoredServerPaymentChannel(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.StoredServerPaymentChannel) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_paymentchannels_StoredServerPaymentChannels_descriptor; private static @@ -1256,7 +1573,7 @@ public final class ServerState { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -1286,17 +1603,13 @@ public final class ServerState { internal_static_paymentchannels_StoredServerPaymentChannels_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_StoredServerPaymentChannels_descriptor, - new java.lang.String[] { "Channels", }, - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.class, - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannels.Builder.class); + new java.lang.String[] { "Channels", }); internal_static_paymentchannels_StoredServerPaymentChannel_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_paymentchannels_StoredServerPaymentChannel_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_StoredServerPaymentChannel_descriptor, - new java.lang.String[] { "BestValueToMe", "BestValueSignature", "RefundTransactionUnlockTimeSecs", "ContractTransaction", "ClientOutput", "MyKey", }, - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.class, - com.google.bitcoin.protocols.channels.ServerState.StoredServerPaymentChannel.Builder.class); + new java.lang.String[] { "BestValueToMe", "BestValueSignature", "RefundTransactionUnlockTimeSecs", "ContractTransaction", "ClientOutput", "MyKey", }); return null; } }; @@ -1305,6 +1618,6 @@ public final class ServerState { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/core/src/main/java/org/bitcoin/paymentchannel/Protos.java b/core/src/main/java/org/bitcoin/paymentchannel/Protos.java index 439ba1da4..ef4e34fe9 100644 --- a/core/src/main/java/org/bitcoin/paymentchannel/Protos.java +++ b/core/src/main/java/org/bitcoin/paymentchannel/Protos.java @@ -10,107 +10,501 @@ public final class Protos { } public interface TwoWayChannelMessageOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ */ boolean hasType(); + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ */ org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType(); - + // optional .paymentchannels.ClientVersion client_version = 2; + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ */ boolean hasClientVersion(); + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ */ org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion(); + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ */ org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder(); - + // optional .paymentchannels.ServerVersion server_version = 3; + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ boolean hasServerVersion(); + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion(); + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder(); - + // optional .paymentchannels.Initiate initiate = 4; + /** + * optional .paymentchannels.Initiate initiate = 4; + */ boolean hasInitiate(); + /** + * optional .paymentchannels.Initiate initiate = 4; + */ org.bitcoin.paymentchannel.Protos.Initiate getInitiate(); + /** + * optional .paymentchannels.Initiate initiate = 4; + */ org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder(); - + // optional .paymentchannels.ProvideRefund provide_refund = 5; + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ boolean hasProvideRefund(); + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund(); + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder(); - + // optional .paymentchannels.ReturnRefund return_refund = 6; + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ boolean hasReturnRefund(); + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund(); + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder(); - + // optional .paymentchannels.ProvideContract provide_contract = 7; + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ boolean hasProvideContract(); + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract(); + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder(); - + // optional .paymentchannels.UpdatePayment update_payment = 8; + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ boolean hasUpdatePayment(); + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment(); + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder(); - + // optional .paymentchannels.Error error = 10; + /** + * optional .paymentchannels.Error error = 10; + */ boolean hasError(); + /** + * optional .paymentchannels.Error error = 10; + */ org.bitcoin.paymentchannel.Protos.Error getError(); + /** + * optional .paymentchannels.Error error = 10; + */ org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder(); } + /** + * Protobuf type {@code paymentchannels.TwoWayChannelMessage} + * + *
+   * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
+   * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
+   * and "secondary" as "server".
+   * 
+ */ public static final class TwoWayChannelMessage extends com.google.protobuf.GeneratedMessage implements TwoWayChannelMessageOrBuilder { // Use TwoWayChannelMessage.newBuilder() to construct. - private TwoWayChannelMessage(Builder builder) { + private TwoWayChannelMessage(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private TwoWayChannelMessage(boolean noInit) {} - + private TwoWayChannelMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final TwoWayChannelMessage defaultInstance; public static TwoWayChannelMessage getDefaultInstance() { return defaultInstance; } - + public TwoWayChannelMessage getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TwoWayChannelMessage( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = value; + } + break; + } + case 18: { + org.bitcoin.paymentchannel.Protos.ClientVersion.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = clientVersion_.toBuilder(); + } + clientVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ClientVersion.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(clientVersion_); + clientVersion_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + org.bitcoin.paymentchannel.Protos.ServerVersion.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = serverVersion_.toBuilder(); + } + serverVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ServerVersion.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(serverVersion_); + serverVersion_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 34: { + org.bitcoin.paymentchannel.Protos.Initiate.Builder subBuilder = null; + if (((bitField0_ & 0x00000008) == 0x00000008)) { + subBuilder = initiate_.toBuilder(); + } + initiate_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Initiate.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(initiate_); + initiate_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000008; + break; + } + case 42: { + org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = provideRefund_.toBuilder(); + } + provideRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideRefund.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provideRefund_); + provideRefund_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 50: { + org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = returnRefund_.toBuilder(); + } + returnRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ReturnRefund.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(returnRefund_); + returnRefund_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 58: { + org.bitcoin.paymentchannel.Protos.ProvideContract.Builder subBuilder = null; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + subBuilder = provideContract_.toBuilder(); + } + provideContract_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideContract.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(provideContract_); + provideContract_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000040; + break; + } + case 66: { + org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = null; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + subBuilder = updatePayment_.toBuilder(); + } + updatePayment_ = input.readMessage(org.bitcoin.paymentchannel.Protos.UpdatePayment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updatePayment_); + updatePayment_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000080; + break; + } + case 82: { + org.bitcoin.paymentchannel.Protos.Error.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = error_.toBuilder(); + } + error_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Error.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(error_); + error_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TwoWayChannelMessage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TwoWayChannelMessage(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code paymentchannels.TwoWayChannelMessage.MessageType} + */ public enum MessageType implements com.google.protobuf.ProtocolMessageEnum { + /** + * CLIENT_VERSION = 1; + */ CLIENT_VERSION(0, 1), + /** + * SERVER_VERSION = 2; + */ SERVER_VERSION(1, 2), + /** + * INITIATE = 3; + */ INITIATE(2, 3), + /** + * PROVIDE_REFUND = 4; + */ PROVIDE_REFUND(3, 4), + /** + * RETURN_REFUND = 5; + */ RETURN_REFUND(4, 5), + /** + * PROVIDE_CONTRACT = 6; + */ PROVIDE_CONTRACT(5, 6), + /** + * CHANNEL_OPEN = 7; + * + *
+       * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
+       * secondary to the primary to indicate that the provided contract was received,
+       * verified, and broadcast successfully and the primary can now provide UPDATE messages
+       * at will to begin paying secondary. If the channel is interrupted after the
+       * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
+       * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
+       * message.
+       * 
+ */ CHANNEL_OPEN(6, 7), + /** + * UPDATE_PAYMENT = 8; + */ UPDATE_PAYMENT(7, 8), + /** + * CLOSE = 9; + * + *
+       * Note that there are no optional fields set for CLOSE, it is sent by either party to
+       * indicate that the channel is now closed and no further updates can happen. After this,
+       * the secondary takes the most recent signature it received in an UPDATE_PAYMENT and
+       * uses it to create a valid transaction, which it then broadcasts on the network.
+       * 
+ */ CLOSE(8, 9), + /** + * ERROR = 10; + * + *
+       * Used to indicate an error condition.
+       * Both parties should make an effort to send either an ERROR or a CLOSE immediately
+       * before closing the socket (unless they just received an ERROR or a CLOSE)
+       * 
+ */ ERROR(9, 10), ; - + + /** + * CLIENT_VERSION = 1; + */ public static final int CLIENT_VERSION_VALUE = 1; + /** + * SERVER_VERSION = 2; + */ public static final int SERVER_VERSION_VALUE = 2; + /** + * INITIATE = 3; + */ public static final int INITIATE_VALUE = 3; + /** + * PROVIDE_REFUND = 4; + */ public static final int PROVIDE_REFUND_VALUE = 4; + /** + * RETURN_REFUND = 5; + */ public static final int RETURN_REFUND_VALUE = 5; + /** + * PROVIDE_CONTRACT = 6; + */ public static final int PROVIDE_CONTRACT_VALUE = 6; + /** + * CHANNEL_OPEN = 7; + * + *
+       * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
+       * secondary to the primary to indicate that the provided contract was received,
+       * verified, and broadcast successfully and the primary can now provide UPDATE messages
+       * at will to begin paying secondary. If the channel is interrupted after the
+       * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
+       * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
+       * message.
+       * 
+ */ public static final int CHANNEL_OPEN_VALUE = 7; + /** + * UPDATE_PAYMENT = 8; + */ public static final int UPDATE_PAYMENT_VALUE = 8; + /** + * CLOSE = 9; + * + *
+       * Note that there are no optional fields set for CLOSE, it is sent by either party to
+       * indicate that the channel is now closed and no further updates can happen. After this,
+       * the secondary takes the most recent signature it received in an UPDATE_PAYMENT and
+       * uses it to create a valid transaction, which it then broadcasts on the network.
+       * 
+ */ public static final int CLOSE_VALUE = 9; + /** + * ERROR = 10; + * + *
+       * Used to indicate an error condition.
+       * Both parties should make an effort to send either an ERROR or a CLOSE immediately
+       * before closing the socket (unless they just received an ERROR or a CLOSE)
+       * 
+ */ public static final int ERROR_VALUE = 10; - - + + public final int getNumber() { return value; } - + public static MessageType valueOf(int value) { switch (value) { case 1: return CLIENT_VERSION; @@ -126,7 +520,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -138,7 +532,7 @@ public final class Protos { return MessageType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -151,11 +545,9 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDescriptor().getEnumTypes().get(0); } - - private static final MessageType[] VALUES = { - CLIENT_VERSION, SERVER_VERSION, INITIATE, PROVIDE_REFUND, RETURN_REFUND, PROVIDE_CONTRACT, CHANNEL_OPEN, UPDATE_PAYMENT, CLOSE, ERROR, - }; - + + private static final MessageType[] VALUES = values(); + public static MessageType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -164,133 +556,235 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private MessageType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:paymentchannels.TwoWayChannelMessage.MessageType) } - + private int bitField0_; // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; public static final int TYPE_FIELD_NUMBER = 1; private org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType type_; + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ */ public boolean hasType() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+     * This is required so if a new message type is added in future, old software aborts trying
+     * to read the message as early as possible. If the message doesn't parse, the socket should
+     * be closed.
+     * 
+ */ public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() { return type_; } - + // optional .paymentchannels.ClientVersion client_version = 2; public static final int CLIENT_VERSION_FIELD_NUMBER = 2; private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_; + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ */ public boolean hasClientVersion() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ */ public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() { return clientVersion_; } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+     * Now one optional field for each message. Only the field specified by type should be read.
+     * 
+ */ public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() { return clientVersion_; } - + // optional .paymentchannels.ServerVersion server_version = 3; public static final int SERVER_VERSION_FIELD_NUMBER = 3; private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_; + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public boolean hasServerVersion() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() { return serverVersion_; } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() { return serverVersion_; } - + // optional .paymentchannels.Initiate initiate = 4; public static final int INITIATE_FIELD_NUMBER = 4; private org.bitcoin.paymentchannel.Protos.Initiate initiate_; + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public boolean hasInitiate() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() { return initiate_; } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() { return initiate_; } - + // optional .paymentchannels.ProvideRefund provide_refund = 5; public static final int PROVIDE_REFUND_FIELD_NUMBER = 5; private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_; + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public boolean hasProvideRefund() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() { return provideRefund_; } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() { return provideRefund_; } - + // optional .paymentchannels.ReturnRefund return_refund = 6; public static final int RETURN_REFUND_FIELD_NUMBER = 6; private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_; + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public boolean hasReturnRefund() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() { return returnRefund_; } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() { return returnRefund_; } - + // optional .paymentchannels.ProvideContract provide_contract = 7; public static final int PROVIDE_CONTRACT_FIELD_NUMBER = 7; private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_; + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public boolean hasProvideContract() { return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() { return provideContract_; } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() { return provideContract_; } - + // optional .paymentchannels.UpdatePayment update_payment = 8; public static final int UPDATE_PAYMENT_FIELD_NUMBER = 8; private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_; + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public boolean hasUpdatePayment() { return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() { return updatePayment_; } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() { return updatePayment_; } - + // optional .paymentchannels.Error error = 10; public static final int ERROR_FIELD_NUMBER = 10; private org.bitcoin.paymentchannel.Protos.Error error_; + /** + * optional .paymentchannels.Error error = 10; + */ public boolean hasError() { return ((bitField0_ & 0x00000100) == 0x00000100); } + /** + * optional .paymentchannels.Error error = 10; + */ public org.bitcoin.paymentchannel.Protos.Error getError() { return error_; } + /** + * optional .paymentchannels.Error error = 10; + */ public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() { return error_; } - + private void initFields() { type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION; clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance(); @@ -306,7 +800,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasType()) { memoizedIsInitialized = 0; return false; @@ -356,7 +850,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -389,12 +883,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -436,94 +930,89 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.TwoWayChannelMessage} + * + *
+     * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
+     * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
+     * and "secondary" as "server".
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoin.paymentchannel.Protos.TwoWayChannelMessageOrBuilder { @@ -531,18 +1020,21 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class); } - + // Construct using org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -561,7 +1053,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION; @@ -616,20 +1108,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000100); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDescriptor(); + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor; } - + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage getDefaultInstanceForType() { return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance(); } - + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage build() { org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = buildPartial(); if (!result.isInitialized()) { @@ -637,17 +1129,7 @@ public final class Protos { } return result; } - - private org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage buildPartial() { org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = new org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage(this); int from_bitField0_ = bitField0_; @@ -724,7 +1206,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) { return mergeFrom((org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage)other); @@ -733,7 +1215,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage other) { if (other == org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance()) return this; if (other.hasType()) { @@ -766,7 +1248,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasType()) { @@ -816,127 +1298,61 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(1, rawValue); - } else { - bitField0_ |= 0x00000001; - type_ = value; - } - break; - } - case 18: { - org.bitcoin.paymentchannel.Protos.ClientVersion.Builder subBuilder = org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder(); - if (hasClientVersion()) { - subBuilder.mergeFrom(getClientVersion()); - } - input.readMessage(subBuilder, extensionRegistry); - setClientVersion(subBuilder.buildPartial()); - break; - } - case 26: { - org.bitcoin.paymentchannel.Protos.ServerVersion.Builder subBuilder = org.bitcoin.paymentchannel.Protos.ServerVersion.newBuilder(); - if (hasServerVersion()) { - subBuilder.mergeFrom(getServerVersion()); - } - input.readMessage(subBuilder, extensionRegistry); - setServerVersion(subBuilder.buildPartial()); - break; - } - case 34: { - org.bitcoin.paymentchannel.Protos.Initiate.Builder subBuilder = org.bitcoin.paymentchannel.Protos.Initiate.newBuilder(); - if (hasInitiate()) { - subBuilder.mergeFrom(getInitiate()); - } - input.readMessage(subBuilder, extensionRegistry); - setInitiate(subBuilder.buildPartial()); - break; - } - case 42: { - org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder subBuilder = org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder(); - if (hasProvideRefund()) { - subBuilder.mergeFrom(getProvideRefund()); - } - input.readMessage(subBuilder, extensionRegistry); - setProvideRefund(subBuilder.buildPartial()); - break; - } - case 50: { - org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder subBuilder = org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder(); - if (hasReturnRefund()) { - subBuilder.mergeFrom(getReturnRefund()); - } - input.readMessage(subBuilder, extensionRegistry); - setReturnRefund(subBuilder.buildPartial()); - break; - } - case 58: { - org.bitcoin.paymentchannel.Protos.ProvideContract.Builder subBuilder = org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder(); - if (hasProvideContract()) { - subBuilder.mergeFrom(getProvideContract()); - } - input.readMessage(subBuilder, extensionRegistry); - setProvideContract(subBuilder.buildPartial()); - break; - } - case 66: { - org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder(); - if (hasUpdatePayment()) { - subBuilder.mergeFrom(getUpdatePayment()); - } - input.readMessage(subBuilder, extensionRegistry); - setUpdatePayment(subBuilder.buildPartial()); - break; - } - case 82: { - org.bitcoin.paymentchannel.Protos.Error.Builder subBuilder = org.bitcoin.paymentchannel.Protos.Error.newBuilder(); - if (hasError()) { - subBuilder.mergeFrom(getError()); - } - input.readMessage(subBuilder, extensionRegistry); - setError(subBuilder.buildPartial()); - break; - } + org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; private org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION; + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ */ public boolean hasType() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ */ public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() { return type_; } + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ */ public Builder setType(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value) { if (value == null) { throw new NullPointerException(); @@ -946,20 +1362,43 @@ public final class Protos { onChanged(); return this; } + /** + * required .paymentchannels.TwoWayChannelMessage.MessageType type = 1; + * + *
+       * This is required so if a new message type is added in future, old software aborts trying
+       * to read the message as early as possible. If the message doesn't parse, the socket should
+       * be closed.
+       * 
+ */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION; onChanged(); return this; } - + // optional .paymentchannels.ClientVersion client_version = 2; private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder> clientVersionBuilder_; + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public boolean hasClientVersion() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() { if (clientVersionBuilder_ == null) { return clientVersion_; @@ -967,6 +1406,13 @@ public final class Protos { return clientVersionBuilder_.getMessage(); } } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public Builder setClientVersion(org.bitcoin.paymentchannel.Protos.ClientVersion value) { if (clientVersionBuilder_ == null) { if (value == null) { @@ -980,6 +1426,13 @@ public final class Protos { bitField0_ |= 0x00000002; return this; } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public Builder setClientVersion( org.bitcoin.paymentchannel.Protos.ClientVersion.Builder builderForValue) { if (clientVersionBuilder_ == null) { @@ -991,6 +1444,13 @@ public final class Protos { bitField0_ |= 0x00000002; return this; } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public Builder mergeClientVersion(org.bitcoin.paymentchannel.Protos.ClientVersion value) { if (clientVersionBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002) && @@ -1007,6 +1467,13 @@ public final class Protos { bitField0_ |= 0x00000002; return this; } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public Builder clearClientVersion() { if (clientVersionBuilder_ == null) { clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance(); @@ -1017,11 +1484,25 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000002); return this; } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public org.bitcoin.paymentchannel.Protos.ClientVersion.Builder getClientVersionBuilder() { bitField0_ |= 0x00000002; onChanged(); return getClientVersionFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() { if (clientVersionBuilder_ != null) { return clientVersionBuilder_.getMessageOrBuilder(); @@ -1029,6 +1510,13 @@ public final class Protos { return clientVersion_; } } + /** + * optional .paymentchannels.ClientVersion client_version = 2; + * + *
+       * Now one optional field for each message. Only the field specified by type should be read.
+       * 
+ */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder> getClientVersionFieldBuilder() { @@ -1042,14 +1530,20 @@ public final class Protos { } return clientVersionBuilder_; } - + // optional .paymentchannels.ServerVersion server_version = 3; private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder> serverVersionBuilder_; + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public boolean hasServerVersion() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() { if (serverVersionBuilder_ == null) { return serverVersion_; @@ -1057,6 +1551,9 @@ public final class Protos { return serverVersionBuilder_.getMessage(); } } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public Builder setServerVersion(org.bitcoin.paymentchannel.Protos.ServerVersion value) { if (serverVersionBuilder_ == null) { if (value == null) { @@ -1070,6 +1567,9 @@ public final class Protos { bitField0_ |= 0x00000004; return this; } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public Builder setServerVersion( org.bitcoin.paymentchannel.Protos.ServerVersion.Builder builderForValue) { if (serverVersionBuilder_ == null) { @@ -1081,6 +1581,9 @@ public final class Protos { bitField0_ |= 0x00000004; return this; } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public Builder mergeServerVersion(org.bitcoin.paymentchannel.Protos.ServerVersion value) { if (serverVersionBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && @@ -1097,6 +1600,9 @@ public final class Protos { bitField0_ |= 0x00000004; return this; } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public Builder clearServerVersion() { if (serverVersionBuilder_ == null) { serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance(); @@ -1107,11 +1613,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000004); return this; } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public org.bitcoin.paymentchannel.Protos.ServerVersion.Builder getServerVersionBuilder() { bitField0_ |= 0x00000004; onChanged(); return getServerVersionFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() { if (serverVersionBuilder_ != null) { return serverVersionBuilder_.getMessageOrBuilder(); @@ -1119,6 +1631,9 @@ public final class Protos { return serverVersion_; } } + /** + * optional .paymentchannels.ServerVersion server_version = 3; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder> getServerVersionFieldBuilder() { @@ -1132,14 +1647,20 @@ public final class Protos { } return serverVersionBuilder_; } - + // optional .paymentchannels.Initiate initiate = 4; private org.bitcoin.paymentchannel.Protos.Initiate initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder> initiateBuilder_; + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public boolean hasInitiate() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() { if (initiateBuilder_ == null) { return initiate_; @@ -1147,6 +1668,9 @@ public final class Protos { return initiateBuilder_.getMessage(); } } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public Builder setInitiate(org.bitcoin.paymentchannel.Protos.Initiate value) { if (initiateBuilder_ == null) { if (value == null) { @@ -1160,6 +1684,9 @@ public final class Protos { bitField0_ |= 0x00000008; return this; } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public Builder setInitiate( org.bitcoin.paymentchannel.Protos.Initiate.Builder builderForValue) { if (initiateBuilder_ == null) { @@ -1171,6 +1698,9 @@ public final class Protos { bitField0_ |= 0x00000008; return this; } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public Builder mergeInitiate(org.bitcoin.paymentchannel.Protos.Initiate value) { if (initiateBuilder_ == null) { if (((bitField0_ & 0x00000008) == 0x00000008) && @@ -1187,6 +1717,9 @@ public final class Protos { bitField0_ |= 0x00000008; return this; } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public Builder clearInitiate() { if (initiateBuilder_ == null) { initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance(); @@ -1197,11 +1730,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000008); return this; } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public org.bitcoin.paymentchannel.Protos.Initiate.Builder getInitiateBuilder() { bitField0_ |= 0x00000008; onChanged(); return getInitiateFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() { if (initiateBuilder_ != null) { return initiateBuilder_.getMessageOrBuilder(); @@ -1209,6 +1748,9 @@ public final class Protos { return initiate_; } } + /** + * optional .paymentchannels.Initiate initiate = 4; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder> getInitiateFieldBuilder() { @@ -1222,14 +1764,20 @@ public final class Protos { } return initiateBuilder_; } - + // optional .paymentchannels.ProvideRefund provide_refund = 5; private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder> provideRefundBuilder_; + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public boolean hasProvideRefund() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() { if (provideRefundBuilder_ == null) { return provideRefund_; @@ -1237,6 +1785,9 @@ public final class Protos { return provideRefundBuilder_.getMessage(); } } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public Builder setProvideRefund(org.bitcoin.paymentchannel.Protos.ProvideRefund value) { if (provideRefundBuilder_ == null) { if (value == null) { @@ -1250,6 +1801,9 @@ public final class Protos { bitField0_ |= 0x00000010; return this; } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public Builder setProvideRefund( org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder builderForValue) { if (provideRefundBuilder_ == null) { @@ -1261,6 +1815,9 @@ public final class Protos { bitField0_ |= 0x00000010; return this; } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public Builder mergeProvideRefund(org.bitcoin.paymentchannel.Protos.ProvideRefund value) { if (provideRefundBuilder_ == null) { if (((bitField0_ & 0x00000010) == 0x00000010) && @@ -1277,6 +1834,9 @@ public final class Protos { bitField0_ |= 0x00000010; return this; } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public Builder clearProvideRefund() { if (provideRefundBuilder_ == null) { provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance(); @@ -1287,11 +1847,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000010); return this; } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder getProvideRefundBuilder() { bitField0_ |= 0x00000010; onChanged(); return getProvideRefundFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() { if (provideRefundBuilder_ != null) { return provideRefundBuilder_.getMessageOrBuilder(); @@ -1299,6 +1865,9 @@ public final class Protos { return provideRefund_; } } + /** + * optional .paymentchannels.ProvideRefund provide_refund = 5; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder> getProvideRefundFieldBuilder() { @@ -1312,14 +1881,20 @@ public final class Protos { } return provideRefundBuilder_; } - + // optional .paymentchannels.ReturnRefund return_refund = 6; private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder> returnRefundBuilder_; + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public boolean hasReturnRefund() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() { if (returnRefundBuilder_ == null) { return returnRefund_; @@ -1327,6 +1902,9 @@ public final class Protos { return returnRefundBuilder_.getMessage(); } } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public Builder setReturnRefund(org.bitcoin.paymentchannel.Protos.ReturnRefund value) { if (returnRefundBuilder_ == null) { if (value == null) { @@ -1340,6 +1918,9 @@ public final class Protos { bitField0_ |= 0x00000020; return this; } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public Builder setReturnRefund( org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder builderForValue) { if (returnRefundBuilder_ == null) { @@ -1351,6 +1932,9 @@ public final class Protos { bitField0_ |= 0x00000020; return this; } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public Builder mergeReturnRefund(org.bitcoin.paymentchannel.Protos.ReturnRefund value) { if (returnRefundBuilder_ == null) { if (((bitField0_ & 0x00000020) == 0x00000020) && @@ -1367,6 +1951,9 @@ public final class Protos { bitField0_ |= 0x00000020; return this; } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public Builder clearReturnRefund() { if (returnRefundBuilder_ == null) { returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance(); @@ -1377,11 +1964,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000020); return this; } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder getReturnRefundBuilder() { bitField0_ |= 0x00000020; onChanged(); return getReturnRefundFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() { if (returnRefundBuilder_ != null) { return returnRefundBuilder_.getMessageOrBuilder(); @@ -1389,6 +1982,9 @@ public final class Protos { return returnRefund_; } } + /** + * optional .paymentchannels.ReturnRefund return_refund = 6; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder> getReturnRefundFieldBuilder() { @@ -1402,14 +1998,20 @@ public final class Protos { } return returnRefundBuilder_; } - + // optional .paymentchannels.ProvideContract provide_contract = 7; private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder> provideContractBuilder_; + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public boolean hasProvideContract() { return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() { if (provideContractBuilder_ == null) { return provideContract_; @@ -1417,6 +2019,9 @@ public final class Protos { return provideContractBuilder_.getMessage(); } } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public Builder setProvideContract(org.bitcoin.paymentchannel.Protos.ProvideContract value) { if (provideContractBuilder_ == null) { if (value == null) { @@ -1430,6 +2035,9 @@ public final class Protos { bitField0_ |= 0x00000040; return this; } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public Builder setProvideContract( org.bitcoin.paymentchannel.Protos.ProvideContract.Builder builderForValue) { if (provideContractBuilder_ == null) { @@ -1441,6 +2049,9 @@ public final class Protos { bitField0_ |= 0x00000040; return this; } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public Builder mergeProvideContract(org.bitcoin.paymentchannel.Protos.ProvideContract value) { if (provideContractBuilder_ == null) { if (((bitField0_ & 0x00000040) == 0x00000040) && @@ -1457,6 +2068,9 @@ public final class Protos { bitField0_ |= 0x00000040; return this; } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public Builder clearProvideContract() { if (provideContractBuilder_ == null) { provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance(); @@ -1467,11 +2081,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000040); return this; } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public org.bitcoin.paymentchannel.Protos.ProvideContract.Builder getProvideContractBuilder() { bitField0_ |= 0x00000040; onChanged(); return getProvideContractFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() { if (provideContractBuilder_ != null) { return provideContractBuilder_.getMessageOrBuilder(); @@ -1479,6 +2099,9 @@ public final class Protos { return provideContract_; } } + /** + * optional .paymentchannels.ProvideContract provide_contract = 7; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder> getProvideContractFieldBuilder() { @@ -1492,14 +2115,20 @@ public final class Protos { } return provideContractBuilder_; } - + // optional .paymentchannels.UpdatePayment update_payment = 8; private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> updatePaymentBuilder_; + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public boolean hasUpdatePayment() { return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() { if (updatePaymentBuilder_ == null) { return updatePayment_; @@ -1507,6 +2136,9 @@ public final class Protos { return updatePaymentBuilder_.getMessage(); } } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public Builder setUpdatePayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) { if (updatePaymentBuilder_ == null) { if (value == null) { @@ -1520,6 +2152,9 @@ public final class Protos { bitField0_ |= 0x00000080; return this; } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public Builder setUpdatePayment( org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder builderForValue) { if (updatePaymentBuilder_ == null) { @@ -1531,6 +2166,9 @@ public final class Protos { bitField0_ |= 0x00000080; return this; } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public Builder mergeUpdatePayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) { if (updatePaymentBuilder_ == null) { if (((bitField0_ & 0x00000080) == 0x00000080) && @@ -1547,6 +2185,9 @@ public final class Protos { bitField0_ |= 0x00000080; return this; } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public Builder clearUpdatePayment() { if (updatePaymentBuilder_ == null) { updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance(); @@ -1557,11 +2198,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000080); return this; } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder getUpdatePaymentBuilder() { bitField0_ |= 0x00000080; onChanged(); return getUpdatePaymentFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() { if (updatePaymentBuilder_ != null) { return updatePaymentBuilder_.getMessageOrBuilder(); @@ -1569,6 +2216,9 @@ public final class Protos { return updatePayment_; } } + /** + * optional .paymentchannels.UpdatePayment update_payment = 8; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> getUpdatePaymentFieldBuilder() { @@ -1582,14 +2232,20 @@ public final class Protos { } return updatePaymentBuilder_; } - + // optional .paymentchannels.Error error = 10; private org.bitcoin.paymentchannel.Protos.Error error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder> errorBuilder_; + /** + * optional .paymentchannels.Error error = 10; + */ public boolean hasError() { return ((bitField0_ & 0x00000100) == 0x00000100); } + /** + * optional .paymentchannels.Error error = 10; + */ public org.bitcoin.paymentchannel.Protos.Error getError() { if (errorBuilder_ == null) { return error_; @@ -1597,6 +2253,9 @@ public final class Protos { return errorBuilder_.getMessage(); } } + /** + * optional .paymentchannels.Error error = 10; + */ public Builder setError(org.bitcoin.paymentchannel.Protos.Error value) { if (errorBuilder_ == null) { if (value == null) { @@ -1610,6 +2269,9 @@ public final class Protos { bitField0_ |= 0x00000100; return this; } + /** + * optional .paymentchannels.Error error = 10; + */ public Builder setError( org.bitcoin.paymentchannel.Protos.Error.Builder builderForValue) { if (errorBuilder_ == null) { @@ -1621,6 +2283,9 @@ public final class Protos { bitField0_ |= 0x00000100; return this; } + /** + * optional .paymentchannels.Error error = 10; + */ public Builder mergeError(org.bitcoin.paymentchannel.Protos.Error value) { if (errorBuilder_ == null) { if (((bitField0_ & 0x00000100) == 0x00000100) && @@ -1637,6 +2302,9 @@ public final class Protos { bitField0_ |= 0x00000100; return this; } + /** + * optional .paymentchannels.Error error = 10; + */ public Builder clearError() { if (errorBuilder_ == null) { error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance(); @@ -1647,11 +2315,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000100); return this; } + /** + * optional .paymentchannels.Error error = 10; + */ public org.bitcoin.paymentchannel.Protos.Error.Builder getErrorBuilder() { bitField0_ |= 0x00000100; onChanged(); return getErrorFieldBuilder().getBuilder(); } + /** + * optional .paymentchannels.Error error = 10; + */ public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() { if (errorBuilder_ != null) { return errorBuilder_.getMessageOrBuilder(); @@ -1659,6 +2333,9 @@ public final class Protos { return error_; } } + /** + * optional .paymentchannels.Error error = 10; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder> getErrorFieldBuilder() { @@ -1672,380 +2349,118 @@ public final class Protos { } return errorBuilder_; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.TwoWayChannelMessage) } - + static { defaultInstance = new TwoWayChannelMessage(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.TwoWayChannelMessage) } - + public interface ClientVersionOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required int32 major = 1; + /** + * required int32 major = 1; + */ boolean hasMajor(); + /** + * required int32 major = 1; + */ int getMajor(); - + // optional int32 minor = 2 [default = 0]; + /** + * optional int32 minor = 2 [default = 0]; + */ boolean hasMinor(); + /** + * optional int32 minor = 2 [default = 0]; + */ int getMinor(); - + // optional bytes previous_channel_contract_hash = 3; + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ */ boolean hasPreviousChannelContractHash(); + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ */ com.google.protobuf.ByteString getPreviousChannelContractHash(); } + /** + * Protobuf type {@code paymentchannels.ClientVersion} + * + *
+   * Sent by primary to secondary on opening the connection. If anything is received before this is
+   * sent, the socket is closed.
+   * 
+ */ public static final class ClientVersion extends com.google.protobuf.GeneratedMessage implements ClientVersionOrBuilder { // Use ClientVersion.newBuilder() to construct. - private ClientVersion(Builder builder) { + private ClientVersion(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private ClientVersion(boolean noInit) {} - + private ClientVersion(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final ClientVersion defaultInstance; public static ClientVersion getDefaultInstance() { return defaultInstance; } - + public ClientVersion getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable; - } - - private int bitField0_; - // required int32 major = 1; - public static final int MAJOR_FIELD_NUMBER = 1; - private int major_; - public boolean hasMajor() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public int getMajor() { - return major_; - } - - // optional int32 minor = 2 [default = 0]; - public static final int MINOR_FIELD_NUMBER = 2; - private int minor_; - public boolean hasMinor() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getMinor() { - return minor_; - } - - // optional bytes previous_channel_contract_hash = 3; - public static final int PREVIOUS_CHANNEL_CONTRACT_HASH_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString previousChannelContractHash_; - public boolean hasPreviousChannelContractHash() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public com.google.protobuf.ByteString getPreviousChannelContractHash() { - return previousChannelContractHash_; - } - - private void initFields() { - major_ = 0; - minor_ = 0; - previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasMajor()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, major_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt32(2, minor_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, previousChannelContractHash_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(1, major_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(2, minor_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, previousChannelContractHash_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + private ClientVersion( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ClientVersion prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable; - } - - // Construct using org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - major_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); - minor_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.ClientVersion.getDescriptor(); - } - - public org.bitcoin.paymentchannel.Protos.ClientVersion getDefaultInstanceForType() { - return org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance(); - } - - public org.bitcoin.paymentchannel.Protos.ClientVersion build() { - org.bitcoin.paymentchannel.Protos.ClientVersion result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private org.bitcoin.paymentchannel.Protos.ClientVersion buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.ClientVersion result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoin.paymentchannel.Protos.ClientVersion buildPartial() { - org.bitcoin.paymentchannel.Protos.ClientVersion result = new org.bitcoin.paymentchannel.Protos.ClientVersion(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.major_ = major_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.minor_ = minor_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.previousChannelContractHash_ = previousChannelContractHash_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoin.paymentchannel.Protos.ClientVersion) { - return mergeFrom((org.bitcoin.paymentchannel.Protos.ClientVersion)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ClientVersion other) { - if (other == org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance()) return this; - if (other.hasMajor()) { - setMajor(other.getMajor()); - } - if (other.hasMinor()) { - setMinor(other.getMinor()); - } - if (other.hasPreviousChannelContractHash()) { - setPreviousChannelContractHash(other.getPreviousChannelContractHash()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasMajor()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -2066,60 +2481,484 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ClientVersion.class, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ClientVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ClientVersion(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required int32 major = 1; + public static final int MAJOR_FIELD_NUMBER = 1; + private int major_; + /** + * required int32 major = 1; + */ + public boolean hasMajor() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int32 major = 1; + */ + public int getMajor() { + return major_; + } + + // optional int32 minor = 2 [default = 0]; + public static final int MINOR_FIELD_NUMBER = 2; + private int minor_; + /** + * optional int32 minor = 2 [default = 0]; + */ + public boolean hasMinor() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int32 minor = 2 [default = 0]; + */ + public int getMinor() { + return minor_; + } + + // optional bytes previous_channel_contract_hash = 3; + public static final int PREVIOUS_CHANNEL_CONTRACT_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString previousChannelContractHash_; + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ */ + public boolean hasPreviousChannelContractHash() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+     * The hash of the multisig contract of a previous channel. This indicates that the primary
+     * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+     * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+     * follows SERVER_VERSION with an Initiate representing a new channel
+     * 
+ */ + public com.google.protobuf.ByteString getPreviousChannelContractHash() { + return previousChannelContractHash_; + } + + private void initFields() { + major_ = 0; + minor_ = 0; + previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasMajor()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, major_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeInt32(2, minor_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, previousChannelContractHash_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, major_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, minor_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, previousChannelContractHash_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ClientVersion prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code paymentchannels.ClientVersion} + * + *
+     * Sent by primary to secondary on opening the connection. If anything is received before this is
+     * sent, the socket is closed.
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ClientVersion.class, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + major_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + minor_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion build() { + org.bitcoin.paymentchannel.Protos.ClientVersion result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.ClientVersion buildPartial() { + org.bitcoin.paymentchannel.Protos.ClientVersion result = new org.bitcoin.paymentchannel.Protos.ClientVersion(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.major_ = major_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.minor_ = minor_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.previousChannelContractHash_ = previousChannelContractHash_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.ClientVersion) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.ClientVersion)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ClientVersion other) { + if (other == org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance()) return this; + if (other.hasMajor()) { + setMajor(other.getMajor()); + } + if (other.hasMinor()) { + setMinor(other.getMinor()); + } + if (other.hasPreviousChannelContractHash()) { + setPreviousChannelContractHash(other.getPreviousChannelContractHash()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasMajor()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.ClientVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ClientVersion) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // required int32 major = 1; private int major_ ; + /** + * required int32 major = 1; + */ public boolean hasMajor() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int32 major = 1; + */ public int getMajor() { return major_; } + /** + * required int32 major = 1; + */ public Builder setMajor(int value) { bitField0_ |= 0x00000001; major_ = value; onChanged(); return this; } + /** + * required int32 major = 1; + */ public Builder clearMajor() { bitField0_ = (bitField0_ & ~0x00000001); major_ = 0; onChanged(); return this; } - + // optional int32 minor = 2 [default = 0]; private int minor_ ; + /** + * optional int32 minor = 2 [default = 0]; + */ public boolean hasMinor() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional int32 minor = 2 [default = 0]; + */ public int getMinor() { return minor_; } + /** + * optional int32 minor = 2 [default = 0]; + */ public Builder setMinor(int value) { bitField0_ |= 0x00000002; minor_ = value; onChanged(); return this; } + /** + * optional int32 minor = 2 [default = 0]; + */ public Builder clearMinor() { bitField0_ = (bitField0_ & ~0x00000002); minor_ = 0; onChanged(); return this; } - + // optional bytes previous_channel_contract_hash = 3; private com.google.protobuf.ByteString previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ */ public boolean hasPreviousChannelContractHash() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ */ public com.google.protobuf.ByteString getPreviousChannelContractHash() { return previousChannelContractHash_; } + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ */ public Builder setPreviousChannelContractHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -2129,84 +2968,200 @@ public final class Protos { onChanged(); return this; } + /** + * optional bytes previous_channel_contract_hash = 3; + * + *
+       * The hash of the multisig contract of a previous channel. This indicates that the primary
+       * wishes to reopen the given channel. If the server is willing to reopen it, it simply
+       * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
+       * follows SERVER_VERSION with an Initiate representing a new channel
+       * 
+ */ public Builder clearPreviousChannelContractHash() { bitField0_ = (bitField0_ & ~0x00000004); previousChannelContractHash_ = getDefaultInstance().getPreviousChannelContractHash(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.ClientVersion) } - + static { defaultInstance = new ClientVersion(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.ClientVersion) } - + public interface ServerVersionOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required int32 major = 1; + /** + * required int32 major = 1; + */ boolean hasMajor(); + /** + * required int32 major = 1; + */ int getMajor(); - + // optional int32 minor = 2 [default = 0]; + /** + * optional int32 minor = 2 [default = 0]; + */ boolean hasMinor(); + /** + * optional int32 minor = 2 [default = 0]; + */ int getMinor(); } + /** + * Protobuf type {@code paymentchannels.ServerVersion} + * + *
+   * Send by secondary to primary upon receiving the ClientVersion message. If it is willing to
+   * speak the given major version, it sends back the same major version and the minor version it
+   * speaks. If it is not, it may send back a lower major version representing the highest version
+   * it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a
+   * lower major version, the secondary should either expect to continue with that version, or
+   * should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards
+   * incompatible changes to the protocol bump the major version. Extensions bump the minor version
+   * 
+ */ public static final class ServerVersion extends com.google.protobuf.GeneratedMessage implements ServerVersionOrBuilder { // Use ServerVersion.newBuilder() to construct. - private ServerVersion(Builder builder) { + private ServerVersion(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private ServerVersion(boolean noInit) {} - + private ServerVersion(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final ServerVersion defaultInstance; public static ServerVersion getDefaultInstance() { return defaultInstance; } - + public ServerVersion getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ServerVersion( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + major_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + minor_ = input.readInt32(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ServerVersion.class, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ServerVersion parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ServerVersion(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; // required int32 major = 1; public static final int MAJOR_FIELD_NUMBER = 1; private int major_; + /** + * required int32 major = 1; + */ public boolean hasMajor() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int32 major = 1; + */ public int getMajor() { return major_; } - + // optional int32 minor = 2 [default = 0]; public static final int MINOR_FIELD_NUMBER = 2; private int minor_; + /** + * optional int32 minor = 2 [default = 0]; + */ public boolean hasMinor() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional int32 minor = 2 [default = 0]; + */ public int getMinor() { return minor_; } - + private void initFields() { major_ = 0; minor_ = 0; @@ -2215,7 +3170,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasMajor()) { memoizedIsInitialized = 0; return false; @@ -2223,7 +3178,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -2235,12 +3190,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -2254,94 +3209,93 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ServerVersion prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.ServerVersion} + * + *
+     * Send by secondary to primary upon receiving the ClientVersion message. If it is willing to
+     * speak the given major version, it sends back the same major version and the minor version it
+     * speaks. If it is not, it may send back a lower major version representing the highest version
+     * it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a
+     * lower major version, the secondary should either expect to continue with that version, or
+     * should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards
+     * incompatible changes to the protocol bump the major version. Extensions bump the minor version
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder { @@ -2349,18 +3303,21 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ServerVersion.class, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class); } - + // Construct using org.bitcoin.paymentchannel.Protos.ServerVersion.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -2371,7 +3328,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); major_ = 0; @@ -2380,20 +3337,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.ServerVersion.getDescriptor(); + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor; } - + public org.bitcoin.paymentchannel.Protos.ServerVersion getDefaultInstanceForType() { return org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance(); } - + public org.bitcoin.paymentchannel.Protos.ServerVersion build() { org.bitcoin.paymentchannel.Protos.ServerVersion result = buildPartial(); if (!result.isInitialized()) { @@ -2401,17 +3358,7 @@ public final class Protos { } return result; } - - private org.bitcoin.paymentchannel.Protos.ServerVersion buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.ServerVersion result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoin.paymentchannel.Protos.ServerVersion buildPartial() { org.bitcoin.paymentchannel.Protos.ServerVersion result = new org.bitcoin.paymentchannel.Protos.ServerVersion(this); int from_bitField0_ = bitField0_; @@ -2428,7 +3375,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoin.paymentchannel.Protos.ServerVersion) { return mergeFrom((org.bitcoin.paymentchannel.Protos.ServerVersion)other); @@ -2437,7 +3384,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ServerVersion other) { if (other == org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance()) return this; if (other.hasMajor()) { @@ -2449,7 +3396,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasMajor()) { @@ -2457,477 +3404,234 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - major_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - minor_ = input.readInt32(); - break; - } + org.bitcoin.paymentchannel.Protos.ServerVersion parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ServerVersion) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required int32 major = 1; private int major_ ; + /** + * required int32 major = 1; + */ public boolean hasMajor() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int32 major = 1; + */ public int getMajor() { return major_; } + /** + * required int32 major = 1; + */ public Builder setMajor(int value) { bitField0_ |= 0x00000001; major_ = value; onChanged(); return this; } + /** + * required int32 major = 1; + */ public Builder clearMajor() { bitField0_ = (bitField0_ & ~0x00000001); major_ = 0; onChanged(); return this; } - + // optional int32 minor = 2 [default = 0]; private int minor_ ; + /** + * optional int32 minor = 2 [default = 0]; + */ public boolean hasMinor() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional int32 minor = 2 [default = 0]; + */ public int getMinor() { return minor_; } + /** + * optional int32 minor = 2 [default = 0]; + */ public Builder setMinor(int value) { bitField0_ |= 0x00000002; minor_ = value; onChanged(); return this; } + /** + * optional int32 minor = 2 [default = 0]; + */ public Builder clearMinor() { bitField0_ = (bitField0_ & ~0x00000002); minor_ = 0; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.ServerVersion) } - + static { defaultInstance = new ServerVersion(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.ServerVersion) } - + public interface InitiateOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes multisig_key = 1; + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ */ boolean hasMultisigKey(); + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ */ com.google.protobuf.ByteString getMultisigKey(); - + // required uint64 min_accepted_channel_size = 2; + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ */ boolean hasMinAcceptedChannelSize(); + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ */ long getMinAcceptedChannelSize(); - + // required uint64 expire_time_secs = 3; + /** + * required uint64 expire_time_secs = 3; + * + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust secondary? Probably opens up
+     * attack vectors. We can assume primary has an independent clock, however. If primary
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ */ boolean hasExpireTimeSecs(); + /** + * required uint64 expire_time_secs = 3; + * + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust secondary? Probably opens up
+     * attack vectors. We can assume primary has an independent clock, however. If primary
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ */ long getExpireTimeSecs(); } + /** + * Protobuf type {@code paymentchannels.Initiate} + * + *
+   * Sent from secondary to primary once version nego is done.
+   * 
+ */ public static final class Initiate extends com.google.protobuf.GeneratedMessage implements InitiateOrBuilder { // Use Initiate.newBuilder() to construct. - private Initiate(Builder builder) { + private Initiate(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Initiate(boolean noInit) {} - + private Initiate(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final Initiate defaultInstance; public static Initiate getDefaultInstance() { return defaultInstance; } - + public Initiate getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable; - } - - private int bitField0_; - // required bytes multisig_key = 1; - public static final int MULTISIG_KEY_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString multisigKey_; - public boolean hasMultisigKey() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getMultisigKey() { - return multisigKey_; - } - - // required uint64 min_accepted_channel_size = 2; - public static final int MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER = 2; - private long minAcceptedChannelSize_; - public boolean hasMinAcceptedChannelSize() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public long getMinAcceptedChannelSize() { - return minAcceptedChannelSize_; - } - - // required uint64 expire_time_secs = 3; - public static final int EXPIRE_TIME_SECS_FIELD_NUMBER = 3; - private long expireTimeSecs_; - public boolean hasExpireTimeSecs() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public long getExpireTimeSecs() { - return expireTimeSecs_; - } - - private void initFields() { - multisigKey_ = com.google.protobuf.ByteString.EMPTY; - minAcceptedChannelSize_ = 0L; - expireTimeSecs_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasMultisigKey()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasMinAcceptedChannelSize()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasExpireTimeSecs()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, multisigKey_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeUInt64(2, minAcceptedChannelSize_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeUInt64(3, expireTimeSecs_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, multisigKey_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, minAcceptedChannelSize_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, expireTimeSecs_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + private Initiate( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Initiate prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoin.paymentchannel.Protos.InitiateOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable; - } - - // Construct using org.bitcoin.paymentchannel.Protos.Initiate.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - multisigKey_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - minAcceptedChannelSize_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - expireTimeSecs_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.Initiate.getDescriptor(); - } - - public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() { - return org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance(); - } - - public org.bitcoin.paymentchannel.Protos.Initiate build() { - org.bitcoin.paymentchannel.Protos.Initiate result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private org.bitcoin.paymentchannel.Protos.Initiate buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.Initiate result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoin.paymentchannel.Protos.Initiate buildPartial() { - org.bitcoin.paymentchannel.Protos.Initiate result = new org.bitcoin.paymentchannel.Protos.Initiate(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.multisigKey_ = multisigKey_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.minAcceptedChannelSize_ = minAcceptedChannelSize_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.expireTimeSecs_ = expireTimeSecs_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoin.paymentchannel.Protos.Initiate) { - return mergeFrom((org.bitcoin.paymentchannel.Protos.Initiate)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Initiate other) { - if (other == org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) return this; - if (other.hasMultisigKey()) { - setMultisigKey(other.getMultisigKey()); - } - if (other.hasMinAcceptedChannelSize()) { - setMinAcceptedChannelSize(other.getMinAcceptedChannelSize()); - } - if (other.hasExpireTimeSecs()) { - setExpireTimeSecs(other.getExpireTimeSecs()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasMultisigKey()) { - - return false; - } - if (!hasMinAcceptedChannelSize()) { - - return false; - } - if (!hasExpireTimeSecs()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -2948,18 +3652,462 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Initiate parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Initiate(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bytes multisig_key = 1; + public static final int MULTISIG_KEY_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString multisigKey_; + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ */ + public boolean hasMultisigKey() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted. It is used only in the creation of the multisig contract, as outputs are
+     * created entirely by the secondary
+     * 
+ */ + public com.google.protobuf.ByteString getMultisigKey() { + return multisigKey_; + } + + // required uint64 min_accepted_channel_size = 2; + public static final int MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER = 2; + private long minAcceptedChannelSize_; + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ */ + public boolean hasMinAcceptedChannelSize() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+     * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+     * size it's willing to accept here. This can be lower to trade off resources against
+     * security but shouldn't be so low the transactions get rejected by the network as spam.
+     * Zero isn't a sensible value to have here, so we make the field required.
+     * 
+ */ + public long getMinAcceptedChannelSize() { + return minAcceptedChannelSize_; + } + + // required uint64 expire_time_secs = 3; + public static final int EXPIRE_TIME_SECS_FIELD_NUMBER = 3; + private long expireTimeSecs_; + /** + * required uint64 expire_time_secs = 3; + * + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust secondary? Probably opens up
+     * attack vectors. We can assume primary has an independent clock, however. If primary
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ */ + public boolean hasExpireTimeSecs() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 expire_time_secs = 3; + * + *
+     * Rough UNIX time for when the channel expires. This is determined by the block header
+     * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+     * Channels could also be specified in terms of block heights but then how do you know the
+     * current chain height if you don't have internet access? Trust secondary? Probably opens up
+     * attack vectors. We can assume primary has an independent clock, however. If primary
+     * considers this value too far off (eg more than a day), it may send an ERROR and close the
+     * channel.
+     * 
+ */ + public long getExpireTimeSecs() { + return expireTimeSecs_; + } + + private void initFields() { + multisigKey_ = com.google.protobuf.ByteString.EMPTY; + minAcceptedChannelSize_ = 0L; + expireTimeSecs_ = 0L; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasMultisigKey()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMinAcceptedChannelSize()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasExpireTimeSecs()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, multisigKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt64(2, minAcceptedChannelSize_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, expireTimeSecs_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, multisigKey_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(2, minAcceptedChannelSize_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, expireTimeSecs_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Initiate prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code paymentchannels.Initiate} + * + *
+     * Sent from secondary to primary once version nego is done.
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoin.paymentchannel.Protos.InitiateOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.Initiate.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + multisigKey_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + minAcceptedChannelSize_ = 0L; + bitField0_ = (bitField0_ & ~0x00000002); + expireTimeSecs_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.Initiate build() { + org.bitcoin.paymentchannel.Protos.Initiate result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.Initiate buildPartial() { + org.bitcoin.paymentchannel.Protos.Initiate result = new org.bitcoin.paymentchannel.Protos.Initiate(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.multisigKey_ = multisigKey_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.minAcceptedChannelSize_ = minAcceptedChannelSize_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.expireTimeSecs_ = expireTimeSecs_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.Initiate) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.Initiate)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Initiate other) { + if (other == org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) return this; + if (other.hasMultisigKey()) { + setMultisigKey(other.getMultisigKey()); + } + if (other.hasMinAcceptedChannelSize()) { + setMinAcceptedChannelSize(other.getMinAcceptedChannelSize()); + } + if (other.hasExpireTimeSecs()) { + setExpireTimeSecs(other.getExpireTimeSecs()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasMultisigKey()) { + + return false; + } + if (!hasMinAcceptedChannelSize()) { + + return false; + } + if (!hasExpireTimeSecs()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.Initiate parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.Initiate) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // required bytes multisig_key = 1; private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ */ public boolean hasMultisigKey() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ */ public com.google.protobuf.ByteString getMultisigKey() { return multisigKey_; } + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ */ public Builder setMultisigKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -2969,126 +4117,391 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted. It is used only in the creation of the multisig contract, as outputs are
+       * created entirely by the secondary
+       * 
+ */ public Builder clearMultisigKey() { bitField0_ = (bitField0_ & ~0x00000001); multisigKey_ = getDefaultInstance().getMultisigKey(); onChanged(); return this; } - + // required uint64 min_accepted_channel_size = 2; private long minAcceptedChannelSize_ ; + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ */ public boolean hasMinAcceptedChannelSize() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ */ public long getMinAcceptedChannelSize() { return minAcceptedChannelSize_; } + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ */ public Builder setMinAcceptedChannelSize(long value) { bitField0_ |= 0x00000002; minAcceptedChannelSize_ = value; onChanged(); return this; } + /** + * required uint64 min_accepted_channel_size = 2; + * + *
+       * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
+       * size it's willing to accept here. This can be lower to trade off resources against
+       * security but shouldn't be so low the transactions get rejected by the network as spam.
+       * Zero isn't a sensible value to have here, so we make the field required.
+       * 
+ */ public Builder clearMinAcceptedChannelSize() { bitField0_ = (bitField0_ & ~0x00000002); minAcceptedChannelSize_ = 0L; onChanged(); return this; } - + // required uint64 expire_time_secs = 3; private long expireTimeSecs_ ; + /** + * required uint64 expire_time_secs = 3; + * + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust secondary? Probably opens up
+       * attack vectors. We can assume primary has an independent clock, however. If primary
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ */ public boolean hasExpireTimeSecs() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required uint64 expire_time_secs = 3; + * + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust secondary? Probably opens up
+       * attack vectors. We can assume primary has an independent clock, however. If primary
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ */ public long getExpireTimeSecs() { return expireTimeSecs_; } + /** + * required uint64 expire_time_secs = 3; + * + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust secondary? Probably opens up
+       * attack vectors. We can assume primary has an independent clock, however. If primary
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ */ public Builder setExpireTimeSecs(long value) { bitField0_ |= 0x00000004; expireTimeSecs_ = value; onChanged(); return this; } + /** + * required uint64 expire_time_secs = 3; + * + *
+       * Rough UNIX time for when the channel expires. This is determined by the block header
+       * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
+       * Channels could also be specified in terms of block heights but then how do you know the
+       * current chain height if you don't have internet access? Trust secondary? Probably opens up
+       * attack vectors. We can assume primary has an independent clock, however. If primary
+       * considers this value too far off (eg more than a day), it may send an ERROR and close the
+       * channel.
+       * 
+ */ public Builder clearExpireTimeSecs() { bitField0_ = (bitField0_ & ~0x00000004); expireTimeSecs_ = 0L; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.Initiate) } - + static { defaultInstance = new Initiate(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.Initiate) } - + public interface ProvideRefundOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes multisig_key = 1; + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ */ boolean hasMultisigKey(); + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ */ com.google.protobuf.ByteString getMultisigKey(); - + // required bytes tx = 2; + /** + * required bytes tx = 2; + * + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ */ boolean hasTx(); + /** + * required bytes tx = 2; + * + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ */ com.google.protobuf.ByteString getTx(); } + /** + * Protobuf type {@code paymentchannels.ProvideRefund} + * + *
+   * Sent from primary to secondary after Initiate to begin the refund transaction signing.
+   * 
+ */ public static final class ProvideRefund extends com.google.protobuf.GeneratedMessage implements ProvideRefundOrBuilder { // Use ProvideRefund.newBuilder() to construct. - private ProvideRefund(Builder builder) { + private ProvideRefund(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private ProvideRefund(boolean noInit) {} - + private ProvideRefund(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final ProvideRefund defaultInstance; public static ProvideRefund getDefaultInstance() { return defaultInstance; } - + public ProvideRefund getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProvideRefund( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + multisigKey_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + tx_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ProvideRefund parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProvideRefund(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; // required bytes multisig_key = 1; public static final int MULTISIG_KEY_FIELD_NUMBER = 1; private com.google.protobuf.ByteString multisigKey_; + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ */ public boolean hasMultisigKey() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes multisig_key = 1; + * + *
+     * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+     * are accepted.  It is only used in the creation of the multisig contract.
+     * 
+ */ public com.google.protobuf.ByteString getMultisigKey() { return multisigKey_; } - + // required bytes tx = 2; public static final int TX_FIELD_NUMBER = 2; private com.google.protobuf.ByteString tx_; + /** + * required bytes tx = 2; + * + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ */ public boolean hasTx() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes tx = 2; + * + *
+     * The serialized bytes of the return transaction in Satoshi format.
+     * * It must have exactly one input which spends the multisig output (see ProvideContract for
+     *   details of exactly what that output must look like). This output must have a sequence
+     *   number of 0.
+     * * It must have the lock time set to a time after the min_time_window_secs (from the
+     *   Initiate message).
+     * * It must have exactly one output which goes back to the primary.  This output's
+     *   scriptPubKey will be reused to create payment transactions.
+     * 
+ */ public com.google.protobuf.ByteString getTx() { return tx_; } - + private void initFields() { multisigKey_ = com.google.protobuf.ByteString.EMPTY; tx_ = com.google.protobuf.ByteString.EMPTY; @@ -3097,7 +4510,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasMultisigKey()) { memoizedIsInitialized = 0; return false; @@ -3109,7 +4522,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -3121,12 +4534,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -3140,94 +4553,87 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideRefund prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.ProvideRefund} + * + *
+     * Sent from primary to secondary after Initiate to begin the refund transaction signing.
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder { @@ -3235,18 +4641,21 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class); } - + // Construct using org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3257,7 +4666,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); multisigKey_ = com.google.protobuf.ByteString.EMPTY; @@ -3266,20 +4675,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.ProvideRefund.getDescriptor(); + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor; } - + public org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstanceForType() { return org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance(); } - + public org.bitcoin.paymentchannel.Protos.ProvideRefund build() { org.bitcoin.paymentchannel.Protos.ProvideRefund result = buildPartial(); if (!result.isInitialized()) { @@ -3287,17 +4696,7 @@ public final class Protos { } return result; } - - private org.bitcoin.paymentchannel.Protos.ProvideRefund buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.ProvideRefund result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoin.paymentchannel.Protos.ProvideRefund buildPartial() { org.bitcoin.paymentchannel.Protos.ProvideRefund result = new org.bitcoin.paymentchannel.Protos.ProvideRefund(this); int from_bitField0_ = bitField0_; @@ -3314,7 +4713,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideRefund) { return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideRefund)other); @@ -3323,7 +4722,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideRefund other) { if (other == org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance()) return this; if (other.hasMultisigKey()) { @@ -3335,7 +4734,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasMultisigKey()) { @@ -3347,54 +4746,58 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - multisigKey_ = input.readBytes(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - tx_ = input.readBytes(); - break; - } + org.bitcoin.paymentchannel.Protos.ProvideRefund parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideRefund) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required bytes multisig_key = 1; private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ */ public boolean hasMultisigKey() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ */ public com.google.protobuf.ByteString getMultisigKey() { return multisigKey_; } + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ */ public Builder setMultisigKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -3404,21 +4807,71 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes multisig_key = 1; + * + *
+       * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
+       * are accepted.  It is only used in the creation of the multisig contract.
+       * 
+ */ public Builder clearMultisigKey() { bitField0_ = (bitField0_ & ~0x00000001); multisigKey_ = getDefaultInstance().getMultisigKey(); onChanged(); return this; } - + // required bytes tx = 2; private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes tx = 2; + * + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ */ public boolean hasTx() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes tx = 2; + * + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ */ public com.google.protobuf.ByteString getTx() { return tx_; } + /** + * required bytes tx = 2; + * + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ */ public Builder setTx(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -3428,70 +4881,171 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes tx = 2; + * + *
+       * The serialized bytes of the return transaction in Satoshi format.
+       * * It must have exactly one input which spends the multisig output (see ProvideContract for
+       *   details of exactly what that output must look like). This output must have a sequence
+       *   number of 0.
+       * * It must have the lock time set to a time after the min_time_window_secs (from the
+       *   Initiate message).
+       * * It must have exactly one output which goes back to the primary.  This output's
+       *   scriptPubKey will be reused to create payment transactions.
+       * 
+ */ public Builder clearTx() { bitField0_ = (bitField0_ & ~0x00000002); tx_ = getDefaultInstance().getTx(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideRefund) } - + static { defaultInstance = new ProvideRefund(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.ProvideRefund) } - + public interface ReturnRefundOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes signature = 1; + /** + * required bytes signature = 1; + */ boolean hasSignature(); + /** + * required bytes signature = 1; + */ com.google.protobuf.ByteString getSignature(); } + /** + * Protobuf type {@code paymentchannels.ReturnRefund} + * + *
+   * Sent from secondary to primary after it has done initial verification of the refund
+   * transaction. Contains the primary's signature which is required to spend the multisig contract
+   * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
+   * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
+   * input's sequence and transaction's nLockTime remain set.
+   * 
+ */ public static final class ReturnRefund extends com.google.protobuf.GeneratedMessage implements ReturnRefundOrBuilder { // Use ReturnRefund.newBuilder() to construct. - private ReturnRefund(Builder builder) { + private ReturnRefund(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private ReturnRefund(boolean noInit) {} - + private ReturnRefund(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final ReturnRefund defaultInstance; public static ReturnRefund getDefaultInstance() { return defaultInstance; } - + public ReturnRefund getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ReturnRefund( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + signature_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ReturnRefund parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReturnRefund(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; // required bytes signature = 1; public static final int SIGNATURE_FIELD_NUMBER = 1; private com.google.protobuf.ByteString signature_; + /** + * required bytes signature = 1; + */ public boolean hasSignature() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes signature = 1; + */ public com.google.protobuf.ByteString getSignature() { return signature_; } - + private void initFields() { signature_ = com.google.protobuf.ByteString.EMPTY; } @@ -3499,7 +5053,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasSignature()) { memoizedIsInitialized = 0; return false; @@ -3507,7 +5061,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -3516,12 +5070,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -3531,94 +5085,91 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ReturnRefund prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.ReturnRefund} + * + *
+     * Sent from secondary to primary after it has done initial verification of the refund
+     * transaction. Contains the primary's signature which is required to spend the multisig contract
+     * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
+     * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
+     * input's sequence and transaction's nLockTime remain set.
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder { @@ -3626,18 +5177,21 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class); } - + // Construct using org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3648,27 +5202,27 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); signature_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.ReturnRefund.getDescriptor(); + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor; } - + public org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstanceForType() { return org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance(); } - + public org.bitcoin.paymentchannel.Protos.ReturnRefund build() { org.bitcoin.paymentchannel.Protos.ReturnRefund result = buildPartial(); if (!result.isInitialized()) { @@ -3676,17 +5230,7 @@ public final class Protos { } return result; } - - private org.bitcoin.paymentchannel.Protos.ReturnRefund buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.ReturnRefund result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoin.paymentchannel.Protos.ReturnRefund buildPartial() { org.bitcoin.paymentchannel.Protos.ReturnRefund result = new org.bitcoin.paymentchannel.Protos.ReturnRefund(this); int from_bitField0_ = bitField0_; @@ -3699,7 +5243,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoin.paymentchannel.Protos.ReturnRefund) { return mergeFrom((org.bitcoin.paymentchannel.Protos.ReturnRefund)other); @@ -3708,7 +5252,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ReturnRefund other) { if (other == org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance()) return this; if (other.hasSignature()) { @@ -3717,7 +5261,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasSignature()) { @@ -3725,49 +5269,43 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - signature_ = input.readBytes(); - break; - } + org.bitcoin.paymentchannel.Protos.ReturnRefund parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ReturnRefund) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required bytes signature = 1; private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes signature = 1; + */ public boolean hasSignature() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes signature = 1; + */ public com.google.protobuf.ByteString getSignature() { return signature_; } + /** + * required bytes signature = 1; + */ public Builder setSignature(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -3777,70 +5315,192 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes signature = 1; + */ public Builder clearSignature() { bitField0_ = (bitField0_ & ~0x00000001); signature_ = getDefaultInstance().getSignature(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.ReturnRefund) } - + static { defaultInstance = new ReturnRefund(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.ReturnRefund) } - + public interface ProvideContractOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes tx = 1; + /** + * required bytes tx = 1; + * + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * 
+ */ boolean hasTx(); + /** + * required bytes tx = 1; + * + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * 
+ */ com.google.protobuf.ByteString getTx(); } + /** + * Protobuf type {@code paymentchannels.ProvideContract} + * + *
+   * Sent from the primary to the secondary to complete initialization.
+   * 
+ */ public static final class ProvideContract extends com.google.protobuf.GeneratedMessage implements ProvideContractOrBuilder { // Use ProvideContract.newBuilder() to construct. - private ProvideContract(Builder builder) { + private ProvideContract(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private ProvideContract(boolean noInit) {} - + private ProvideContract(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final ProvideContract defaultInstance; public static ProvideContract getDefaultInstance() { return defaultInstance; } - + public ProvideContract getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ProvideContract( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + tx_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ProvideContract parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ProvideContract(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; // required bytes tx = 1; public static final int TX_FIELD_NUMBER = 1; private com.google.protobuf.ByteString tx_; + /** + * required bytes tx = 1; + * + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * 
+ */ public boolean hasTx() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes tx = 1; + * + *
+     * The serialized bytes of the transaction in Satoshi format.
+     * * It must be signed and completely valid and ready for broadcast (ie it includes the
+     *   necessary fees) TODO: tell the client how much fee it needs
+     * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+     *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+     *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+     * 
+ */ public com.google.protobuf.ByteString getTx() { return tx_; } - + private void initFields() { tx_ = com.google.protobuf.ByteString.EMPTY; } @@ -3848,7 +5508,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasTx()) { memoizedIsInitialized = 0; return false; @@ -3856,7 +5516,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -3865,12 +5525,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -3880,94 +5540,87 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideContract prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.ProvideContract} + * + *
+     * Sent from the primary to the secondary to complete initialization.
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder { @@ -3975,18 +5628,21 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class); } - + // Construct using org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3997,27 +5653,27 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); tx_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.ProvideContract.getDescriptor(); + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor; } - + public org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstanceForType() { return org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance(); } - + public org.bitcoin.paymentchannel.Protos.ProvideContract build() { org.bitcoin.paymentchannel.Protos.ProvideContract result = buildPartial(); if (!result.isInitialized()) { @@ -4025,17 +5681,7 @@ public final class Protos { } return result; } - - private org.bitcoin.paymentchannel.Protos.ProvideContract buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.ProvideContract result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoin.paymentchannel.Protos.ProvideContract buildPartial() { org.bitcoin.paymentchannel.Protos.ProvideContract result = new org.bitcoin.paymentchannel.Protos.ProvideContract(this); int from_bitField0_ = bitField0_; @@ -4048,7 +5694,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideContract) { return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideContract)other); @@ -4057,7 +5703,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideContract other) { if (other == org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance()) return this; if (other.hasTx()) { @@ -4066,7 +5712,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasTx()) { @@ -4074,49 +5720,70 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - tx_ = input.readBytes(); - break; - } + org.bitcoin.paymentchannel.Protos.ProvideContract parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideContract) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required bytes tx = 1; private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes tx = 1; + * + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * 
+ */ public boolean hasTx() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes tx = 1; + * + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * 
+ */ public com.google.protobuf.ByteString getTx() { return tx_; } + /** + * required bytes tx = 1; + * + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * 
+ */ public Builder setTx(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -4126,84 +5793,256 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes tx = 1; + * + *
+       * The serialized bytes of the transaction in Satoshi format.
+       * * It must be signed and completely valid and ready for broadcast (ie it includes the
+       *   necessary fees) TODO: tell the client how much fee it needs
+       * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
+       *   primary's and the second being the secondary's (ie the script must be exactly "OP_2
+       *   ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
+       * 
+ */ public Builder clearTx() { bitField0_ = (bitField0_ & ~0x00000001); tx_ = getDefaultInstance().getTx(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideContract) } - + static { defaultInstance = new ProvideContract(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.ProvideContract) } - + public interface UpdatePaymentOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required uint64 client_change_value = 1; + /** + * required uint64 client_change_value = 1; + * + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ */ boolean hasClientChangeValue(); + /** + * required uint64 client_change_value = 1; + * + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ */ long getClientChangeValue(); - + // required bytes signature = 2; + /** + * required bytes signature = 2; + * + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ */ boolean hasSignature(); + /** + * required bytes signature = 2; + * + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ */ com.google.protobuf.ByteString getSignature(); } + /** + * Protobuf type {@code paymentchannels.UpdatePayment} + * + *
+   * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
+   * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
+   * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
+   * * Adding an input which spends the multisig contract
+   * * Setting this input's scriptSig to the given signature and a new signature created by the
+   *   primary (the primary should ensure the signature provided correctly spends the multisig
+   *   contract)
+   * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
+   *   the refund transaction
+   * * Setting this output's value to client_change_value (which must be lower than the most recent
+   *   client_change_value and lower than the multisig contract's output value)
+   * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
+   * * Adding any number of additional inputs as desired (eg to add more fee)
+   * 
+ */ public static final class UpdatePayment extends com.google.protobuf.GeneratedMessage implements UpdatePaymentOrBuilder { // Use UpdatePayment.newBuilder() to construct. - private UpdatePayment(Builder builder) { + private UpdatePayment(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private UpdatePayment(boolean noInit) {} - + private UpdatePayment(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final UpdatePayment defaultInstance; public static UpdatePayment getDefaultInstance() { return defaultInstance; } - + public UpdatePayment getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UpdatePayment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + clientChangeValue_ = input.readUInt64(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + signature_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public UpdatePayment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdatePayment(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; // required uint64 client_change_value = 1; public static final int CLIENT_CHANGE_VALUE_FIELD_NUMBER = 1; private long clientChangeValue_; + /** + * required uint64 client_change_value = 1; + * + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ */ public boolean hasClientChangeValue() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required uint64 client_change_value = 1; + * + *
+     * The value which is sent back to the primary.  The rest of the multisig output is left for
+     * the secondary to do with as they wish.
+     * 
+ */ public long getClientChangeValue() { return clientChangeValue_; } - + // required bytes signature = 2; public static final int SIGNATURE_FIELD_NUMBER = 2; private com.google.protobuf.ByteString signature_; + /** + * required bytes signature = 2; + * + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ */ public boolean hasSignature() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes signature = 2; + * + *
+     * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+     * spends the primary's part of the multisig contract's output.  This signature only covers
+     * the primary's refund output and thus the secondary is free to do what they wish with their
+     * part of the multisig output.
+     * 
+ */ public com.google.protobuf.ByteString getSignature() { return signature_; } - + private void initFields() { clientChangeValue_ = 0L; signature_ = com.google.protobuf.ByteString.EMPTY; @@ -4212,7 +6051,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasClientChangeValue()) { memoizedIsInitialized = 0; return false; @@ -4224,7 +6063,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -4236,12 +6075,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -4255,94 +6094,99 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.UpdatePayment prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code paymentchannels.UpdatePayment} + * + *
+     * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
+     * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
+     * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
+     * * Adding an input which spends the multisig contract
+     * * Setting this input's scriptSig to the given signature and a new signature created by the
+     *   primary (the primary should ensure the signature provided correctly spends the multisig
+     *   contract)
+     * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
+     *   the refund transaction
+     * * Setting this output's value to client_change_value (which must be lower than the most recent
+     *   client_change_value and lower than the multisig contract's output value)
+     * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
+     * * Adding any number of additional inputs as desired (eg to add more fee)
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder { @@ -4350,18 +6194,21 @@ public final class Protos { getDescriptor() { return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable; + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class); } - + // Construct using org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -4372,7 +6219,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); clientChangeValue_ = 0L; @@ -4381,20 +6228,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.UpdatePayment.getDescriptor(); + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor; } - + public org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstanceForType() { return org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance(); } - + public org.bitcoin.paymentchannel.Protos.UpdatePayment build() { org.bitcoin.paymentchannel.Protos.UpdatePayment result = buildPartial(); if (!result.isInitialized()) { @@ -4402,17 +6249,7 @@ public final class Protos { } return result; } - - private org.bitcoin.paymentchannel.Protos.UpdatePayment buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.UpdatePayment result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoin.paymentchannel.Protos.UpdatePayment buildPartial() { org.bitcoin.paymentchannel.Protos.UpdatePayment result = new org.bitcoin.paymentchannel.Protos.UpdatePayment(this); int from_bitField0_ = bitField0_; @@ -4429,7 +6266,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoin.paymentchannel.Protos.UpdatePayment) { return mergeFrom((org.bitcoin.paymentchannel.Protos.UpdatePayment)other); @@ -4438,7 +6275,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.UpdatePayment other) { if (other == org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) return this; if (other.hasClientChangeValue()) { @@ -4450,7 +6287,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasClientChangeValue()) { @@ -4462,75 +6299,117 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - clientChangeValue_ = input.readUInt64(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - signature_ = input.readBytes(); - break; - } + org.bitcoin.paymentchannel.Protos.UpdatePayment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.UpdatePayment) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required uint64 client_change_value = 1; private long clientChangeValue_ ; + /** + * required uint64 client_change_value = 1; + * + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ */ public boolean hasClientChangeValue() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required uint64 client_change_value = 1; + * + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ */ public long getClientChangeValue() { return clientChangeValue_; } + /** + * required uint64 client_change_value = 1; + * + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ */ public Builder setClientChangeValue(long value) { bitField0_ |= 0x00000001; clientChangeValue_ = value; onChanged(); return this; } + /** + * required uint64 client_change_value = 1; + * + *
+       * The value which is sent back to the primary.  The rest of the multisig output is left for
+       * the secondary to do with as they wish.
+       * 
+ */ public Builder clearClientChangeValue() { bitField0_ = (bitField0_ & ~0x00000001); clientChangeValue_ = 0L; onChanged(); return this; } - + // required bytes signature = 2; private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes signature = 2; + * + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ */ public boolean hasSignature() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes signature = 2; + * + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ */ public com.google.protobuf.ByteString getSignature() { return signature_; } + /** + * required bytes signature = 2; + * + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ */ public Builder setSignature(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -4540,453 +6419,128 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes signature = 2; + * + *
+       * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
+       * spends the primary's part of the multisig contract's output.  This signature only covers
+       * the primary's refund output and thus the secondary is free to do what they wish with their
+       * part of the multisig output.
+       * 
+ */ public Builder clearSignature() { bitField0_ = (bitField0_ & ~0x00000002); signature_ = getDefaultInstance().getSignature(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.UpdatePayment) } - + static { defaultInstance = new UpdatePayment(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.UpdatePayment) } - + public interface ErrorOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ boolean hasCode(); + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode(); - + // optional string explanation = 2; + /** + * optional string explanation = 2; + * + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ */ boolean hasExplanation(); - String getExplanation(); + /** + * optional string explanation = 2; + * + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ */ + java.lang.String getExplanation(); + /** + * optional string explanation = 2; + * + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ */ + com.google.protobuf.ByteString + getExplanationBytes(); } + /** + * Protobuf type {@code paymentchannels.Error} + * + *
+   * An Error can be sent by either party at any time
+   * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
+   * closing the socket (unless they just received an ERROR or a CLOSE)
+   * 
+ */ public static final class Error extends com.google.protobuf.GeneratedMessage implements ErrorOrBuilder { // Use Error.newBuilder() to construct. - private Error(Builder builder) { + private Error(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Error(boolean noInit) {} - + private Error(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final Error defaultInstance; public static Error getDefaultInstance() { return defaultInstance; } - + public Error getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable; - } - - public enum ErrorCode - implements com.google.protobuf.ProtocolMessageEnum { - TIMEOUT(0, 1), - SYNTAX_ERROR(1, 2), - NO_ACCEPTABLE_VERSION(2, 3), - BAD_TRANSACTION(3, 4), - TIME_WINDOW_TOO_LARGE(4, 5), - CHANNEL_VALUE_TOO_LARGE(5, 6), - OTHER(6, 7), - ; - - public static final int TIMEOUT_VALUE = 1; - public static final int SYNTAX_ERROR_VALUE = 2; - public static final int NO_ACCEPTABLE_VERSION_VALUE = 3; - public static final int BAD_TRANSACTION_VALUE = 4; - public static final int TIME_WINDOW_TOO_LARGE_VALUE = 5; - public static final int CHANNEL_VALUE_TOO_LARGE_VALUE = 6; - public static final int OTHER_VALUE = 7; - - - public final int getNumber() { return value; } - - public static ErrorCode valueOf(int value) { - switch (value) { - case 1: return TIMEOUT; - case 2: return SYNTAX_ERROR; - case 3: return NO_ACCEPTABLE_VERSION; - case 4: return BAD_TRANSACTION; - case 5: return TIME_WINDOW_TOO_LARGE; - case 6: return CHANNEL_VALUE_TOO_LARGE; - case 7: return OTHER; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public ErrorCode findValueByNumber(int number) { - return ErrorCode.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.Error.getDescriptor().getEnumTypes().get(0); - } - - private static final ErrorCode[] VALUES = { - TIMEOUT, SYNTAX_ERROR, NO_ACCEPTABLE_VERSION, BAD_TRANSACTION, TIME_WINDOW_TOO_LARGE, CHANNEL_VALUE_TOO_LARGE, OTHER, - }; - - public static ErrorCode valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private ErrorCode(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:paymentchannels.Error.ErrorCode) - } - - private int bitField0_; - // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; - public static final int CODE_FIELD_NUMBER = 1; - private org.bitcoin.paymentchannel.Protos.Error.ErrorCode code_; - public boolean hasCode() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() { - return code_; - } - - // optional string explanation = 2; - public static final int EXPLANATION_FIELD_NUMBER = 2; - private java.lang.Object explanation_; - public boolean hasExplanation() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public String getExplanation() { - java.lang.Object ref = explanation_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - explanation_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getExplanationBytes() { - java.lang.Object ref = explanation_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - explanation_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER; - explanation_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeEnum(1, code_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getExplanationBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, code_.getNumber()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getExplanationBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static org.bitcoin.paymentchannel.Protos.Error parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + private Error( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Error prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoin.paymentchannel.Protos.ErrorOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable; - } - - // Construct using org.bitcoin.paymentchannel.Protos.Error.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER; - bitField0_ = (bitField0_ & ~0x00000001); - explanation_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.bitcoin.paymentchannel.Protos.Error.getDescriptor(); - } - - public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() { - return org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance(); - } - - public org.bitcoin.paymentchannel.Protos.Error build() { - org.bitcoin.paymentchannel.Protos.Error result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private org.bitcoin.paymentchannel.Protos.Error buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoin.paymentchannel.Protos.Error result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoin.paymentchannel.Protos.Error buildPartial() { - org.bitcoin.paymentchannel.Protos.Error result = new org.bitcoin.paymentchannel.Protos.Error(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.code_ = code_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.explanation_ = explanation_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoin.paymentchannel.Protos.Error) { - return mergeFrom((org.bitcoin.paymentchannel.Protos.Error)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Error other) { - if (other == org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) return this; - if (other.hasCode()) { - setCode(other.getCode()); - } - if (other.hasExplanation()) { - setExplanation(other.getExplanation()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -5008,18 +6562,561 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Error parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Error(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code paymentchannels.Error.ErrorCode} + */ + public enum ErrorCode + implements com.google.protobuf.ProtocolMessageEnum { + /** + * TIMEOUT = 1; + * + *
+       * Protocol timeout occurred (one party hung).
+       * 
+ */ + TIMEOUT(0, 1), + /** + * SYNTAX_ERROR = 2; + * + *
+       * Generic error indicating some message was not properly
+       * 
+ */ + SYNTAX_ERROR(1, 2), + /** + * NO_ACCEPTABLE_VERSION = 3; + * + *
+       * formatted or was out of order.
+       * 
+ */ + NO_ACCEPTABLE_VERSION(2, 3), + /** + * BAD_TRANSACTION = 4; + * + *
+       * A provided transaction was not in the proper structure
+       * 
+ */ + BAD_TRANSACTION(3, 4), + /** + * TIME_WINDOW_TOO_LARGE = 5; + * + *
+       * (wrong inputs/outputs, sequence, lock time, signature,
+       * etc)
+       * 
+ */ + TIME_WINDOW_TOO_LARGE(4, 5), + /** + * CHANNEL_VALUE_TOO_LARGE = 6; + * + *
+       * for the primary
+       * 
+ */ + CHANNEL_VALUE_TOO_LARGE(5, 6), + /** + * OTHER = 7; + */ + OTHER(6, 7), + ; + + /** + * TIMEOUT = 1; + * + *
+       * Protocol timeout occurred (one party hung).
+       * 
+ */ + public static final int TIMEOUT_VALUE = 1; + /** + * SYNTAX_ERROR = 2; + * + *
+       * Generic error indicating some message was not properly
+       * 
+ */ + public static final int SYNTAX_ERROR_VALUE = 2; + /** + * NO_ACCEPTABLE_VERSION = 3; + * + *
+       * formatted or was out of order.
+       * 
+ */ + public static final int NO_ACCEPTABLE_VERSION_VALUE = 3; + /** + * BAD_TRANSACTION = 4; + * + *
+       * A provided transaction was not in the proper structure
+       * 
+ */ + public static final int BAD_TRANSACTION_VALUE = 4; + /** + * TIME_WINDOW_TOO_LARGE = 5; + * + *
+       * (wrong inputs/outputs, sequence, lock time, signature,
+       * etc)
+       * 
+ */ + public static final int TIME_WINDOW_TOO_LARGE_VALUE = 5; + /** + * CHANNEL_VALUE_TOO_LARGE = 6; + * + *
+       * for the primary
+       * 
+ */ + public static final int CHANNEL_VALUE_TOO_LARGE_VALUE = 6; + /** + * OTHER = 7; + */ + public static final int OTHER_VALUE = 7; + + + public final int getNumber() { return value; } + + public static ErrorCode valueOf(int value) { + switch (value) { + case 1: return TIMEOUT; + case 2: return SYNTAX_ERROR; + case 3: return NO_ACCEPTABLE_VERSION; + case 4: return BAD_TRANSACTION; + case 5: return TIME_WINDOW_TOO_LARGE; + case 6: return CHANNEL_VALUE_TOO_LARGE; + case 7: return OTHER; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ErrorCode findValueByNumber(int number) { + return ErrorCode.valueOf(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + return getDescriptor().getValues().get(index); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.Error.getDescriptor().getEnumTypes().get(0); + } + + private static final ErrorCode[] VALUES = values(); + + public static ErrorCode valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private ErrorCode(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:paymentchannels.Error.ErrorCode) + } + + private int bitField0_; + // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + public static final int CODE_FIELD_NUMBER = 1; + private org.bitcoin.paymentchannel.Protos.Error.ErrorCode code_; + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public boolean hasCode() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ + public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() { + return code_; + } + + // optional string explanation = 2; + public static final int EXPLANATION_FIELD_NUMBER = 2; + private java.lang.Object explanation_; + /** + * optional string explanation = 2; + * + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ */ + public boolean hasExplanation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional string explanation = 2; + * + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ */ + public java.lang.String getExplanation() { + java.lang.Object ref = explanation_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + explanation_ = s; + } + return s; + } + } + /** + * optional string explanation = 2; + * + *
+     * NOT SAFE FOR HTML WITHOUT ESCAPING
+     * 
+ */ + public com.google.protobuf.ByteString + getExplanationBytes() { + java.lang.Object ref = explanation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + explanation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private void initFields() { + code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER; + explanation_ = ""; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeEnum(1, code_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, getExplanationBytes()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, code_.getNumber()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, getExplanationBytes()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoin.paymentchannel.Protos.Error parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Error prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code paymentchannels.Error} + * + *
+     * An Error can be sent by either party at any time
+     * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
+     * closing the socket (unless they just received an ERROR or a CLOSE)
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoin.paymentchannel.Protos.ErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class); + } + + // Construct using org.bitcoin.paymentchannel.Protos.Error.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER; + bitField0_ = (bitField0_ & ~0x00000001); + explanation_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor; + } + + public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() { + return org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance(); + } + + public org.bitcoin.paymentchannel.Protos.Error build() { + org.bitcoin.paymentchannel.Protos.Error result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoin.paymentchannel.Protos.Error buildPartial() { + org.bitcoin.paymentchannel.Protos.Error result = new org.bitcoin.paymentchannel.Protos.Error(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.code_ = code_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.explanation_ = explanation_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoin.paymentchannel.Protos.Error) { + return mergeFrom((org.bitcoin.paymentchannel.Protos.Error)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Error other) { + if (other == org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) return this; + if (other.hasCode()) { + setCode(other.getCode()); + } + if (other.hasExplanation()) { + bitField0_ |= 0x00000002; + explanation_ = other.explanation_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoin.paymentchannel.Protos.Error parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoin.paymentchannel.Protos.Error) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; private org.bitcoin.paymentchannel.Protos.Error.ErrorCode code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER; + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ public boolean hasCode() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() { return code_; } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ public Builder setCode(org.bitcoin.paymentchannel.Protos.Error.ErrorCode value) { if (value == null) { throw new NullPointerException(); @@ -5029,29 +7126,75 @@ public final class Protos { onChanged(); return this; } + /** + * optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER]; + */ public Builder clearCode() { bitField0_ = (bitField0_ & ~0x00000001); code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER; onChanged(); return this; } - + // optional string explanation = 2; private java.lang.Object explanation_ = ""; + /** + * optional string explanation = 2; + * + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ */ public boolean hasExplanation() { return ((bitField0_ & 0x00000002) == 0x00000002); } - public String getExplanation() { + /** + * optional string explanation = 2; + * + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ */ + public java.lang.String getExplanation() { java.lang.Object ref = explanation_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); explanation_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } - public Builder setExplanation(String value) { + /** + * optional string explanation = 2; + * + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ */ + public com.google.protobuf.ByteString + getExplanationBytes() { + java.lang.Object ref = explanation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + explanation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string explanation = 2; + * + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ */ + public Builder setExplanation( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -5060,29 +7203,48 @@ public final class Protos { onChanged(); return this; } + /** + * optional string explanation = 2; + * + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ */ public Builder clearExplanation() { bitField0_ = (bitField0_ & ~0x00000002); explanation_ = getDefaultInstance().getExplanation(); onChanged(); return this; } - void setExplanation(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000002; + /** + * optional string explanation = 2; + * + *
+       * NOT SAFE FOR HTML WITHOUT ESCAPING
+       * 
+ */ + public Builder setExplanationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; explanation_ = value; onChanged(); + return this; } - + // @@protoc_insertion_point(builder_scope:paymentchannels.Error) } - + static { defaultInstance = new Error(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:paymentchannels.Error) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_paymentchannels_TwoWayChannelMessage_descriptor; private static @@ -5128,7 +7290,7 @@ public final class Protos { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_paymentchannels_Error_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -5185,73 +7347,55 @@ public final class Protos { internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_TwoWayChannelMessage_descriptor, - new java.lang.String[] { "Type", "ClientVersion", "ServerVersion", "Initiate", "ProvideRefund", "ReturnRefund", "ProvideContract", "UpdatePayment", "Error", }, - org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, - org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class); + new java.lang.String[] { "Type", "ClientVersion", "ServerVersion", "Initiate", "ProvideRefund", "ReturnRefund", "ProvideContract", "UpdatePayment", "Error", }); internal_static_paymentchannels_ClientVersion_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_paymentchannels_ClientVersion_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_ClientVersion_descriptor, - new java.lang.String[] { "Major", "Minor", "PreviousChannelContractHash", }, - org.bitcoin.paymentchannel.Protos.ClientVersion.class, - org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class); + new java.lang.String[] { "Major", "Minor", "PreviousChannelContractHash", }); internal_static_paymentchannels_ServerVersion_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_paymentchannels_ServerVersion_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_ServerVersion_descriptor, - new java.lang.String[] { "Major", "Minor", }, - org.bitcoin.paymentchannel.Protos.ServerVersion.class, - org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class); + new java.lang.String[] { "Major", "Minor", }); internal_static_paymentchannels_Initiate_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_paymentchannels_Initiate_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_Initiate_descriptor, - new java.lang.String[] { "MultisigKey", "MinAcceptedChannelSize", "ExpireTimeSecs", }, - org.bitcoin.paymentchannel.Protos.Initiate.class, - org.bitcoin.paymentchannel.Protos.Initiate.Builder.class); + new java.lang.String[] { "MultisigKey", "MinAcceptedChannelSize", "ExpireTimeSecs", }); internal_static_paymentchannels_ProvideRefund_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_paymentchannels_ProvideRefund_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_ProvideRefund_descriptor, - new java.lang.String[] { "MultisigKey", "Tx", }, - org.bitcoin.paymentchannel.Protos.ProvideRefund.class, - org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class); + new java.lang.String[] { "MultisigKey", "Tx", }); internal_static_paymentchannels_ReturnRefund_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_paymentchannels_ReturnRefund_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_ReturnRefund_descriptor, - new java.lang.String[] { "Signature", }, - org.bitcoin.paymentchannel.Protos.ReturnRefund.class, - org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class); + new java.lang.String[] { "Signature", }); internal_static_paymentchannels_ProvideContract_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_paymentchannels_ProvideContract_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_ProvideContract_descriptor, - new java.lang.String[] { "Tx", }, - org.bitcoin.paymentchannel.Protos.ProvideContract.class, - org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class); + new java.lang.String[] { "Tx", }); internal_static_paymentchannels_UpdatePayment_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_paymentchannels_UpdatePayment_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_UpdatePayment_descriptor, - new java.lang.String[] { "ClientChangeValue", "Signature", }, - org.bitcoin.paymentchannel.Protos.UpdatePayment.class, - org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class); + new java.lang.String[] { "ClientChangeValue", "Signature", }); internal_static_paymentchannels_Error_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_paymentchannels_Error_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_paymentchannels_Error_descriptor, - new java.lang.String[] { "Code", "Explanation", }, - org.bitcoin.paymentchannel.Protos.Error.class, - org.bitcoin.paymentchannel.Protos.Error.Builder.class); + new java.lang.String[] { "Code", "Explanation", }); return null; } }; @@ -5260,6 +7404,6 @@ public final class Protos { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/core/src/main/java/org/bitcoinj/wallet/Protos.java b/core/src/main/java/org/bitcoinj/wallet/Protos.java index 52f69fd95..7a178d228 100644 --- a/core/src/main/java/org/bitcoinj/wallet/Protos.java +++ b/core/src/main/java/org/bitcoinj/wallet/Protos.java @@ -10,382 +10,85 @@ public final class Protos { } public interface PeerAddressOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes ip_address = 1; + /** + * required bytes ip_address = 1; + */ boolean hasIpAddress(); + /** + * required bytes ip_address = 1; + */ com.google.protobuf.ByteString getIpAddress(); - + // required uint32 port = 2; + /** + * required uint32 port = 2; + */ boolean hasPort(); + /** + * required uint32 port = 2; + */ int getPort(); - + // required uint64 services = 3; + /** + * required uint64 services = 3; + */ boolean hasServices(); + /** + * required uint64 services = 3; + */ long getServices(); } + /** + * Protobuf type {@code wallet.PeerAddress} + */ public static final class PeerAddress extends com.google.protobuf.GeneratedMessage implements PeerAddressOrBuilder { // Use PeerAddress.newBuilder() to construct. - private PeerAddress(Builder builder) { + private PeerAddress(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private PeerAddress(boolean noInit) {} - + private PeerAddress(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final PeerAddress defaultInstance; public static PeerAddress getDefaultInstance() { return defaultInstance; } - + public PeerAddress getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable; - } - - private int bitField0_; - // required bytes ip_address = 1; - public static final int IP_ADDRESS_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString ipAddress_; - public boolean hasIpAddress() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getIpAddress() { - return ipAddress_; - } - - // required uint32 port = 2; - public static final int PORT_FIELD_NUMBER = 2; - private int port_; - public boolean hasPort() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getPort() { - return port_; - } - - // required uint64 services = 3; - public static final int SERVICES_FIELD_NUMBER = 3; - private long services_; - public boolean hasServices() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public long getServices() { - return services_; - } - - private void initFields() { - ipAddress_ = com.google.protobuf.ByteString.EMPTY; - port_ = 0; - services_ = 0L; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasIpAddress()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasPort()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasServices()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, ipAddress_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeUInt32(2, port_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeUInt64(3, services_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, ipAddress_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, port_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, services_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + private PeerAddress( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoinj.wallet.Protos.PeerAddress prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoinj.wallet.Protos.PeerAddressOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable; - } - - // Construct using org.bitcoinj.wallet.Protos.PeerAddress.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - ipAddress_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - port_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - services_ = 0L; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.bitcoinj.wallet.Protos.PeerAddress.getDescriptor(); - } - - public org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstanceForType() { - return org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance(); - } - - public org.bitcoinj.wallet.Protos.PeerAddress build() { - org.bitcoinj.wallet.Protos.PeerAddress result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private org.bitcoinj.wallet.Protos.PeerAddress buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.PeerAddress result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoinj.wallet.Protos.PeerAddress buildPartial() { - org.bitcoinj.wallet.Protos.PeerAddress result = new org.bitcoinj.wallet.Protos.PeerAddress(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.ipAddress_ = ipAddress_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.port_ = port_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.services_ = services_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoinj.wallet.Protos.PeerAddress) { - return mergeFrom((org.bitcoinj.wallet.Protos.PeerAddress)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.bitcoinj.wallet.Protos.PeerAddress other) { - if (other == org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()) return this; - if (other.hasIpAddress()) { - setIpAddress(other.getIpAddress()); - } - if (other.hasPort()) { - setPort(other.getPort()); - } - if (other.hasServices()) { - setServices(other.getServices()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasIpAddress()) { - - return false; - } - if (!hasPort()) { - - return false; - } - if (!hasServices()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -406,18 +109,394 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PeerAddress parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PeerAddress(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required bytes ip_address = 1; + public static final int IP_ADDRESS_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString ipAddress_; + /** + * required bytes ip_address = 1; + */ + public boolean hasIpAddress() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes ip_address = 1; + */ + public com.google.protobuf.ByteString getIpAddress() { + return ipAddress_; + } + + // required uint32 port = 2; + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + /** + * required uint32 port = 2; + */ + public boolean hasPort() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint32 port = 2; + */ + public int getPort() { + return port_; + } + + // required uint64 services = 3; + public static final int SERVICES_FIELD_NUMBER = 3; + private long services_; + /** + * required uint64 services = 3; + */ + public boolean hasServices() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required uint64 services = 3; + */ + public long getServices() { + return services_; + } + + private void initFields() { + ipAddress_ = com.google.protobuf.ByteString.EMPTY; + port_ = 0; + services_ = 0L; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasIpAddress()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPort()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasServices()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, ipAddress_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt32(2, port_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeUInt64(3, services_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, ipAddress_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, port_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(3, services_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoinj.wallet.Protos.PeerAddress parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.PeerAddress prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code wallet.PeerAddress} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.PeerAddressOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.PeerAddress.class, org.bitcoinj.wallet.Protos.PeerAddress.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.PeerAddress.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + ipAddress_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + port_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + services_ = 0L; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_PeerAddress_descriptor; + } + + public org.bitcoinj.wallet.Protos.PeerAddress getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.PeerAddress build() { + org.bitcoinj.wallet.Protos.PeerAddress result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.PeerAddress buildPartial() { + org.bitcoinj.wallet.Protos.PeerAddress result = new org.bitcoinj.wallet.Protos.PeerAddress(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.ipAddress_ = ipAddress_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.port_ = port_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.services_ = services_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.PeerAddress) { + return mergeFrom((org.bitcoinj.wallet.Protos.PeerAddress)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.PeerAddress other) { + if (other == org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()) return this; + if (other.hasIpAddress()) { + setIpAddress(other.getIpAddress()); + } + if (other.hasPort()) { + setPort(other.getPort()); + } + if (other.hasServices()) { + setServices(other.getServices()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasIpAddress()) { + + return false; + } + if (!hasPort()) { + + return false; + } + if (!hasServices()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.PeerAddress parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.PeerAddress) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // required bytes ip_address = 1; private com.google.protobuf.ByteString ipAddress_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes ip_address = 1; + */ public boolean hasIpAddress() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes ip_address = 1; + */ public com.google.protobuf.ByteString getIpAddress() { return ipAddress_; } + /** + * required bytes ip_address = 1; + */ public Builder setIpAddress(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -427,126 +506,286 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes ip_address = 1; + */ public Builder clearIpAddress() { bitField0_ = (bitField0_ & ~0x00000001); ipAddress_ = getDefaultInstance().getIpAddress(); onChanged(); return this; } - + // required uint32 port = 2; private int port_ ; + /** + * required uint32 port = 2; + */ public boolean hasPort() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required uint32 port = 2; + */ public int getPort() { return port_; } + /** + * required uint32 port = 2; + */ public Builder setPort(int value) { bitField0_ |= 0x00000002; port_ = value; onChanged(); return this; } + /** + * required uint32 port = 2; + */ public Builder clearPort() { bitField0_ = (bitField0_ & ~0x00000002); port_ = 0; onChanged(); return this; } - + // required uint64 services = 3; private long services_ ; + /** + * required uint64 services = 3; + */ public boolean hasServices() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required uint64 services = 3; + */ public long getServices() { return services_; } + /** + * required uint64 services = 3; + */ public Builder setServices(long value) { bitField0_ |= 0x00000004; services_ = value; onChanged(); return this; } + /** + * required uint64 services = 3; + */ public Builder clearServices() { bitField0_ = (bitField0_ & ~0x00000004); services_ = 0L; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.PeerAddress) } - + static { defaultInstance = new PeerAddress(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.PeerAddress) } - + public interface EncryptedPrivateKeyOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes initialisation_vector = 1; + /** + * required bytes initialisation_vector = 1; + * + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ */ boolean hasInitialisationVector(); + /** + * required bytes initialisation_vector = 1; + * + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ */ com.google.protobuf.ByteString getInitialisationVector(); - + // required bytes encrypted_private_key = 2; + /** + * required bytes encrypted_private_key = 2; + * + *
+     * The encrypted private key
+     * 
+ */ boolean hasEncryptedPrivateKey(); + /** + * required bytes encrypted_private_key = 2; + * + *
+     * The encrypted private key
+     * 
+ */ com.google.protobuf.ByteString getEncryptedPrivateKey(); } + /** + * Protobuf type {@code wallet.EncryptedPrivateKey} + * + *
+   **
+   * The data to store a private key encrypted with Scrypt and AES
+   * 
+ */ public static final class EncryptedPrivateKey extends com.google.protobuf.GeneratedMessage implements EncryptedPrivateKeyOrBuilder { // Use EncryptedPrivateKey.newBuilder() to construct. - private EncryptedPrivateKey(Builder builder) { + private EncryptedPrivateKey(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private EncryptedPrivateKey(boolean noInit) {} - + private EncryptedPrivateKey(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final EncryptedPrivateKey defaultInstance; public static EncryptedPrivateKey getDefaultInstance() { return defaultInstance; } - + public EncryptedPrivateKey getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private EncryptedPrivateKey( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + initialisationVector_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + encryptedPrivateKey_ = input.readBytes(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public EncryptedPrivateKey parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EncryptedPrivateKey(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; // required bytes initialisation_vector = 1; public static final int INITIALISATION_VECTOR_FIELD_NUMBER = 1; private com.google.protobuf.ByteString initialisationVector_; + /** + * required bytes initialisation_vector = 1; + * + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ */ public boolean hasInitialisationVector() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes initialisation_vector = 1; + * + *
+     * The initialisation vector for the AES encryption (16 bytes)
+     * 
+ */ public com.google.protobuf.ByteString getInitialisationVector() { return initialisationVector_; } - + // required bytes encrypted_private_key = 2; public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER = 2; private com.google.protobuf.ByteString encryptedPrivateKey_; + /** + * required bytes encrypted_private_key = 2; + * + *
+     * The encrypted private key
+     * 
+ */ public boolean hasEncryptedPrivateKey() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes encrypted_private_key = 2; + * + *
+     * The encrypted private key
+     * 
+ */ public com.google.protobuf.ByteString getEncryptedPrivateKey() { return encryptedPrivateKey_; } - + private void initFields() { initialisationVector_ = com.google.protobuf.ByteString.EMPTY; encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY; @@ -555,7 +794,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasInitialisationVector()) { memoizedIsInitialized = 0; return false; @@ -567,7 +806,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -579,12 +818,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -598,94 +837,88 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.EncryptedPrivateKey parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoinj.wallet.Protos.EncryptedPrivateKey prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.EncryptedPrivateKey} + * + *
+     **
+     * The data to store a private key encrypted with Scrypt and AES
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder { @@ -693,18 +926,21 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class); } - + // Construct using org.bitcoinj.wallet.Protos.EncryptedPrivateKey.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -715,7 +951,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); initialisationVector_ = com.google.protobuf.ByteString.EMPTY; @@ -724,20 +960,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_EncryptedPrivateKey_descriptor; } - + public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getDefaultInstanceForType() { return org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance(); } - + public org.bitcoinj.wallet.Protos.EncryptedPrivateKey build() { org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = buildPartial(); if (!result.isInitialized()) { @@ -745,17 +981,7 @@ public final class Protos { } return result; } - - private org.bitcoinj.wallet.Protos.EncryptedPrivateKey buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoinj.wallet.Protos.EncryptedPrivateKey buildPartial() { org.bitcoinj.wallet.Protos.EncryptedPrivateKey result = new org.bitcoinj.wallet.Protos.EncryptedPrivateKey(this); int from_bitField0_ = bitField0_; @@ -772,7 +998,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoinj.wallet.Protos.EncryptedPrivateKey) { return mergeFrom((org.bitcoinj.wallet.Protos.EncryptedPrivateKey)other); @@ -781,7 +1007,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoinj.wallet.Protos.EncryptedPrivateKey other) { if (other == org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance()) return this; if (other.hasInitialisationVector()) { @@ -793,7 +1019,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasInitialisationVector()) { @@ -805,54 +1031,55 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - initialisationVector_ = input.readBytes(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - encryptedPrivateKey_ = input.readBytes(); - break; - } + org.bitcoinj.wallet.Protos.EncryptedPrivateKey parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.EncryptedPrivateKey) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required bytes initialisation_vector = 1; private com.google.protobuf.ByteString initialisationVector_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes initialisation_vector = 1; + * + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ */ public boolean hasInitialisationVector() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required bytes initialisation_vector = 1; + * + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ */ public com.google.protobuf.ByteString getInitialisationVector() { return initialisationVector_; } + /** + * required bytes initialisation_vector = 1; + * + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ */ public Builder setInitialisationVector(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -862,21 +1089,49 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes initialisation_vector = 1; + * + *
+       * The initialisation vector for the AES encryption (16 bytes)
+       * 
+ */ public Builder clearInitialisationVector() { bitField0_ = (bitField0_ & ~0x00000001); initialisationVector_ = getDefaultInstance().getInitialisationVector(); onChanged(); return this; } - + // required bytes encrypted_private_key = 2; private com.google.protobuf.ByteString encryptedPrivateKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes encrypted_private_key = 2; + * + *
+       * The encrypted private key
+       * 
+ */ public boolean hasEncryptedPrivateKey() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes encrypted_private_key = 2; + * + *
+       * The encrypted private key
+       * 
+ */ public com.google.protobuf.ByteString getEncryptedPrivateKey() { return encryptedPrivateKey_; } + /** + * required bytes encrypted_private_key = 2; + * + *
+       * The encrypted private key
+       * 
+ */ public Builder setEncryptedPrivateKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -886,92 +1141,347 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes encrypted_private_key = 2; + * + *
+       * The encrypted private key
+       * 
+ */ public Builder clearEncryptedPrivateKey() { bitField0_ = (bitField0_ & ~0x00000002); encryptedPrivateKey_ = getDefaultInstance().getEncryptedPrivateKey(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.EncryptedPrivateKey) } - + static { defaultInstance = new EncryptedPrivateKey(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.EncryptedPrivateKey) } - + public interface KeyOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .wallet.Key.Type type = 1; + /** + * required .wallet.Key.Type type = 1; + */ boolean hasType(); + /** + * required .wallet.Key.Type type = 1; + */ org.bitcoinj.wallet.Protos.Key.Type getType(); - + // optional bytes private_key = 2; + /** + * optional bytes private_key = 2; + * + *
+     * The private EC key bytes without any ASN.1 wrapping.
+     * 
+ */ boolean hasPrivateKey(); + /** + * optional bytes private_key = 2; + * + *
+     * The private EC key bytes without any ASN.1 wrapping.
+     * 
+ */ com.google.protobuf.ByteString getPrivateKey(); - + // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+     * The message containing the encrypted private EC key information.
+     * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+     * This is for security of the private key information.
+     * 
+ */ boolean hasEncryptedPrivateKey(); + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+     * The message containing the encrypted private EC key information.
+     * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+     * This is for security of the private key information.
+     * 
+ */ org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey(); + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+     * The message containing the encrypted private EC key information.
+     * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+     * This is for security of the private key information.
+     * 
+ */ org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder(); - + // optional bytes public_key = 3; + /** + * optional bytes public_key = 3; + * + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup.
+     * 
+ */ boolean hasPublicKey(); + /** + * optional bytes public_key = 3; + * + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup.
+     * 
+ */ com.google.protobuf.ByteString getPublicKey(); - + // optional string label = 4; + /** + * optional string label = 4; + * + *
+     * User-provided label associated with the key.
+     * 
+ */ boolean hasLabel(); - String getLabel(); - + /** + * optional string label = 4; + * + *
+     * User-provided label associated with the key.
+     * 
+ */ + java.lang.String getLabel(); + /** + * optional string label = 4; + * + *
+     * User-provided label associated with the key.
+     * 
+ */ + com.google.protobuf.ByteString + getLabelBytes(); + // optional int64 creation_timestamp = 5; + /** + * optional int64 creation_timestamp = 5; + * + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+     * 
+ */ boolean hasCreationTimestamp(); + /** + * optional int64 creation_timestamp = 5; + * + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+     * 
+ */ long getCreationTimestamp(); } + /** + * Protobuf type {@code wallet.Key} + * + *
+   **
+   * A key used to control Bitcoin spending.
+   *
+   * Either the private key, the public key or both may be present.  It is recommended that
+   * if the private key is provided that the public key is provided too because deriving it is slow.
+   *
+   * If only the public key is provided, the key can only be used to watch the blockchain and verify
+   * transactions, and not for spending.
+   * 
+ */ public static final class Key extends com.google.protobuf.GeneratedMessage implements KeyOrBuilder { // Use Key.newBuilder() to construct. - private Key(Builder builder) { + private Key(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Key(boolean noInit) {} - + private Key(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final Key defaultInstance; public static Key getDefaultInstance() { return defaultInstance; } - + public Key getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Key( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Key.Type value = org.bitcoinj.wallet.Protos.Key.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = value; + } + break; + } + case 18: { + bitField0_ |= 0x00000002; + privateKey_ = input.readBytes(); + break; + } + case 26: { + bitField0_ |= 0x00000008; + publicKey_ = input.readBytes(); + break; + } + case 34: { + bitField0_ |= 0x00000010; + label_ = input.readBytes(); + break; + } + case 40: { + bitField0_ |= 0x00000020; + creationTimestamp_ = input.readInt64(); + break; + } + case 50: { + org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = encryptedPrivateKey_.toBuilder(); + } + encryptedPrivateKey_ = input.readMessage(org.bitcoinj.wallet.Protos.EncryptedPrivateKey.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptedPrivateKey_); + encryptedPrivateKey_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Key parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Key(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code wallet.Key.Type} + */ public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * ORIGINAL = 1; + * + *
+       * Unencrypted - Original bitcoin secp256k1 curve
+       * 
+ */ ORIGINAL(0, 1), + /** + * ENCRYPTED_SCRYPT_AES = 2; + * + *
+       * Encrypted with Scrypt and AES - - Original bitcoin secp256k1 curve
+       * 
+ */ ENCRYPTED_SCRYPT_AES(1, 2), ; - + + /** + * ORIGINAL = 1; + * + *
+       * Unencrypted - Original bitcoin secp256k1 curve
+       * 
+ */ public static final int ORIGINAL_VALUE = 1; + /** + * ENCRYPTED_SCRYPT_AES = 2; + * + *
+       * Encrypted with Scrypt and AES - - Original bitcoin secp256k1 curve
+       * 
+ */ public static final int ENCRYPTED_SCRYPT_AES_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static Type valueOf(int value) { switch (value) { case 1: return ORIGINAL; @@ -979,7 +1489,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -991,7 +1501,7 @@ public final class Protos { return Type.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -1004,11 +1514,9 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.Key.getDescriptor().getEnumTypes().get(0); } - - private static final Type[] VALUES = { - ORIGINAL, ENCRYPTED_SCRYPT_AES, - }; - + + private static final Type[] VALUES = values(); + public static Type valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -1017,104 +1525,204 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private Type(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:wallet.Key.Type) } - + private int bitField0_; // required .wallet.Key.Type type = 1; public static final int TYPE_FIELD_NUMBER = 1; private org.bitcoinj.wallet.Protos.Key.Type type_; + /** + * required .wallet.Key.Type type = 1; + */ public boolean hasType() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required .wallet.Key.Type type = 1; + */ public org.bitcoinj.wallet.Protos.Key.Type getType() { return type_; } - + // optional bytes private_key = 2; public static final int PRIVATE_KEY_FIELD_NUMBER = 2; private com.google.protobuf.ByteString privateKey_; + /** + * optional bytes private_key = 2; + * + *
+     * The private EC key bytes without any ASN.1 wrapping.
+     * 
+ */ public boolean hasPrivateKey() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional bytes private_key = 2; + * + *
+     * The private EC key bytes without any ASN.1 wrapping.
+     * 
+ */ public com.google.protobuf.ByteString getPrivateKey() { return privateKey_; } - + // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; public static final int ENCRYPTED_PRIVATE_KEY_FIELD_NUMBER = 6; private org.bitcoinj.wallet.Protos.EncryptedPrivateKey encryptedPrivateKey_; + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+     * The message containing the encrypted private EC key information.
+     * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+     * This is for security of the private key information.
+     * 
+ */ public boolean hasEncryptedPrivateKey() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+     * The message containing the encrypted private EC key information.
+     * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+     * This is for security of the private key information.
+     * 
+ */ public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey() { return encryptedPrivateKey_; } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+     * The message containing the encrypted private EC key information.
+     * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+     * This is for security of the private key information.
+     * 
+ */ public org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder() { return encryptedPrivateKey_; } - + // optional bytes public_key = 3; public static final int PUBLIC_KEY_FIELD_NUMBER = 3; private com.google.protobuf.ByteString publicKey_; + /** + * optional bytes public_key = 3; + * + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup.
+     * 
+ */ public boolean hasPublicKey() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional bytes public_key = 3; + * + *
+     * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+     * do lots of slow EC math on startup.
+     * 
+ */ public com.google.protobuf.ByteString getPublicKey() { return publicKey_; } - + // optional string label = 4; public static final int LABEL_FIELD_NUMBER = 4; private java.lang.Object label_; + /** + * optional string label = 4; + * + *
+     * User-provided label associated with the key.
+     * 
+ */ public boolean hasLabel() { return ((bitField0_ & 0x00000010) == 0x00000010); } - public String getLabel() { + /** + * optional string label = 4; + * + *
+     * User-provided label associated with the key.
+     * 
+ */ + public java.lang.String getLabel() { java.lang.Object ref = label_; - if (ref instanceof String) { - return (String) ref; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { label_ = s; } return s; } } - private com.google.protobuf.ByteString getLabelBytes() { + /** + * optional string label = 4; + * + *
+     * User-provided label associated with the key.
+     * 
+ */ + public com.google.protobuf.ByteString + getLabelBytes() { java.lang.Object ref = label_; - if (ref instanceof String) { + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); label_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } - + // optional int64 creation_timestamp = 5; public static final int CREATION_TIMESTAMP_FIELD_NUMBER = 5; private long creationTimestamp_; + /** + * optional int64 creation_timestamp = 5; + * + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+     * 
+ */ public boolean hasCreationTimestamp() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional int64 creation_timestamp = 5; + * + *
+     * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+     * 
+ */ public long getCreationTimestamp() { return creationTimestamp_; } - + private void initFields() { type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; privateKey_ = com.google.protobuf.ByteString.EMPTY; @@ -1127,7 +1735,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasType()) { memoizedIsInitialized = 0; return false; @@ -1141,7 +1749,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -1165,12 +1773,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -1200,94 +1808,94 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoinj.wallet.Protos.Key parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.Key parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Key parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.Key parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Key parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.Key parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoinj.wallet.Protos.Key parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Key parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.Key parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoinj.wallet.Protos.Key prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.Key} + * + *
+     **
+     * A key used to control Bitcoin spending.
+     *
+     * Either the private key, the public key or both may be present.  It is recommended that
+     * if the private key is provided that the public key is provided too because deriving it is slow.
+     *
+     * If only the public key is provided, the key can only be used to watch the blockchain and verify
+     * transactions, and not for spending.
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoinj.wallet.Protos.KeyOrBuilder { @@ -1295,18 +1903,21 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Key.class, org.bitcoinj.wallet.Protos.Key.Builder.class); } - + // Construct using org.bitcoinj.wallet.Protos.Key.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -1318,7 +1929,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; @@ -1339,20 +1950,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000020); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.Key.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_Key_descriptor; } - + public org.bitcoinj.wallet.Protos.Key getDefaultInstanceForType() { return org.bitcoinj.wallet.Protos.Key.getDefaultInstance(); } - + public org.bitcoinj.wallet.Protos.Key build() { org.bitcoinj.wallet.Protos.Key result = buildPartial(); if (!result.isInitialized()) { @@ -1360,17 +1971,7 @@ public final class Protos { } return result; } - - private org.bitcoinj.wallet.Protos.Key buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.Key result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoinj.wallet.Protos.Key buildPartial() { org.bitcoinj.wallet.Protos.Key result = new org.bitcoinj.wallet.Protos.Key(this); int from_bitField0_ = bitField0_; @@ -1407,7 +2008,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoinj.wallet.Protos.Key) { return mergeFrom((org.bitcoinj.wallet.Protos.Key)other); @@ -1416,7 +2017,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Key other) { if (other == org.bitcoinj.wallet.Protos.Key.getDefaultInstance()) return this; if (other.hasType()) { @@ -1432,7 +2033,9 @@ public final class Protos { setPublicKey(other.getPublicKey()); } if (other.hasLabel()) { - setLabel(other.getLabel()); + bitField0_ |= 0x00000010; + label_ = other.label_; + onChanged(); } if (other.hasCreationTimestamp()) { setCreationTimestamp(other.getCreationTimestamp()); @@ -1440,7 +2043,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasType()) { @@ -1454,84 +2057,43 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - org.bitcoinj.wallet.Protos.Key.Type value = org.bitcoinj.wallet.Protos.Key.Type.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(1, rawValue); - } else { - bitField0_ |= 0x00000001; - type_ = value; - } - break; - } - case 18: { - bitField0_ |= 0x00000002; - privateKey_ = input.readBytes(); - break; - } - case 26: { - bitField0_ |= 0x00000008; - publicKey_ = input.readBytes(); - break; - } - case 34: { - bitField0_ |= 0x00000010; - label_ = input.readBytes(); - break; - } - case 40: { - bitField0_ |= 0x00000020; - creationTimestamp_ = input.readInt64(); - break; - } - case 50: { - org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder subBuilder = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.newBuilder(); - if (hasEncryptedPrivateKey()) { - subBuilder.mergeFrom(getEncryptedPrivateKey()); - } - input.readMessage(subBuilder, extensionRegistry); - setEncryptedPrivateKey(subBuilder.buildPartial()); - break; - } + org.bitcoinj.wallet.Protos.Key parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.Key) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required .wallet.Key.Type type = 1; private org.bitcoinj.wallet.Protos.Key.Type type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; + /** + * required .wallet.Key.Type type = 1; + */ public boolean hasType() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required .wallet.Key.Type type = 1; + */ public org.bitcoinj.wallet.Protos.Key.Type getType() { return type_; } + /** + * required .wallet.Key.Type type = 1; + */ public Builder setType(org.bitcoinj.wallet.Protos.Key.Type value) { if (value == null) { throw new NullPointerException(); @@ -1541,21 +2103,45 @@ public final class Protos { onChanged(); return this; } + /** + * required .wallet.Key.Type type = 1; + */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = org.bitcoinj.wallet.Protos.Key.Type.ORIGINAL; onChanged(); return this; } - + // optional bytes private_key = 2; private com.google.protobuf.ByteString privateKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes private_key = 2; + * + *
+       * The private EC key bytes without any ASN.1 wrapping.
+       * 
+ */ public boolean hasPrivateKey() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional bytes private_key = 2; + * + *
+       * The private EC key bytes without any ASN.1 wrapping.
+       * 
+ */ public com.google.protobuf.ByteString getPrivateKey() { return privateKey_; } + /** + * optional bytes private_key = 2; + * + *
+       * The private EC key bytes without any ASN.1 wrapping.
+       * 
+ */ public Builder setPrivateKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1565,20 +2151,45 @@ public final class Protos { onChanged(); return this; } + /** + * optional bytes private_key = 2; + * + *
+       * The private EC key bytes without any ASN.1 wrapping.
+       * 
+ */ public Builder clearPrivateKey() { bitField0_ = (bitField0_ & ~0x00000002); privateKey_ = getDefaultInstance().getPrivateKey(); onChanged(); return this; } - + // optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; private org.bitcoinj.wallet.Protos.EncryptedPrivateKey encryptedPrivateKey_ = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoinj.wallet.Protos.EncryptedPrivateKey, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder, org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder> encryptedPrivateKeyBuilder_; + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public boolean hasEncryptedPrivateKey() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public org.bitcoinj.wallet.Protos.EncryptedPrivateKey getEncryptedPrivateKey() { if (encryptedPrivateKeyBuilder_ == null) { return encryptedPrivateKey_; @@ -1586,6 +2197,15 @@ public final class Protos { return encryptedPrivateKeyBuilder_.getMessage(); } } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public Builder setEncryptedPrivateKey(org.bitcoinj.wallet.Protos.EncryptedPrivateKey value) { if (encryptedPrivateKeyBuilder_ == null) { if (value == null) { @@ -1599,6 +2219,15 @@ public final class Protos { bitField0_ |= 0x00000004; return this; } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public Builder setEncryptedPrivateKey( org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder builderForValue) { if (encryptedPrivateKeyBuilder_ == null) { @@ -1610,6 +2239,15 @@ public final class Protos { bitField0_ |= 0x00000004; return this; } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public Builder mergeEncryptedPrivateKey(org.bitcoinj.wallet.Protos.EncryptedPrivateKey value) { if (encryptedPrivateKeyBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && @@ -1626,6 +2264,15 @@ public final class Protos { bitField0_ |= 0x00000004; return this; } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public Builder clearEncryptedPrivateKey() { if (encryptedPrivateKeyBuilder_ == null) { encryptedPrivateKey_ = org.bitcoinj.wallet.Protos.EncryptedPrivateKey.getDefaultInstance(); @@ -1636,11 +2283,29 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000004); return this; } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder getEncryptedPrivateKeyBuilder() { bitField0_ |= 0x00000004; onChanged(); return getEncryptedPrivateKeyFieldBuilder().getBuilder(); } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ public org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder getEncryptedPrivateKeyOrBuilder() { if (encryptedPrivateKeyBuilder_ != null) { return encryptedPrivateKeyBuilder_.getMessageOrBuilder(); @@ -1648,6 +2313,15 @@ public final class Protos { return encryptedPrivateKey_; } } + /** + * optional .wallet.EncryptedPrivateKey encrypted_private_key = 6; + * + *
+       * The message containing the encrypted private EC key information.
+       * When an EncryptedPrivateKey is present then the (unencrypted) private_key will be a zero length byte array or contain all zeroes.
+       * This is for security of the private key information.
+       * 
+ */ private com.google.protobuf.SingleFieldBuilder< org.bitcoinj.wallet.Protos.EncryptedPrivateKey, org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder, org.bitcoinj.wallet.Protos.EncryptedPrivateKeyOrBuilder> getEncryptedPrivateKeyFieldBuilder() { @@ -1661,15 +2335,39 @@ public final class Protos { } return encryptedPrivateKeyBuilder_; } - + // optional bytes public_key = 3; private com.google.protobuf.ByteString publicKey_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes public_key = 3; + * + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup.
+       * 
+ */ public boolean hasPublicKey() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional bytes public_key = 3; + * + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup.
+       * 
+ */ public com.google.protobuf.ByteString getPublicKey() { return publicKey_; } + /** + * optional bytes public_key = 3; + * + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup.
+       * 
+ */ public Builder setPublicKey(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -1679,29 +2377,80 @@ public final class Protos { onChanged(); return this; } + /** + * optional bytes public_key = 3; + * + *
+       * The public EC key derived from the private key. We allow both to be stored to avoid mobile clients having to
+       * do lots of slow EC math on startup.
+       * 
+ */ public Builder clearPublicKey() { bitField0_ = (bitField0_ & ~0x00000008); publicKey_ = getDefaultInstance().getPublicKey(); onChanged(); return this; } - + // optional string label = 4; private java.lang.Object label_ = ""; + /** + * optional string label = 4; + * + *
+       * User-provided label associated with the key.
+       * 
+ */ public boolean hasLabel() { return ((bitField0_ & 0x00000010) == 0x00000010); } - public String getLabel() { + /** + * optional string label = 4; + * + *
+       * User-provided label associated with the key.
+       * 
+ */ + public java.lang.String getLabel() { java.lang.Object ref = label_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); label_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } - public Builder setLabel(String value) { + /** + * optional string label = 4; + * + *
+       * User-provided label associated with the key.
+       * 
+ */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string label = 4; + * + *
+       * User-provided label associated with the key.
+       * 
+ */ + public Builder setLabel( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -1710,459 +2459,220 @@ public final class Protos { onChanged(); return this; } + /** + * optional string label = 4; + * + *
+       * User-provided label associated with the key.
+       * 
+ */ public Builder clearLabel() { bitField0_ = (bitField0_ & ~0x00000010); label_ = getDefaultInstance().getLabel(); onChanged(); return this; } - void setLabel(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000010; + /** + * optional string label = 4; + * + *
+       * User-provided label associated with the key.
+       * 
+ */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; label_ = value; onChanged(); + return this; } - + // optional int64 creation_timestamp = 5; private long creationTimestamp_ ; + /** + * optional int64 creation_timestamp = 5; + * + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+       * 
+ */ public boolean hasCreationTimestamp() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional int64 creation_timestamp = 5; + * + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+       * 
+ */ public long getCreationTimestamp() { return creationTimestamp_; } + /** + * optional int64 creation_timestamp = 5; + * + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+       * 
+ */ public Builder setCreationTimestamp(long value) { bitField0_ |= 0x00000020; creationTimestamp_ = value; onChanged(); return this; } + /** + * optional int64 creation_timestamp = 5; + * + *
+       * Timestamp stored as millis since epoch. Useful for skipping block bodies before this point.
+       * 
+ */ public Builder clearCreationTimestamp() { bitField0_ = (bitField0_ & ~0x00000020); creationTimestamp_ = 0L; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.Key) } - + static { defaultInstance = new Key(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.Key) } - + public interface TransactionInputOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes transaction_out_point_hash = 1; + /** + * required bytes transaction_out_point_hash = 1; + * + *
+     * Hash of the transaction this input is using.
+     * 
+ */ boolean hasTransactionOutPointHash(); + /** + * required bytes transaction_out_point_hash = 1; + * + *
+     * Hash of the transaction this input is using.
+     * 
+ */ com.google.protobuf.ByteString getTransactionOutPointHash(); - + // required uint32 transaction_out_point_index = 2; + /** + * required uint32 transaction_out_point_index = 2; + * + *
+     * Index of transaction output used by this input.
+     * 
+ */ boolean hasTransactionOutPointIndex(); + /** + * required uint32 transaction_out_point_index = 2; + * + *
+     * Index of transaction output used by this input.
+     * 
+ */ int getTransactionOutPointIndex(); - + // required bytes script_bytes = 3; + /** + * required bytes script_bytes = 3; + * + *
+     * Script that contains the signatures/pubkeys.
+     * 
+ */ boolean hasScriptBytes(); + /** + * required bytes script_bytes = 3; + * + *
+     * Script that contains the signatures/pubkeys.
+     * 
+ */ com.google.protobuf.ByteString getScriptBytes(); - + // optional uint32 sequence = 4; + /** + * optional uint32 sequence = 4; + * + *
+     * Sequence number. Currently unused, but intended for contracts in future.
+     * 
+ */ boolean hasSequence(); + /** + * optional uint32 sequence = 4; + * + *
+     * Sequence number. Currently unused, but intended for contracts in future.
+     * 
+ */ int getSequence(); } + /** + * Protobuf type {@code wallet.TransactionInput} + */ public static final class TransactionInput extends com.google.protobuf.GeneratedMessage implements TransactionInputOrBuilder { // Use TransactionInput.newBuilder() to construct. - private TransactionInput(Builder builder) { + private TransactionInput(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private TransactionInput(boolean noInit) {} - + private TransactionInput(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final TransactionInput defaultInstance; public static TransactionInput getDefaultInstance() { return defaultInstance; } - + public TransactionInput getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable; - } - - private int bitField0_; - // required bytes transaction_out_point_hash = 1; - public static final int TRANSACTION_OUT_POINT_HASH_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString transactionOutPointHash_; - public boolean hasTransactionOutPointHash() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getTransactionOutPointHash() { - return transactionOutPointHash_; - } - - // required uint32 transaction_out_point_index = 2; - public static final int TRANSACTION_OUT_POINT_INDEX_FIELD_NUMBER = 2; - private int transactionOutPointIndex_; - public boolean hasTransactionOutPointIndex() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getTransactionOutPointIndex() { - return transactionOutPointIndex_; - } - - // required bytes script_bytes = 3; - public static final int SCRIPT_BYTES_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString scriptBytes_; - public boolean hasScriptBytes() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public com.google.protobuf.ByteString getScriptBytes() { - return scriptBytes_; - } - - // optional uint32 sequence = 4; - public static final int SEQUENCE_FIELD_NUMBER = 4; - private int sequence_; - public boolean hasSequence() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public int getSequence() { - return sequence_; - } - - private void initFields() { - transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; - transactionOutPointIndex_ = 0; - scriptBytes_ = com.google.protobuf.ByteString.EMPTY; - sequence_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasTransactionOutPointHash()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasTransactionOutPointIndex()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasScriptBytes()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, transactionOutPointHash_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeUInt32(2, transactionOutPointIndex_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, scriptBytes_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeUInt32(4, sequence_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, transactionOutPointHash_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, transactionOutPointIndex_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, scriptBytes_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(4, sequence_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( + private TransactionInput( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionInput prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoinj.wallet.Protos.TransactionInputOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable; - } - - // Construct using org.bitcoinj.wallet.Protos.TransactionInput.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - transactionOutPointIndex_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - scriptBytes_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - sequence_ = 0; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.bitcoinj.wallet.Protos.TransactionInput.getDescriptor(); - } - - public org.bitcoinj.wallet.Protos.TransactionInput getDefaultInstanceForType() { - return org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance(); - } - - public org.bitcoinj.wallet.Protos.TransactionInput build() { - org.bitcoinj.wallet.Protos.TransactionInput result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private org.bitcoinj.wallet.Protos.TransactionInput buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.TransactionInput result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoinj.wallet.Protos.TransactionInput buildPartial() { - org.bitcoinj.wallet.Protos.TransactionInput result = new org.bitcoinj.wallet.Protos.TransactionInput(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.transactionOutPointHash_ = transactionOutPointHash_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.transactionOutPointIndex_ = transactionOutPointIndex_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.scriptBytes_ = scriptBytes_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.sequence_ = sequence_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoinj.wallet.Protos.TransactionInput) { - return mergeFrom((org.bitcoinj.wallet.Protos.TransactionInput)other); - } else { - super.mergeFrom(other); - 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()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasTransactionOutPointHash()) { - - return false; - } - if (!hasTransactionOutPointIndex()) { - - return false; - } - if (!hasScriptBytes()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -2188,211 +2698,156 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } - - private int bitField0_; - - // required bytes transaction_out_point_hash = 1; - private com.google.protobuf.ByteString transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasTransactionOutPointHash() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getTransactionOutPointHash() { - return transactionOutPointHash_; - } - public Builder setTransactionOutPointHash(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - transactionOutPointHash_ = value; - onChanged(); - return this; - } - public Builder clearTransactionOutPointHash() { - bitField0_ = (bitField0_ & ~0x00000001); - transactionOutPointHash_ = getDefaultInstance().getTransactionOutPointHash(); - onChanged(); - return this; - } - - // required uint32 transaction_out_point_index = 2; - private int transactionOutPointIndex_ ; - public boolean hasTransactionOutPointIndex() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getTransactionOutPointIndex() { - return transactionOutPointIndex_; - } - public Builder setTransactionOutPointIndex(int value) { - bitField0_ |= 0x00000002; - transactionOutPointIndex_ = value; - onChanged(); - return this; - } - public Builder clearTransactionOutPointIndex() { - bitField0_ = (bitField0_ & ~0x00000002); - transactionOutPointIndex_ = 0; - onChanged(); - return this; - } - - // required bytes script_bytes = 3; - private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasScriptBytes() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public com.google.protobuf.ByteString getScriptBytes() { - return scriptBytes_; - } - public Builder setScriptBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - scriptBytes_ = value; - onChanged(); - return this; - } - public Builder clearScriptBytes() { - bitField0_ = (bitField0_ & ~0x00000004); - scriptBytes_ = getDefaultInstance().getScriptBytes(); - onChanged(); - return this; - } - - // optional uint32 sequence = 4; - private int sequence_ ; - public boolean hasSequence() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public int getSequence() { - return sequence_; - } - public Builder setSequence(int value) { - bitField0_ |= 0x00000008; - sequence_ = value; - onChanged(); - return this; - } - public Builder clearSequence() { - bitField0_ = (bitField0_ & ~0x00000008); - sequence_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:wallet.TransactionInput) } - - static { - defaultInstance = new TransactionInput(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:wallet.TransactionInput) - } - - public interface TransactionOutputOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required int64 value = 1; - boolean hasValue(); - long getValue(); - - // required bytes script_bytes = 2; - boolean hasScriptBytes(); - com.google.protobuf.ByteString getScriptBytes(); - - // optional bytes spent_by_transaction_hash = 3; - boolean hasSpentByTransactionHash(); - com.google.protobuf.ByteString getSpentByTransactionHash(); - - // optional int32 spent_by_transaction_index = 4; - boolean hasSpentByTransactionIndex(); - int getSpentByTransactionIndex(); - } - public static final class TransactionOutput extends - com.google.protobuf.GeneratedMessage - implements TransactionOutputOrBuilder { - // Use TransactionOutput.newBuilder() to construct. - private TransactionOutput(Builder builder) { - super(builder); - } - private TransactionOutput(boolean noInit) {} - - private static final TransactionOutput defaultInstance; - public static TransactionOutput getDefaultInstance() { - return defaultInstance; - } - - public TransactionOutput getDefaultInstanceForType() { - return defaultInstance; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.TransactionInput.class, org.bitcoinj.wallet.Protos.TransactionInput.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TransactionInput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionInput(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; - // required int64 value = 1; - public static final int VALUE_FIELD_NUMBER = 1; - private long value_; - public boolean hasValue() { + // required bytes transaction_out_point_hash = 1; + public static final int TRANSACTION_OUT_POINT_HASH_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString transactionOutPointHash_; + /** + * required bytes transaction_out_point_hash = 1; + * + *
+     * Hash of the transaction this input is using.
+     * 
+ */ + public boolean hasTransactionOutPointHash() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public long getValue() { - return value_; + /** + * required bytes transaction_out_point_hash = 1; + * + *
+     * Hash of the transaction this input is using.
+     * 
+ */ + public com.google.protobuf.ByteString getTransactionOutPointHash() { + return transactionOutPointHash_; } - - // required bytes script_bytes = 2; - public static final int SCRIPT_BYTES_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString scriptBytes_; - public boolean hasScriptBytes() { + + // required uint32 transaction_out_point_index = 2; + public static final int TRANSACTION_OUT_POINT_INDEX_FIELD_NUMBER = 2; + private int transactionOutPointIndex_; + /** + * required uint32 transaction_out_point_index = 2; + * + *
+     * Index of transaction output used by this input.
+     * 
+ */ + public boolean hasTransactionOutPointIndex() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required uint32 transaction_out_point_index = 2; + * + *
+     * Index of transaction output used by this input.
+     * 
+ */ + public int getTransactionOutPointIndex() { + return transactionOutPointIndex_; + } + + // required bytes script_bytes = 3; + public static final int SCRIPT_BYTES_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString scriptBytes_; + /** + * required bytes script_bytes = 3; + * + *
+     * Script that contains the signatures/pubkeys.
+     * 
+ */ + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes script_bytes = 3; + * + *
+     * Script that contains the signatures/pubkeys.
+     * 
+ */ public com.google.protobuf.ByteString getScriptBytes() { return scriptBytes_; } - - // optional bytes spent_by_transaction_hash = 3; - public static final int SPENT_BY_TRANSACTION_HASH_FIELD_NUMBER = 3; - private com.google.protobuf.ByteString spentByTransactionHash_; - public boolean hasSpentByTransactionHash() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public com.google.protobuf.ByteString getSpentByTransactionHash() { - return spentByTransactionHash_; - } - - // optional int32 spent_by_transaction_index = 4; - public static final int SPENT_BY_TRANSACTION_INDEX_FIELD_NUMBER = 4; - private int spentByTransactionIndex_; - public boolean hasSpentByTransactionIndex() { + + // optional uint32 sequence = 4; + public static final int SEQUENCE_FIELD_NUMBER = 4; + private int sequence_; + /** + * optional uint32 sequence = 4; + * + *
+     * Sequence number. Currently unused, but intended for contracts in future.
+     * 
+ */ + public boolean hasSequence() { return ((bitField0_ & 0x00000008) == 0x00000008); } - public int getSpentByTransactionIndex() { - return spentByTransactionIndex_; + /** + * optional uint32 sequence = 4; + * + *
+     * Sequence number. Currently unused, but intended for contracts in future.
+     * 
+ */ + public int getSequence() { + return sequence_; } - + private void initFields() { - value_ = 0L; + transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; + transactionOutPointIndex_ = 0; scriptBytes_ = com.google.protobuf.ByteString.EMPTY; - spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; - spentByTransactionIndex_ = 0; + sequence_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - - if (!hasValue()) { + + if (!hasTransactionOutPointHash()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasTransactionOutPointIndex()) { memoizedIsInitialized = 0; return false; } @@ -2403,158 +2858,150 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt64(1, value_); + output.writeBytes(1, transactionOutPointHash_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, scriptBytes_); + output.writeUInt32(2, transactionOutPointIndex_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, spentByTransactionHash_); + output.writeBytes(3, scriptBytes_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, spentByTransactionIndex_); + output.writeUInt32(4, sequence_); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeInt64Size(1, value_); + .computeBytesSize(1, transactionOutPointHash_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, scriptBytes_); + .computeUInt32Size(2, transactionOutPointIndex_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, spentByTransactionHash_); + .computeBytesSize(3, scriptBytes_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, spentByTransactionIndex_); + .computeUInt32Size(4, sequence_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(byte[] data) + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(java.io.InputStream input) + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom(java.io.InputStream input) + public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom( + public static org.bitcoinj.wallet.Protos.TransactionInput parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } - public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + public static org.bitcoinj.wallet.Protos.TransactionInput parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionOutput prototype) { + public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionInput prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.TransactionInput} + */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder { + implements org.bitcoinj.wallet.Protos.TransactionInputOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.TransactionInput.class, org.bitcoinj.wallet.Protos.TransactionInput.Builder.class); } - - // Construct using org.bitcoinj.wallet.Protos.TransactionOutput.newBuilder() + + // Construct using org.bitcoinj.wallet.Protos.TransactionInput.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -2565,105 +3012,99 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); - value_ = 0L; + transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); - scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + transactionOutPointIndex_ = 0; bitField0_ = (bitField0_ & ~0x00000002); - spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000004); - spentByTransactionIndex_ = 0; + sequence_ = 0; bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.TransactionOutput.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionInput_descriptor; } - - public org.bitcoinj.wallet.Protos.TransactionOutput getDefaultInstanceForType() { - return org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance(); + + public org.bitcoinj.wallet.Protos.TransactionInput getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance(); } - - public org.bitcoinj.wallet.Protos.TransactionOutput build() { - org.bitcoinj.wallet.Protos.TransactionOutput result = buildPartial(); + + public org.bitcoinj.wallet.Protos.TransactionInput build() { + org.bitcoinj.wallet.Protos.TransactionInput result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - - private org.bitcoinj.wallet.Protos.TransactionOutput buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.TransactionOutput result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoinj.wallet.Protos.TransactionOutput buildPartial() { - org.bitcoinj.wallet.Protos.TransactionOutput result = new org.bitcoinj.wallet.Protos.TransactionOutput(this); + + public org.bitcoinj.wallet.Protos.TransactionInput buildPartial() { + org.bitcoinj.wallet.Protos.TransactionInput result = new org.bitcoinj.wallet.Protos.TransactionInput(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.value_ = value_; + result.transactionOutPointHash_ = transactionOutPointHash_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.scriptBytes_ = scriptBytes_; + result.transactionOutPointIndex_ = transactionOutPointIndex_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.spentByTransactionHash_ = spentByTransactionHash_; + result.scriptBytes_ = scriptBytes_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } - result.spentByTransactionIndex_ = spentByTransactionIndex_; + result.sequence_ = sequence_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoinj.wallet.Protos.TransactionOutput) { - return mergeFrom((org.bitcoinj.wallet.Protos.TransactionOutput)other); + if (other instanceof org.bitcoinj.wallet.Protos.TransactionInput) { + return mergeFrom((org.bitcoinj.wallet.Protos.TransactionInput)other); } else { super.mergeFrom(other); 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()); + + 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.hasSpentByTransactionHash()) { - setSpentByTransactionHash(other.getSpentByTransactionHash()); - } - if (other.hasSpentByTransactionIndex()) { - setSpentByTransactionIndex(other.getSpentByTransactionIndex()); + if (other.hasSequence()) { + setSequence(other.getSequence()); } this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { - if (!hasValue()) { + if (!hasTransactionOutPointHash()) { + + return false; + } + if (!hasTransactionOutPointIndex()) { return false; } @@ -2673,27 +3114,354 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + 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_; + + // required bytes transaction_out_point_hash = 1; + private com.google.protobuf.ByteString transactionOutPointHash_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes transaction_out_point_hash = 1; + * + *
+       * Hash of the transaction this input is using.
+       * 
+ */ + public boolean hasTransactionOutPointHash() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes transaction_out_point_hash = 1; + * + *
+       * Hash of the transaction this input is using.
+       * 
+ */ + public com.google.protobuf.ByteString getTransactionOutPointHash() { + return transactionOutPointHash_; + } + /** + * required bytes transaction_out_point_hash = 1; + * + *
+       * Hash of the transaction this input is using.
+       * 
+ */ + public Builder setTransactionOutPointHash(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + transactionOutPointHash_ = value; + onChanged(); + return this; + } + /** + * required bytes transaction_out_point_hash = 1; + * + *
+       * Hash of the transaction this input is using.
+       * 
+ */ + public Builder clearTransactionOutPointHash() { + bitField0_ = (bitField0_ & ~0x00000001); + transactionOutPointHash_ = getDefaultInstance().getTransactionOutPointHash(); + onChanged(); + return this; + } + + // required uint32 transaction_out_point_index = 2; + private int transactionOutPointIndex_ ; + /** + * required uint32 transaction_out_point_index = 2; + * + *
+       * Index of transaction output used by this input.
+       * 
+ */ + public boolean hasTransactionOutPointIndex() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required uint32 transaction_out_point_index = 2; + * + *
+       * Index of transaction output used by this input.
+       * 
+ */ + public int getTransactionOutPointIndex() { + return transactionOutPointIndex_; + } + /** + * required uint32 transaction_out_point_index = 2; + * + *
+       * Index of transaction output used by this input.
+       * 
+ */ + public Builder setTransactionOutPointIndex(int value) { + bitField0_ |= 0x00000002; + transactionOutPointIndex_ = value; + onChanged(); + return this; + } + /** + * required uint32 transaction_out_point_index = 2; + * + *
+       * Index of transaction output used by this input.
+       * 
+ */ + public Builder clearTransactionOutPointIndex() { + bitField0_ = (bitField0_ & ~0x00000002); + transactionOutPointIndex_ = 0; + onChanged(); + return this; + } + + // required bytes script_bytes = 3; + private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes script_bytes = 3; + * + *
+       * Script that contains the signatures/pubkeys.
+       * 
+ */ + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bytes script_bytes = 3; + * + *
+       * Script that contains the signatures/pubkeys.
+       * 
+ */ + public com.google.protobuf.ByteString getScriptBytes() { + return scriptBytes_; + } + /** + * required bytes script_bytes = 3; + * + *
+       * Script that contains the signatures/pubkeys.
+       * 
+ */ + public Builder setScriptBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + scriptBytes_ = value; + onChanged(); + return this; + } + /** + * required bytes script_bytes = 3; + * + *
+       * Script that contains the signatures/pubkeys.
+       * 
+ */ + public Builder clearScriptBytes() { + bitField0_ = (bitField0_ & ~0x00000004); + scriptBytes_ = getDefaultInstance().getScriptBytes(); + onChanged(); + return this; + } + + // optional uint32 sequence = 4; + private int sequence_ ; + /** + * optional uint32 sequence = 4; + * + *
+       * Sequence number. Currently unused, but intended for contracts in future.
+       * 
+ */ + public boolean hasSequence() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional uint32 sequence = 4; + * + *
+       * Sequence number. Currently unused, but intended for contracts in future.
+       * 
+ */ + public int getSequence() { + return sequence_; + } + /** + * optional uint32 sequence = 4; + * + *
+       * Sequence number. Currently unused, but intended for contracts in future.
+       * 
+ */ + public Builder setSequence(int value) { + bitField0_ |= 0x00000008; + sequence_ = value; + onChanged(); + return this; + } + /** + * optional uint32 sequence = 4; + * + *
+       * Sequence number. Currently unused, but intended for contracts in future.
+       * 
+ */ + public Builder clearSequence() { + bitField0_ = (bitField0_ & ~0x00000008); + sequence_ = 0; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.TransactionInput) + } + + static { + defaultInstance = new TransactionInput(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.TransactionInput) + } + + public interface TransactionOutputOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required int64 value = 1; + /** + * required int64 value = 1; + */ + boolean hasValue(); + /** + * required int64 value = 1; + */ + long getValue(); + + // required bytes script_bytes = 2; + /** + * required bytes script_bytes = 2; + * + *
+     * script of transaction output
+     * 
+ */ + boolean hasScriptBytes(); + /** + * required bytes script_bytes = 2; + * + *
+     * script of transaction output
+     * 
+ */ + com.google.protobuf.ByteString getScriptBytes(); + + // optional bytes spent_by_transaction_hash = 3; + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+     * If spent, the hash of the transaction doing the spend.
+     * 
+ */ + boolean hasSpentByTransactionHash(); + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+     * If spent, the hash of the transaction doing the spend.
+     * 
+ */ + com.google.protobuf.ByteString getSpentByTransactionHash(); + + // optional int32 spent_by_transaction_index = 4; + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+     * If spent, the index of the transaction input of the transaction doing the spend.
+     * 
+ */ + boolean hasSpentByTransactionIndex(); + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+     * If spent, the index of the transaction input of the transaction doing the spend.
+     * 
+ */ + int getSpentByTransactionIndex(); + } + /** + * Protobuf type {@code wallet.TransactionOutput} + */ + public static final class TransactionOutput extends + com.google.protobuf.GeneratedMessage + implements TransactionOutputOrBuilder { + // Use TransactionOutput.newBuilder() to construct. + private TransactionOutput(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private TransactionOutput(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final TransactionOutput defaultInstance; + public static TransactionOutput getDefaultInstance() { + return defaultInstance; + } + + public TransactionOutput getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TransactionOutput( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -2719,39 +3487,488 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.TransactionOutput.class, org.bitcoinj.wallet.Protos.TransactionOutput.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TransactionOutput parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionOutput(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required int64 value = 1; + public static final int VALUE_FIELD_NUMBER = 1; + private long value_; + /** + * required int64 value = 1; + */ + public boolean hasValue() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required int64 value = 1; + */ + public long getValue() { + return value_; + } + + // required bytes script_bytes = 2; + public static final int SCRIPT_BYTES_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString scriptBytes_; + /** + * required bytes script_bytes = 2; + * + *
+     * script of transaction output
+     * 
+ */ + public boolean hasScriptBytes() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes script_bytes = 2; + * + *
+     * script of transaction output
+     * 
+ */ + public com.google.protobuf.ByteString getScriptBytes() { + return scriptBytes_; + } + + // optional bytes spent_by_transaction_hash = 3; + public static final int SPENT_BY_TRANSACTION_HASH_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString spentByTransactionHash_; + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+     * If spent, the hash of the transaction doing the spend.
+     * 
+ */ + public boolean hasSpentByTransactionHash() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+     * If spent, the hash of the transaction doing the spend.
+     * 
+ */ + public com.google.protobuf.ByteString getSpentByTransactionHash() { + return spentByTransactionHash_; + } + + // optional int32 spent_by_transaction_index = 4; + public static final int SPENT_BY_TRANSACTION_INDEX_FIELD_NUMBER = 4; + private int spentByTransactionIndex_; + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+     * If spent, the index of the transaction input of the transaction doing the spend.
+     * 
+ */ + public boolean hasSpentByTransactionIndex() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+     * If spent, the index of the transaction input of the transaction doing the spend.
+     * 
+ */ + public int getSpentByTransactionIndex() { + return spentByTransactionIndex_; + } + + private void initFields() { + value_ = 0L; + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + spentByTransactionIndex_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasScriptBytes()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt64(1, value_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, scriptBytes_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBytes(3, spentByTransactionHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, spentByTransactionIndex_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, value_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, scriptBytes_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, spentByTransactionHash_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, spentByTransactionIndex_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoinj.wallet.Protos.TransactionOutput parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionOutput prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code wallet.TransactionOutput} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.TransactionOutput.class, org.bitcoinj.wallet.Protos.TransactionOutput.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.TransactionOutput.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + value_ = 0L; + bitField0_ = (bitField0_ & ~0x00000001); + scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + spentByTransactionIndex_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionOutput_descriptor; + } + + public org.bitcoinj.wallet.Protos.TransactionOutput getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.TransactionOutput build() { + org.bitcoinj.wallet.Protos.TransactionOutput result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.TransactionOutput buildPartial() { + org.bitcoinj.wallet.Protos.TransactionOutput result = new org.bitcoinj.wallet.Protos.TransactionOutput(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.value_ = value_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.scriptBytes_ = scriptBytes_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.spentByTransactionHash_ = spentByTransactionHash_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.spentByTransactionIndex_ = spentByTransactionIndex_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.TransactionOutput) { + return mergeFrom((org.bitcoinj.wallet.Protos.TransactionOutput)other); + } else { + super.mergeFrom(other); + 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 final boolean isInitialized() { + if (!hasValue()) { + + return false; + } + if (!hasScriptBytes()) { + + return false; + } + return true; + } + + 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_; - + // required int64 value = 1; private long value_ ; + /** + * required int64 value = 1; + */ public boolean hasValue() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int64 value = 1; + */ public long getValue() { return value_; } + /** + * required int64 value = 1; + */ public Builder setValue(long value) { bitField0_ |= 0x00000001; value_ = value; onChanged(); return this; } + /** + * required int64 value = 1; + */ public Builder clearValue() { bitField0_ = (bitField0_ & ~0x00000001); value_ = 0L; onChanged(); return this; } - + // required bytes script_bytes = 2; private com.google.protobuf.ByteString scriptBytes_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes script_bytes = 2; + * + *
+       * script of transaction output
+       * 
+ */ public boolean hasScriptBytes() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes script_bytes = 2; + * + *
+       * script of transaction output
+       * 
+ */ public com.google.protobuf.ByteString getScriptBytes() { return scriptBytes_; } + /** + * required bytes script_bytes = 2; + * + *
+       * script of transaction output
+       * 
+ */ public Builder setScriptBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -2761,21 +3978,49 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes script_bytes = 2; + * + *
+       * script of transaction output
+       * 
+ */ public Builder clearScriptBytes() { bitField0_ = (bitField0_ & ~0x00000002); scriptBytes_ = getDefaultInstance().getScriptBytes(); onChanged(); return this; } - + // optional bytes spent_by_transaction_hash = 3; private com.google.protobuf.ByteString spentByTransactionHash_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+       * If spent, the hash of the transaction doing the spend.
+       * 
+ */ public boolean hasSpentByTransactionHash() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+       * If spent, the hash of the transaction doing the spend.
+       * 
+ */ public com.google.protobuf.ByteString getSpentByTransactionHash() { return spentByTransactionHash_; } + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+       * If spent, the hash of the transaction doing the spend.
+       * 
+ */ public Builder setSpentByTransactionHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -2785,128 +4030,450 @@ public final class Protos { onChanged(); return this; } + /** + * optional bytes spent_by_transaction_hash = 3; + * + *
+       * If spent, the hash of the transaction doing the spend.
+       * 
+ */ public Builder clearSpentByTransactionHash() { bitField0_ = (bitField0_ & ~0x00000004); spentByTransactionHash_ = getDefaultInstance().getSpentByTransactionHash(); onChanged(); return this; } - + // optional int32 spent_by_transaction_index = 4; private int spentByTransactionIndex_ ; + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+       * If spent, the index of the transaction input of the transaction doing the spend.
+       * 
+ */ public boolean hasSpentByTransactionIndex() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+       * If spent, the index of the transaction input of the transaction doing the spend.
+       * 
+ */ public int getSpentByTransactionIndex() { return spentByTransactionIndex_; } + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+       * If spent, the index of the transaction input of the transaction doing the spend.
+       * 
+ */ public Builder setSpentByTransactionIndex(int value) { bitField0_ |= 0x00000008; spentByTransactionIndex_ = value; onChanged(); return this; } + /** + * optional int32 spent_by_transaction_index = 4; + * + *
+       * If spent, the index of the transaction input of the transaction doing the spend.
+       * 
+ */ public Builder clearSpentByTransactionIndex() { bitField0_ = (bitField0_ & ~0x00000008); spentByTransactionIndex_ = 0; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.TransactionOutput) } - + static { defaultInstance = new TransactionOutput(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.TransactionOutput) } - + public interface TransactionConfidenceOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // optional .wallet.TransactionConfidence.Type type = 1; + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+     * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+     * 
+ */ boolean hasType(); + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+     * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+     * 
+ */ org.bitcoinj.wallet.Protos.TransactionConfidence.Type getType(); - + // optional int32 appeared_at_height = 2; + /** + * optional int32 appeared_at_height = 2; + * + *
+     * If type == BUILDING then this is the chain height at which the transaction was included.
+     * 
+ */ boolean hasAppearedAtHeight(); + /** + * optional int32 appeared_at_height = 2; + * + *
+     * If type == BUILDING then this is the chain height at which the transaction was included.
+     * 
+ */ int getAppearedAtHeight(); - + // optional bytes overriding_transaction = 3; + /** + * optional bytes overriding_transaction = 3; + * + *
+     * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+     * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+     * bother to track them all, just the first. This only makes sense if type = DEAD.
+     * 
+ */ boolean hasOverridingTransaction(); + /** + * optional bytes overriding_transaction = 3; + * + *
+     * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+     * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+     * bother to track them all, just the first. This only makes sense if type = DEAD.
+     * 
+ */ com.google.protobuf.ByteString getOverridingTransaction(); - + // optional int32 depth = 4; + /** + * optional int32 depth = 4; + * + *
+     * If type == BUILDING then this is the depth of the transaction in the blockchain.
+     * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+     * 
+ */ boolean hasDepth(); + /** + * optional int32 depth = 4; + * + *
+     * If type == BUILDING then this is the depth of the transaction in the blockchain.
+     * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+     * 
+ */ int getDepth(); - + // optional int64 work_done = 5; + /** + * optional int64 work_done = 5; + * + *
+     * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+     * all blocks that bury it.
+     * 
+ */ boolean hasWorkDone(); + /** + * optional int64 work_done = 5; + * + *
+     * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+     * all blocks that bury it.
+     * 
+ */ long getWorkDone(); - + // repeated .wallet.PeerAddress broadcast_by = 6; + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ java.util.List getBroadcastByList(); + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ org.bitcoinj.wallet.Protos.PeerAddress getBroadcastBy(int index); + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ int getBroadcastByCount(); + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ java.util.List getBroadcastByOrBuilderList(); + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ org.bitcoinj.wallet.Protos.PeerAddressOrBuilder getBroadcastByOrBuilder( int index); - + // optional .wallet.TransactionConfidence.Source source = 7; + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ boolean hasSource(); + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ org.bitcoinj.wallet.Protos.TransactionConfidence.Source getSource(); } + /** + * Protobuf type {@code wallet.TransactionConfidence} + * + *
+   **
+   * A description of the confidence we have that a transaction cannot be reversed in the future.
+   *
+   * Parsing should be lenient, since this could change for different applications yet we should
+   * maintain backward compatibility.
+   * 
+ */ public static final class TransactionConfidence extends com.google.protobuf.GeneratedMessage implements TransactionConfidenceOrBuilder { // Use TransactionConfidence.newBuilder() to construct. - private TransactionConfidence(Builder builder) { + private TransactionConfidence(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private TransactionConfidence(boolean noInit) {} - + private TransactionConfidence(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final TransactionConfidence defaultInstance; public static TransactionConfidence getDefaultInstance() { return defaultInstance; } - + public TransactionConfidence getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TransactionConfidence( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.TransactionConfidence.Type value = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + type_ = value; + } + break; + } + case 16: { + bitField0_ |= 0x00000002; + appearedAtHeight_ = input.readInt32(); + break; + } + case 26: { + bitField0_ |= 0x00000004; + overridingTransaction_ = input.readBytes(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + depth_ = input.readInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + workDone_ = input.readInt64(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + broadcastBy_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + broadcastBy_.add(input.readMessage(org.bitcoinj.wallet.Protos.PeerAddress.PARSER, extensionRegistry)); + break; + } + case 56: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.TransactionConfidence.Source value = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(7, rawValue); + } else { + bitField0_ |= 0x00000020; + source_ = value; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + broadcastBy_ = java.util.Collections.unmodifiableList(broadcastBy_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.TransactionConfidence.class, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public TransactionConfidence parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionConfidence(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code wallet.TransactionConfidence.Type} + */ public enum Type implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + */ UNKNOWN(0, 0), + /** + * BUILDING = 1; + * + *
+       * In best chain.  If and only if appeared_at_height is present.
+       * 
+ */ BUILDING(1, 1), + /** + * PENDING = 2; + * + *
+       * Unconfirmed and sitting in the networks memory pools, waiting to be included in the chain.
+       * 
+ */ PENDING(2, 2), + /** + * NOT_IN_BEST_CHAIN = 3; + * + *
+       * Deprecated: equivalent to PENDING.
+       * 
+ */ NOT_IN_BEST_CHAIN(3, 3), + /** + * DEAD = 4; + * + *
+       * Either if overriding_transaction is present or transaction is dead coinbase
+       * 
+ */ DEAD(4, 4), ; - + + /** + * UNKNOWN = 0; + */ public static final int UNKNOWN_VALUE = 0; + /** + * BUILDING = 1; + * + *
+       * In best chain.  If and only if appeared_at_height is present.
+       * 
+ */ public static final int BUILDING_VALUE = 1; + /** + * PENDING = 2; + * + *
+       * Unconfirmed and sitting in the networks memory pools, waiting to be included in the chain.
+       * 
+ */ public static final int PENDING_VALUE = 2; + /** + * NOT_IN_BEST_CHAIN = 3; + * + *
+       * Deprecated: equivalent to PENDING.
+       * 
+ */ public static final int NOT_IN_BEST_CHAIN_VALUE = 3; + /** + * DEAD = 4; + * + *
+       * Either if overriding_transaction is present or transaction is dead coinbase
+       * 
+ */ public static final int DEAD_VALUE = 4; - - + + public final int getNumber() { return value; } - + public static Type valueOf(int value) { switch (value) { case 0: return UNKNOWN; @@ -2917,7 +4484,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -2929,7 +4496,7 @@ public final class Protos { return Type.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -2942,11 +4509,9 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.TransactionConfidence.getDescriptor().getEnumTypes().get(0); } - - private static final Type[] VALUES = { - UNKNOWN, BUILDING, PENDING, NOT_IN_BEST_CHAIN, DEAD, - }; - + + private static final Type[] VALUES = values(); + public static Type valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -2955,32 +4520,81 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private Type(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:wallet.TransactionConfidence.Type) } - + + /** + * Protobuf enum {@code wallet.TransactionConfidence.Source} + * + *
+     * Where did we get this transaction from? Knowing the source may help us to risk analyze pending transactions.
+     * 
+ */ public enum Source implements com.google.protobuf.ProtocolMessageEnum { + /** + * SOURCE_UNKNOWN = 0; + * + *
+       * We don't know where it came from, or this is a wallet from the future.
+       * 
+ */ SOURCE_UNKNOWN(0, 0), + /** + * SOURCE_NETWORK = 1; + * + *
+       * We received it from a network broadcast. This is the normal way to get payments.
+       * 
+ */ SOURCE_NETWORK(1, 1), + /** + * SOURCE_SELF = 2; + * + *
+       * We made it ourselves, so we know it should be valid.
+       * 
+ */ SOURCE_SELF(2, 2), ; - + + /** + * SOURCE_UNKNOWN = 0; + * + *
+       * We don't know where it came from, or this is a wallet from the future.
+       * 
+ */ public static final int SOURCE_UNKNOWN_VALUE = 0; + /** + * SOURCE_NETWORK = 1; + * + *
+       * We received it from a network broadcast. This is the normal way to get payments.
+       * 
+ */ public static final int SOURCE_NETWORK_VALUE = 1; + /** + * SOURCE_SELF = 2; + * + *
+       * We made it ourselves, so we know it should be valid.
+       * 
+ */ public static final int SOURCE_SELF_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static Source valueOf(int value) { switch (value) { case 0: return SOURCE_UNKNOWN; @@ -2989,7 +4603,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -3001,7 +4615,7 @@ public final class Protos { return Source.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -3014,11 +4628,9 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.TransactionConfidence.getDescriptor().getEnumTypes().get(1); } - - private static final Source[] VALUES = { - SOURCE_UNKNOWN, SOURCE_NETWORK, SOURCE_SELF, - }; - + + private static final Source[] VALUES = values(); + public static Source valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -3027,100 +4639,199 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private Source(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:wallet.TransactionConfidence.Source) } - + private int bitField0_; // optional .wallet.TransactionConfidence.Type type = 1; public static final int TYPE_FIELD_NUMBER = 1; private org.bitcoinj.wallet.Protos.TransactionConfidence.Type type_; + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+     * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+     * 
+ */ public boolean hasType() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+     * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+     * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidence.Type getType() { return type_; } - + // optional int32 appeared_at_height = 2; public static final int APPEARED_AT_HEIGHT_FIELD_NUMBER = 2; private int appearedAtHeight_; + /** + * optional int32 appeared_at_height = 2; + * + *
+     * If type == BUILDING then this is the chain height at which the transaction was included.
+     * 
+ */ public boolean hasAppearedAtHeight() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional int32 appeared_at_height = 2; + * + *
+     * If type == BUILDING then this is the chain height at which the transaction was included.
+     * 
+ */ public int getAppearedAtHeight() { return appearedAtHeight_; } - + // optional bytes overriding_transaction = 3; public static final int OVERRIDING_TRANSACTION_FIELD_NUMBER = 3; private com.google.protobuf.ByteString overridingTransaction_; + /** + * optional bytes overriding_transaction = 3; + * + *
+     * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+     * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+     * bother to track them all, just the first. This only makes sense if type = DEAD.
+     * 
+ */ public boolean hasOverridingTransaction() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional bytes overriding_transaction = 3; + * + *
+     * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+     * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+     * bother to track them all, just the first. This only makes sense if type = DEAD.
+     * 
+ */ public com.google.protobuf.ByteString getOverridingTransaction() { return overridingTransaction_; } - + // optional int32 depth = 4; public static final int DEPTH_FIELD_NUMBER = 4; private int depth_; + /** + * optional int32 depth = 4; + * + *
+     * If type == BUILDING then this is the depth of the transaction in the blockchain.
+     * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+     * 
+ */ public boolean hasDepth() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional int32 depth = 4; + * + *
+     * If type == BUILDING then this is the depth of the transaction in the blockchain.
+     * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+     * 
+ */ public int getDepth() { return depth_; } - + // optional int64 work_done = 5; public static final int WORK_DONE_FIELD_NUMBER = 5; private long workDone_; + /** + * optional int64 work_done = 5; + * + *
+     * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+     * all blocks that bury it.
+     * 
+ */ public boolean hasWorkDone() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional int64 work_done = 5; + * + *
+     * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+     * all blocks that bury it.
+     * 
+ */ public long getWorkDone() { return workDone_; } - + // repeated .wallet.PeerAddress broadcast_by = 6; public static final int BROADCAST_BY_FIELD_NUMBER = 6; private java.util.List broadcastBy_; + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public java.util.List getBroadcastByList() { return broadcastBy_; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public java.util.List getBroadcastByOrBuilderList() { return broadcastBy_; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public int getBroadcastByCount() { return broadcastBy_.size(); } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddress getBroadcastBy(int index) { return broadcastBy_.get(index); } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddressOrBuilder getBroadcastByOrBuilder( int index) { return broadcastBy_.get(index); } - + // optional .wallet.TransactionConfidence.Source source = 7; public static final int SOURCE_FIELD_NUMBER = 7; private org.bitcoinj.wallet.Protos.TransactionConfidence.Source source_; + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ public boolean hasSource() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ public org.bitcoinj.wallet.Protos.TransactionConfidence.Source getSource() { return source_; } - + private void initFields() { type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN; appearedAtHeight_ = 0; @@ -3134,7 +4845,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + for (int i = 0; i < getBroadcastByCount(); i++) { if (!getBroadcastBy(i).isInitialized()) { memoizedIsInitialized = 0; @@ -3144,7 +4855,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -3171,12 +4882,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -3210,94 +4921,91 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.TransactionConfidence parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoinj.wallet.Protos.TransactionConfidence prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.TransactionConfidence} + * + *
+     **
+     * A description of the confidence we have that a transaction cannot be reversed in the future.
+     *
+     * Parsing should be lenient, since this could change for different applications yet we should
+     * maintain backward compatibility.
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder { @@ -3305,18 +5013,21 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.TransactionConfidence.class, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder.class); } - + // Construct using org.bitcoinj.wallet.Protos.TransactionConfidence.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3328,7 +5039,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN; @@ -3351,20 +5062,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000040); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.TransactionConfidence.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_TransactionConfidence_descriptor; } - + public org.bitcoinj.wallet.Protos.TransactionConfidence getDefaultInstanceForType() { return org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance(); } - + public org.bitcoinj.wallet.Protos.TransactionConfidence build() { org.bitcoinj.wallet.Protos.TransactionConfidence result = buildPartial(); if (!result.isInitialized()) { @@ -3372,17 +5083,7 @@ public final class Protos { } return result; } - - private org.bitcoinj.wallet.Protos.TransactionConfidence buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.TransactionConfidence result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoinj.wallet.Protos.TransactionConfidence buildPartial() { org.bitcoinj.wallet.Protos.TransactionConfidence result = new org.bitcoinj.wallet.Protos.TransactionConfidence(this); int from_bitField0_ = bitField0_; @@ -3424,7 +5125,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoinj.wallet.Protos.TransactionConfidence) { return mergeFrom((org.bitcoinj.wallet.Protos.TransactionConfidence)other); @@ -3433,7 +5134,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoinj.wallet.Protos.TransactionConfidence other) { if (other == org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance()) return this; if (other.hasType()) { @@ -3483,7 +5184,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { for (int i = 0; i < getBroadcastByCount(); i++) { if (!getBroadcastBy(i).isInitialized()) { @@ -3493,92 +5194,55 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - org.bitcoinj.wallet.Protos.TransactionConfidence.Type value = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(1, rawValue); - } else { - bitField0_ |= 0x00000001; - type_ = value; - } - break; - } - case 16: { - bitField0_ |= 0x00000002; - appearedAtHeight_ = input.readInt32(); - break; - } - case 26: { - bitField0_ |= 0x00000004; - overridingTransaction_ = input.readBytes(); - break; - } - case 32: { - bitField0_ |= 0x00000008; - depth_ = input.readInt32(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - workDone_ = input.readInt64(); - break; - } - case 50: { - org.bitcoinj.wallet.Protos.PeerAddress.Builder subBuilder = org.bitcoinj.wallet.Protos.PeerAddress.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addBroadcastBy(subBuilder.buildPartial()); - break; - } - case 56: { - int rawValue = input.readEnum(); - org.bitcoinj.wallet.Protos.TransactionConfidence.Source value = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(7, rawValue); - } else { - bitField0_ |= 0x00000040; - source_ = value; - } - break; - } + org.bitcoinj.wallet.Protos.TransactionConfidence parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.TransactionConfidence) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // optional .wallet.TransactionConfidence.Type type = 1; private org.bitcoinj.wallet.Protos.TransactionConfidence.Type type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN; + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+       * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+       * 
+ */ public boolean hasType() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+       * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+       * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidence.Type getType() { return type_; } + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+       * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+       * 
+ */ public Builder setType(org.bitcoinj.wallet.Protos.TransactionConfidence.Type value) { if (value == null) { throw new NullPointerException(); @@ -3588,42 +5252,104 @@ public final class Protos { onChanged(); return this; } + /** + * optional .wallet.TransactionConfidence.Type type = 1; + * + *
+       * This is optional in case we add confidence types to prevent parse errors - backwards compatible.
+       * 
+ */ public Builder clearType() { bitField0_ = (bitField0_ & ~0x00000001); type_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Type.UNKNOWN; onChanged(); return this; } - + // optional int32 appeared_at_height = 2; private int appearedAtHeight_ ; + /** + * optional int32 appeared_at_height = 2; + * + *
+       * If type == BUILDING then this is the chain height at which the transaction was included.
+       * 
+ */ public boolean hasAppearedAtHeight() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional int32 appeared_at_height = 2; + * + *
+       * If type == BUILDING then this is the chain height at which the transaction was included.
+       * 
+ */ public int getAppearedAtHeight() { return appearedAtHeight_; } + /** + * optional int32 appeared_at_height = 2; + * + *
+       * If type == BUILDING then this is the chain height at which the transaction was included.
+       * 
+ */ public Builder setAppearedAtHeight(int value) { bitField0_ |= 0x00000002; appearedAtHeight_ = value; onChanged(); return this; } + /** + * optional int32 appeared_at_height = 2; + * + *
+       * If type == BUILDING then this is the chain height at which the transaction was included.
+       * 
+ */ public Builder clearAppearedAtHeight() { bitField0_ = (bitField0_ & ~0x00000002); appearedAtHeight_ = 0; onChanged(); return this; } - + // optional bytes overriding_transaction = 3; private com.google.protobuf.ByteString overridingTransaction_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes overriding_transaction = 3; + * + *
+       * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+       * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+       * bother to track them all, just the first. This only makes sense if type = DEAD.
+       * 
+ */ public boolean hasOverridingTransaction() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional bytes overriding_transaction = 3; + * + *
+       * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+       * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+       * bother to track them all, just the first. This only makes sense if type = DEAD.
+       * 
+ */ public com.google.protobuf.ByteString getOverridingTransaction() { return overridingTransaction_; } + /** + * optional bytes overriding_transaction = 3; + * + *
+       * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+       * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+       * bother to track them all, just the first. This only makes sense if type = DEAD.
+       * 
+ */ public Builder setOverridingTransaction(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -3633,55 +5359,128 @@ public final class Protos { onChanged(); return this; } + /** + * optional bytes overriding_transaction = 3; + * + *
+       * If set, hash of the transaction that double spent this one into oblivion. A transaction can be double spent by
+       * multiple transactions in the case of several inputs being re-spent by several transactions but we don't
+       * bother to track them all, just the first. This only makes sense if type = DEAD.
+       * 
+ */ public Builder clearOverridingTransaction() { bitField0_ = (bitField0_ & ~0x00000004); overridingTransaction_ = getDefaultInstance().getOverridingTransaction(); onChanged(); return this; } - + // optional int32 depth = 4; private int depth_ ; + /** + * optional int32 depth = 4; + * + *
+       * If type == BUILDING then this is the depth of the transaction in the blockchain.
+       * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+       * 
+ */ public boolean hasDepth() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional int32 depth = 4; + * + *
+       * If type == BUILDING then this is the depth of the transaction in the blockchain.
+       * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+       * 
+ */ public int getDepth() { return depth_; } + /** + * optional int32 depth = 4; + * + *
+       * If type == BUILDING then this is the depth of the transaction in the blockchain.
+       * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+       * 
+ */ public Builder setDepth(int value) { bitField0_ |= 0x00000008; depth_ = value; onChanged(); return this; } + /** + * optional int32 depth = 4; + * + *
+       * If type == BUILDING then this is the depth of the transaction in the blockchain.
+       * Zero confirmations: depth = 0, one confirmation: depth = 1 etc.
+       * 
+ */ public Builder clearDepth() { bitField0_ = (bitField0_ & ~0x00000008); depth_ = 0; onChanged(); return this; } - + // optional int64 work_done = 5; private long workDone_ ; + /** + * optional int64 work_done = 5; + * + *
+       * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+       * all blocks that bury it.
+       * 
+ */ public boolean hasWorkDone() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional int64 work_done = 5; + * + *
+       * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+       * all blocks that bury it.
+       * 
+ */ public long getWorkDone() { return workDone_; } + /** + * optional int64 work_done = 5; + * + *
+       * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+       * all blocks that bury it.
+       * 
+ */ public Builder setWorkDone(long value) { bitField0_ |= 0x00000010; workDone_ = value; onChanged(); return this; } + /** + * optional int64 work_done = 5; + * + *
+       * If type == BUILDING then this is the cumulative workDone for the block the transaction appears in, together with
+       * all blocks that bury it.
+       * 
+ */ public Builder clearWorkDone() { bitField0_ = (bitField0_ & ~0x00000010); workDone_ = 0L; onChanged(); return this; } - + // repeated .wallet.PeerAddress broadcast_by = 6; private java.util.List broadcastBy_ = java.util.Collections.emptyList(); @@ -3691,10 +5490,13 @@ public final class Protos { bitField0_ |= 0x00000020; } } - + private com.google.protobuf.RepeatedFieldBuilder< org.bitcoinj.wallet.Protos.PeerAddress, org.bitcoinj.wallet.Protos.PeerAddress.Builder, org.bitcoinj.wallet.Protos.PeerAddressOrBuilder> broadcastByBuilder_; - + + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public java.util.List getBroadcastByList() { if (broadcastByBuilder_ == null) { return java.util.Collections.unmodifiableList(broadcastBy_); @@ -3702,6 +5504,9 @@ public final class Protos { return broadcastByBuilder_.getMessageList(); } } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public int getBroadcastByCount() { if (broadcastByBuilder_ == null) { return broadcastBy_.size(); @@ -3709,6 +5514,9 @@ public final class Protos { return broadcastByBuilder_.getCount(); } } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddress getBroadcastBy(int index) { if (broadcastByBuilder_ == null) { return broadcastBy_.get(index); @@ -3716,6 +5524,9 @@ public final class Protos { return broadcastByBuilder_.getMessage(index); } } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder setBroadcastBy( int index, org.bitcoinj.wallet.Protos.PeerAddress value) { if (broadcastByBuilder_ == null) { @@ -3730,6 +5541,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder setBroadcastBy( int index, org.bitcoinj.wallet.Protos.PeerAddress.Builder builderForValue) { if (broadcastByBuilder_ == null) { @@ -3741,6 +5555,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder addBroadcastBy(org.bitcoinj.wallet.Protos.PeerAddress value) { if (broadcastByBuilder_ == null) { if (value == null) { @@ -3754,6 +5571,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder addBroadcastBy( int index, org.bitcoinj.wallet.Protos.PeerAddress value) { if (broadcastByBuilder_ == null) { @@ -3768,6 +5588,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder addBroadcastBy( org.bitcoinj.wallet.Protos.PeerAddress.Builder builderForValue) { if (broadcastByBuilder_ == null) { @@ -3779,6 +5602,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder addBroadcastBy( int index, org.bitcoinj.wallet.Protos.PeerAddress.Builder builderForValue) { if (broadcastByBuilder_ == null) { @@ -3790,6 +5616,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder addAllBroadcastBy( java.lang.Iterable values) { if (broadcastByBuilder_ == null) { @@ -3801,6 +5630,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder clearBroadcastBy() { if (broadcastByBuilder_ == null) { broadcastBy_ = java.util.Collections.emptyList(); @@ -3811,6 +5643,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public Builder removeBroadcastBy(int index) { if (broadcastByBuilder_ == null) { ensureBroadcastByIsMutable(); @@ -3821,10 +5656,16 @@ public final class Protos { } return this; } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddress.Builder getBroadcastByBuilder( int index) { return getBroadcastByFieldBuilder().getBuilder(index); } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddressOrBuilder getBroadcastByOrBuilder( int index) { if (broadcastByBuilder_ == null) { @@ -3832,6 +5673,9 @@ public final class Protos { return broadcastByBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public java.util.List getBroadcastByOrBuilderList() { if (broadcastByBuilder_ != null) { @@ -3840,15 +5684,24 @@ public final class Protos { return java.util.Collections.unmodifiableList(broadcastBy_); } } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddress.Builder addBroadcastByBuilder() { return getBroadcastByFieldBuilder().addBuilder( org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()); } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public org.bitcoinj.wallet.Protos.PeerAddress.Builder addBroadcastByBuilder( int index) { return getBroadcastByFieldBuilder().addBuilder( index, org.bitcoinj.wallet.Protos.PeerAddress.getDefaultInstance()); } + /** + * repeated .wallet.PeerAddress broadcast_by = 6; + */ public java.util.List getBroadcastByBuilderList() { return getBroadcastByFieldBuilder().getBuilderList(); @@ -3867,15 +5720,24 @@ public final class Protos { } return broadcastByBuilder_; } - + // optional .wallet.TransactionConfidence.Source source = 7; private org.bitcoinj.wallet.Protos.TransactionConfidence.Source source_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.SOURCE_UNKNOWN; + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ public boolean hasSource() { return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ public org.bitcoinj.wallet.Protos.TransactionConfidence.Source getSource() { return source_; } + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ public Builder setSource(org.bitcoinj.wallet.Protos.TransactionConfidence.Source value) { if (value == null) { throw new NullPointerException(); @@ -3885,129 +5747,528 @@ public final class Protos { onChanged(); return this; } + /** + * optional .wallet.TransactionConfidence.Source source = 7; + */ public Builder clearSource() { bitField0_ = (bitField0_ & ~0x00000040); source_ = org.bitcoinj.wallet.Protos.TransactionConfidence.Source.SOURCE_UNKNOWN; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.TransactionConfidence) } - + static { defaultInstance = new TransactionConfidence(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.TransactionConfidence) } - + public interface TransactionOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required int32 version = 1; + /** + * required int32 version = 1; + * + *
+     * See Wallet.java for detailed description of pool semantics
+     * 
+ */ boolean hasVersion(); + /** + * required int32 version = 1; + * + *
+     * See Wallet.java for detailed description of pool semantics
+     * 
+ */ int getVersion(); - + // required bytes hash = 2; + /** + * required bytes hash = 2; + */ boolean hasHash(); + /** + * required bytes hash = 2; + */ com.google.protobuf.ByteString getHash(); - + // optional .wallet.Transaction.Pool pool = 3; + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+     * If pool is not present, that means either:
+     *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+     *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+     *  - Or the Pool enum got a new value which your software is too old to parse.
+     * 
+ */ boolean hasPool(); + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+     * If pool is not present, that means either:
+     *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+     *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+     *  - Or the Pool enum got a new value which your software is too old to parse.
+     * 
+ */ org.bitcoinj.wallet.Protos.Transaction.Pool getPool(); - + // optional uint32 lock_time = 4; + /** + * optional uint32 lock_time = 4; + * + *
+     * The nLockTime field is useful for contracts.
+     * 
+ */ boolean hasLockTime(); + /** + * optional uint32 lock_time = 4; + * + *
+     * The nLockTime field is useful for contracts.
+     * 
+ */ int getLockTime(); - + // optional int64 updated_at = 5; + /** + * optional int64 updated_at = 5; + * + *
+     * millis since epoch the transaction was last updated
+     * 
+ */ boolean hasUpdatedAt(); + /** + * optional int64 updated_at = 5; + * + *
+     * millis since epoch the transaction was last updated
+     * 
+ */ long getUpdatedAt(); - + // repeated .wallet.TransactionInput transaction_input = 6; + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ java.util.List getTransactionInputList(); + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index); + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ int getTransactionInputCount(); + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ java.util.List getTransactionInputOrBuilderList(); + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder( int index); - + // repeated .wallet.TransactionOutput transaction_output = 7; + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ java.util.List getTransactionOutputList(); + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index); + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ int getTransactionOutputCount(); + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ java.util.List getTransactionOutputOrBuilderList(); + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder( int index); - + // repeated bytes block_hash = 8; + /** + * repeated bytes block_hash = 8; + * + *
+     * A list of blocks in which the transaction has been observed (on any chain).
+     * 
+ */ java.util.List getBlockHashList(); + /** + * repeated bytes block_hash = 8; + * + *
+     * A list of blocks in which the transaction has been observed (on any chain).
+     * 
+ */ int getBlockHashCount(); + /** + * repeated bytes block_hash = 8; + * + *
+     * A list of blocks in which the transaction has been observed (on any chain).
+     * 
+ */ com.google.protobuf.ByteString getBlockHash(int index); - + // optional .wallet.TransactionConfidence confidence = 9; + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+     * Data describing where the transaction is in the chain.
+     * 
+ */ boolean hasConfidence(); + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+     * Data describing where the transaction is in the chain.
+     * 
+ */ org.bitcoinj.wallet.Protos.TransactionConfidence getConfidence(); + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+     * Data describing where the transaction is in the chain.
+     * 
+ */ org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder getConfidenceOrBuilder(); - + // optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ boolean hasPurpose(); + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ org.bitcoinj.wallet.Protos.Transaction.Purpose getPurpose(); } + /** + * Protobuf type {@code wallet.Transaction} + */ public static final class Transaction extends com.google.protobuf.GeneratedMessage implements TransactionOrBuilder { // Use Transaction.newBuilder() to construct. - private Transaction(Builder builder) { + private Transaction(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Transaction(boolean noInit) {} - + private Transaction(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final Transaction defaultInstance; public static Transaction getDefaultInstance() { return defaultInstance; } - + public Transaction getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Transaction( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + version_ = input.readInt32(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + hash_ = input.readBytes(); + break; + } + case 24: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Transaction.Pool value = org.bitcoinj.wallet.Protos.Transaction.Pool.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(3, rawValue); + } else { + bitField0_ |= 0x00000004; + pool_ = value; + } + break; + } + case 32: { + bitField0_ |= 0x00000008; + lockTime_ = input.readUInt32(); + break; + } + case 40: { + bitField0_ |= 0x00000010; + updatedAt_ = input.readInt64(); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + transactionInput_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + transactionInput_.add(input.readMessage(org.bitcoinj.wallet.Protos.TransactionInput.PARSER, extensionRegistry)); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + transactionOutput_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + transactionOutput_.add(input.readMessage(org.bitcoinj.wallet.Protos.TransactionOutput.PARSER, extensionRegistry)); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + blockHash_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + blockHash_.add(input.readBytes()); + break; + } + case 74: { + org.bitcoinj.wallet.Protos.TransactionConfidence.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = confidence_.toBuilder(); + } + confidence_ = input.readMessage(org.bitcoinj.wallet.Protos.TransactionConfidence.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(confidence_); + confidence_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 80: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Transaction.Purpose value = org.bitcoinj.wallet.Protos.Transaction.Purpose.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(10, rawValue); + } else { + bitField0_ |= 0x00000040; + purpose_ = value; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + transactionInput_ = java.util.Collections.unmodifiableList(transactionInput_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + transactionOutput_ = java.util.Collections.unmodifiableList(transactionOutput_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + blockHash_ = java.util.Collections.unmodifiableList(blockHash_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Transaction.class, org.bitcoinj.wallet.Protos.Transaction.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Transaction parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Transaction(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code wallet.Transaction.Pool} + * + *
+     **
+     * This is a bitfield oriented enum, with the following bits:
+     * 
+     * bit 0 - spent
+     * bit 1 - appears in alt chain
+     * bit 2 - appears in best chain
+     * bit 3 - double-spent
+     * bit 4 - pending (we would like the tx to go into the best chain)
+     * 
+     * Not all combinations are interesting, just the ones actually used in the enum.
+     * 
+ */ public enum Pool implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNSPENT = 4; + * + *
+       * In best chain, not all outputs spent
+       * 
+ */ UNSPENT(0, 4), + /** + * SPENT = 5; + * + *
+       * In best chain, all outputs spent
+       * 
+ */ SPENT(1, 5), + /** + * INACTIVE = 2; + * + *
+       * In non-best chain, not our transaction
+       * 
+ */ INACTIVE(2, 2), + /** + * DEAD = 10; + * + *
+       * Double-spent by a transaction in the best chain
+       * 
+ */ DEAD(3, 10), + /** + * PENDING = 16; + * + *
+       * Our transaction, not in any chain
+       * 
+ */ PENDING(4, 16), + /** + * PENDING_INACTIVE = 18; + * + *
+       * In non-best chain, our transaction
+       * 
+ */ PENDING_INACTIVE(5, 18), ; - + + /** + * UNSPENT = 4; + * + *
+       * In best chain, not all outputs spent
+       * 
+ */ public static final int UNSPENT_VALUE = 4; + /** + * SPENT = 5; + * + *
+       * In best chain, all outputs spent
+       * 
+ */ public static final int SPENT_VALUE = 5; + /** + * INACTIVE = 2; + * + *
+       * In non-best chain, not our transaction
+       * 
+ */ public static final int INACTIVE_VALUE = 2; + /** + * DEAD = 10; + * + *
+       * Double-spent by a transaction in the best chain
+       * 
+ */ public static final int DEAD_VALUE = 10; + /** + * PENDING = 16; + * + *
+       * Our transaction, not in any chain
+       * 
+ */ public static final int PENDING_VALUE = 16; + /** + * PENDING_INACTIVE = 18; + * + *
+       * In non-best chain, our transaction
+       * 
+ */ public static final int PENDING_INACTIVE_VALUE = 18; - - + + public final int getNumber() { return value; } - + public static Pool valueOf(int value) { switch (value) { case 4: return UNSPENT; @@ -4019,7 +6280,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -4031,7 +6292,7 @@ public final class Protos { return Pool.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -4044,11 +6305,9 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.Transaction.getDescriptor().getEnumTypes().get(0); } - - private static final Pool[] VALUES = { - UNSPENT, SPENT, INACTIVE, DEAD, PENDING, PENDING_INACTIVE, - }; - + + private static final Pool[] VALUES = values(); + public static Pool valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -4057,32 +6316,81 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private Pool(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:wallet.Transaction.Pool) } - + + /** + * Protobuf enum {@code wallet.Transaction.Purpose} + * + *
+     * For what purpose the transaction was created.
+     * 
+ */ public enum Purpose implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNKNOWN = 0; + * + *
+       * Old wallets or the purpose genuinely is a mystery (e.g. imported from some external source).
+       * 
+ */ UNKNOWN(0, 0), + /** + * USER_PAYMENT = 1; + * + *
+       * Created in response to a user request for payment. This is the normal case.
+       * 
+ */ USER_PAYMENT(1, 1), + /** + * KEY_ROTATION = 2; + * + *
+       * Created automatically to move money from rotated keys.
+       * 
+ */ KEY_ROTATION(2, 2), ; - + + /** + * UNKNOWN = 0; + * + *
+       * Old wallets or the purpose genuinely is a mystery (e.g. imported from some external source).
+       * 
+ */ public static final int UNKNOWN_VALUE = 0; + /** + * USER_PAYMENT = 1; + * + *
+       * Created in response to a user request for payment. This is the normal case.
+       * 
+ */ public static final int USER_PAYMENT_VALUE = 1; + /** + * KEY_ROTATION = 2; + * + *
+       * Created automatically to move money from rotated keys.
+       * 
+ */ public static final int KEY_ROTATION_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static Purpose valueOf(int value) { switch (value) { case 0: return UNKNOWN; @@ -4091,7 +6399,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -4103,7 +6411,7 @@ public final class Protos { return Purpose.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -4116,11 +6424,9 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.Transaction.getDescriptor().getEnumTypes().get(1); } - - private static final Purpose[] VALUES = { - UNKNOWN, USER_PAYMENT, KEY_ROTATION, - }; - + + private static final Purpose[] VALUES = values(); + public static Purpose valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -4129,148 +6435,294 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private Purpose(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:wallet.Transaction.Purpose) } - + private int bitField0_; // required int32 version = 1; public static final int VERSION_FIELD_NUMBER = 1; private int version_; + /** + * required int32 version = 1; + * + *
+     * See Wallet.java for detailed description of pool semantics
+     * 
+ */ public boolean hasVersion() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int32 version = 1; + * + *
+     * See Wallet.java for detailed description of pool semantics
+     * 
+ */ public int getVersion() { return version_; } - + // required bytes hash = 2; public static final int HASH_FIELD_NUMBER = 2; private com.google.protobuf.ByteString hash_; + /** + * required bytes hash = 2; + */ public boolean hasHash() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes hash = 2; + */ public com.google.protobuf.ByteString getHash() { return hash_; } - + // optional .wallet.Transaction.Pool pool = 3; public static final int POOL_FIELD_NUMBER = 3; private org.bitcoinj.wallet.Protos.Transaction.Pool pool_; + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+     * If pool is not present, that means either:
+     *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+     *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+     *  - Or the Pool enum got a new value which your software is too old to parse.
+     * 
+ */ public boolean hasPool() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+     * If pool is not present, that means either:
+     *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+     *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+     *  - Or the Pool enum got a new value which your software is too old to parse.
+     * 
+ */ public org.bitcoinj.wallet.Protos.Transaction.Pool getPool() { return pool_; } - + // optional uint32 lock_time = 4; public static final int LOCK_TIME_FIELD_NUMBER = 4; private int lockTime_; + /** + * optional uint32 lock_time = 4; + * + *
+     * The nLockTime field is useful for contracts.
+     * 
+ */ public boolean hasLockTime() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional uint32 lock_time = 4; + * + *
+     * The nLockTime field is useful for contracts.
+     * 
+ */ public int getLockTime() { return lockTime_; } - + // optional int64 updated_at = 5; public static final int UPDATED_AT_FIELD_NUMBER = 5; private long updatedAt_; + /** + * optional int64 updated_at = 5; + * + *
+     * millis since epoch the transaction was last updated
+     * 
+ */ public boolean hasUpdatedAt() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional int64 updated_at = 5; + * + *
+     * millis since epoch the transaction was last updated
+     * 
+ */ public long getUpdatedAt() { return updatedAt_; } - + // repeated .wallet.TransactionInput transaction_input = 6; public static final int TRANSACTION_INPUT_FIELD_NUMBER = 6; private java.util.List transactionInput_; + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public java.util.List getTransactionInputList() { return transactionInput_; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public java.util.List getTransactionInputOrBuilderList() { return transactionInput_; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public int getTransactionInputCount() { return transactionInput_.size(); } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index) { return transactionInput_.get(index); } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder( int index) { return transactionInput_.get(index); } - + // repeated .wallet.TransactionOutput transaction_output = 7; public static final int TRANSACTION_OUTPUT_FIELD_NUMBER = 7; private java.util.List transactionOutput_; + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public java.util.List getTransactionOutputList() { return transactionOutput_; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public java.util.List getTransactionOutputOrBuilderList() { return transactionOutput_; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public int getTransactionOutputCount() { return transactionOutput_.size(); } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index) { return transactionOutput_.get(index); } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder( int index) { return transactionOutput_.get(index); } - + // repeated bytes block_hash = 8; public static final int BLOCK_HASH_FIELD_NUMBER = 8; private java.util.List blockHash_; + /** + * repeated bytes block_hash = 8; + * + *
+     * A list of blocks in which the transaction has been observed (on any chain).
+     * 
+ */ public java.util.List getBlockHashList() { return blockHash_; } + /** + * repeated bytes block_hash = 8; + * + *
+     * A list of blocks in which the transaction has been observed (on any chain).
+     * 
+ */ public int getBlockHashCount() { return blockHash_.size(); } + /** + * repeated bytes block_hash = 8; + * + *
+     * A list of blocks in which the transaction has been observed (on any chain).
+     * 
+ */ public com.google.protobuf.ByteString getBlockHash(int index) { return blockHash_.get(index); } - + // optional .wallet.TransactionConfidence confidence = 9; public static final int CONFIDENCE_FIELD_NUMBER = 9; private org.bitcoinj.wallet.Protos.TransactionConfidence confidence_; + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+     * Data describing where the transaction is in the chain.
+     * 
+ */ public boolean hasConfidence() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+     * Data describing where the transaction is in the chain.
+     * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidence getConfidence() { return confidence_; } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+     * Data describing where the transaction is in the chain.
+     * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder getConfidenceOrBuilder() { return confidence_; } - + // optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; public static final int PURPOSE_FIELD_NUMBER = 10; private org.bitcoinj.wallet.Protos.Transaction.Purpose purpose_; + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ public boolean hasPurpose() { return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ public org.bitcoinj.wallet.Protos.Transaction.Purpose getPurpose() { return purpose_; } - + private void initFields() { version_ = 0; hash_ = com.google.protobuf.ByteString.EMPTY; @@ -4279,7 +6731,7 @@ public final class Protos { updatedAt_ = 0L; transactionInput_ = java.util.Collections.emptyList(); transactionOutput_ = java.util.Collections.emptyList(); - blockHash_ = java.util.Collections.emptyList();; + blockHash_ = java.util.Collections.emptyList(); confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance(); purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN; } @@ -4287,7 +6739,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasVersion()) { memoizedIsInitialized = 0; return false; @@ -4317,7 +6769,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -4353,12 +6805,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -4409,94 +6861,83 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoinj.wallet.Protos.Transaction parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Transaction parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoinj.wallet.Protos.Transaction parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.Transaction parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoinj.wallet.Protos.Transaction prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.Transaction} + */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoinj.wallet.Protos.TransactionOrBuilder { @@ -4504,18 +6945,21 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Transaction.class, org.bitcoinj.wallet.Protos.Transaction.Builder.class); } - + // Construct using org.bitcoinj.wallet.Protos.Transaction.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -4529,7 +6973,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); version_ = 0; @@ -4554,7 +6998,7 @@ public final class Protos { } else { transactionOutputBuilder_.clear(); } - blockHash_ = java.util.Collections.emptyList();; + blockHash_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000080); if (confidenceBuilder_ == null) { confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance(); @@ -4566,20 +7010,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000200); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.Transaction.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_Transaction_descriptor; } - + public org.bitcoinj.wallet.Protos.Transaction getDefaultInstanceForType() { return org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance(); } - + public org.bitcoinj.wallet.Protos.Transaction build() { org.bitcoinj.wallet.Protos.Transaction result = buildPartial(); if (!result.isInitialized()) { @@ -4587,17 +7031,7 @@ public final class Protos { } return result; } - - private org.bitcoinj.wallet.Protos.Transaction buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.Transaction result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoinj.wallet.Protos.Transaction buildPartial() { org.bitcoinj.wallet.Protos.Transaction result = new org.bitcoinj.wallet.Protos.Transaction(this); int from_bitField0_ = bitField0_; @@ -4661,7 +7095,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoinj.wallet.Protos.Transaction) { return mergeFrom((org.bitcoinj.wallet.Protos.Transaction)other); @@ -4670,7 +7104,7 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Transaction other) { if (other == org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()) return this; if (other.hasVersion()) { @@ -4759,7 +7193,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasVersion()) { @@ -4789,133 +7223,92 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - bitField0_ |= 0x00000001; - version_ = input.readInt32(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - hash_ = input.readBytes(); - break; - } - case 24: { - int rawValue = input.readEnum(); - org.bitcoinj.wallet.Protos.Transaction.Pool value = org.bitcoinj.wallet.Protos.Transaction.Pool.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(3, rawValue); - } else { - bitField0_ |= 0x00000004; - pool_ = value; - } - break; - } - case 32: { - bitField0_ |= 0x00000008; - lockTime_ = input.readUInt32(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - updatedAt_ = input.readInt64(); - break; - } - case 50: { - org.bitcoinj.wallet.Protos.TransactionInput.Builder subBuilder = org.bitcoinj.wallet.Protos.TransactionInput.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addTransactionInput(subBuilder.buildPartial()); - break; - } - case 58: { - org.bitcoinj.wallet.Protos.TransactionOutput.Builder subBuilder = org.bitcoinj.wallet.Protos.TransactionOutput.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addTransactionOutput(subBuilder.buildPartial()); - break; - } - case 66: { - ensureBlockHashIsMutable(); - blockHash_.add(input.readBytes()); - break; - } - case 74: { - org.bitcoinj.wallet.Protos.TransactionConfidence.Builder subBuilder = org.bitcoinj.wallet.Protos.TransactionConfidence.newBuilder(); - if (hasConfidence()) { - subBuilder.mergeFrom(getConfidence()); - } - input.readMessage(subBuilder, extensionRegistry); - setConfidence(subBuilder.buildPartial()); - break; - } - case 80: { - int rawValue = input.readEnum(); - org.bitcoinj.wallet.Protos.Transaction.Purpose value = org.bitcoinj.wallet.Protos.Transaction.Purpose.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(10, rawValue); - } else { - bitField0_ |= 0x00000200; - purpose_ = value; - } - break; - } + org.bitcoinj.wallet.Protos.Transaction parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.Transaction) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required int32 version = 1; private int version_ ; + /** + * required int32 version = 1; + * + *
+       * See Wallet.java for detailed description of pool semantics
+       * 
+ */ public boolean hasVersion() { return ((bitField0_ & 0x00000001) == 0x00000001); } + /** + * required int32 version = 1; + * + *
+       * See Wallet.java for detailed description of pool semantics
+       * 
+ */ public int getVersion() { return version_; } + /** + * required int32 version = 1; + * + *
+       * See Wallet.java for detailed description of pool semantics
+       * 
+ */ public Builder setVersion(int value) { bitField0_ |= 0x00000001; version_ = value; onChanged(); return this; } + /** + * required int32 version = 1; + * + *
+       * See Wallet.java for detailed description of pool semantics
+       * 
+ */ public Builder clearVersion() { bitField0_ = (bitField0_ & ~0x00000001); version_ = 0; onChanged(); return this; } - + // required bytes hash = 2; private com.google.protobuf.ByteString hash_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes hash = 2; + */ public boolean hasHash() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes hash = 2; + */ public com.google.protobuf.ByteString getHash() { return hash_; } + /** + * required bytes hash = 2; + */ public Builder setHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -4925,21 +7318,54 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes hash = 2; + */ public Builder clearHash() { bitField0_ = (bitField0_ & ~0x00000002); hash_ = getDefaultInstance().getHash(); onChanged(); return this; } - + // optional .wallet.Transaction.Pool pool = 3; private org.bitcoinj.wallet.Protos.Transaction.Pool pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT; + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+       * If pool is not present, that means either:
+       *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+       *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+       *  - Or the Pool enum got a new value which your software is too old to parse.
+       * 
+ */ public boolean hasPool() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+       * If pool is not present, that means either:
+       *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+       *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+       *  - Or the Pool enum got a new value which your software is too old to parse.
+       * 
+ */ public org.bitcoinj.wallet.Protos.Transaction.Pool getPool() { return pool_; } + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+       * If pool is not present, that means either:
+       *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+       *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+       *  - Or the Pool enum got a new value which your software is too old to parse.
+       * 
+ */ public Builder setPool(org.bitcoinj.wallet.Protos.Transaction.Pool value) { if (value == null) { throw new NullPointerException(); @@ -4949,55 +7375,121 @@ public final class Protos { onChanged(); return this; } + /** + * optional .wallet.Transaction.Pool pool = 3; + * + *
+       * If pool is not present, that means either:
+       *  - This Transaction is either not in a wallet at all (the proto is re-used elsewhere)
+       *  - Or it is stored but for other purposes, for example, because it is the overriding transaction of a double spend.
+       *  - Or the Pool enum got a new value which your software is too old to parse.
+       * 
+ */ public Builder clearPool() { bitField0_ = (bitField0_ & ~0x00000004); pool_ = org.bitcoinj.wallet.Protos.Transaction.Pool.UNSPENT; onChanged(); return this; } - + // optional uint32 lock_time = 4; private int lockTime_ ; + /** + * optional uint32 lock_time = 4; + * + *
+       * The nLockTime field is useful for contracts.
+       * 
+ */ public boolean hasLockTime() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional uint32 lock_time = 4; + * + *
+       * The nLockTime field is useful for contracts.
+       * 
+ */ public int getLockTime() { return lockTime_; } + /** + * optional uint32 lock_time = 4; + * + *
+       * The nLockTime field is useful for contracts.
+       * 
+ */ public Builder setLockTime(int value) { bitField0_ |= 0x00000008; lockTime_ = value; onChanged(); return this; } + /** + * optional uint32 lock_time = 4; + * + *
+       * The nLockTime field is useful for contracts.
+       * 
+ */ public Builder clearLockTime() { bitField0_ = (bitField0_ & ~0x00000008); lockTime_ = 0; onChanged(); return this; } - + // optional int64 updated_at = 5; private long updatedAt_ ; + /** + * optional int64 updated_at = 5; + * + *
+       * millis since epoch the transaction was last updated
+       * 
+ */ public boolean hasUpdatedAt() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional int64 updated_at = 5; + * + *
+       * millis since epoch the transaction was last updated
+       * 
+ */ public long getUpdatedAt() { return updatedAt_; } + /** + * optional int64 updated_at = 5; + * + *
+       * millis since epoch the transaction was last updated
+       * 
+ */ public Builder setUpdatedAt(long value) { bitField0_ |= 0x00000010; updatedAt_ = value; onChanged(); return this; } + /** + * optional int64 updated_at = 5; + * + *
+       * millis since epoch the transaction was last updated
+       * 
+ */ public Builder clearUpdatedAt() { bitField0_ = (bitField0_ & ~0x00000010); updatedAt_ = 0L; onChanged(); return this; } - + // repeated .wallet.TransactionInput transaction_input = 6; private java.util.List transactionInput_ = java.util.Collections.emptyList(); @@ -5007,10 +7499,13 @@ public final class Protos { bitField0_ |= 0x00000020; } } - + private com.google.protobuf.RepeatedFieldBuilder< org.bitcoinj.wallet.Protos.TransactionInput, org.bitcoinj.wallet.Protos.TransactionInput.Builder, org.bitcoinj.wallet.Protos.TransactionInputOrBuilder> transactionInputBuilder_; - + + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public java.util.List getTransactionInputList() { if (transactionInputBuilder_ == null) { return java.util.Collections.unmodifiableList(transactionInput_); @@ -5018,6 +7513,9 @@ public final class Protos { return transactionInputBuilder_.getMessageList(); } } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public int getTransactionInputCount() { if (transactionInputBuilder_ == null) { return transactionInput_.size(); @@ -5025,6 +7523,9 @@ public final class Protos { return transactionInputBuilder_.getCount(); } } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInput getTransactionInput(int index) { if (transactionInputBuilder_ == null) { return transactionInput_.get(index); @@ -5032,6 +7533,9 @@ public final class Protos { return transactionInputBuilder_.getMessage(index); } } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder setTransactionInput( int index, org.bitcoinj.wallet.Protos.TransactionInput value) { if (transactionInputBuilder_ == null) { @@ -5046,6 +7550,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder setTransactionInput( int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { @@ -5057,6 +7564,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder addTransactionInput(org.bitcoinj.wallet.Protos.TransactionInput value) { if (transactionInputBuilder_ == null) { if (value == null) { @@ -5070,6 +7580,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder addTransactionInput( int index, org.bitcoinj.wallet.Protos.TransactionInput value) { if (transactionInputBuilder_ == null) { @@ -5084,6 +7597,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder addTransactionInput( org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { @@ -5095,6 +7611,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder addTransactionInput( int index, org.bitcoinj.wallet.Protos.TransactionInput.Builder builderForValue) { if (transactionInputBuilder_ == null) { @@ -5106,6 +7625,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder addAllTransactionInput( java.lang.Iterable values) { if (transactionInputBuilder_ == null) { @@ -5117,6 +7639,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder clearTransactionInput() { if (transactionInputBuilder_ == null) { transactionInput_ = java.util.Collections.emptyList(); @@ -5127,6 +7652,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public Builder removeTransactionInput(int index) { if (transactionInputBuilder_ == null) { ensureTransactionInputIsMutable(); @@ -5137,10 +7665,16 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInput.Builder getTransactionInputBuilder( int index) { return getTransactionInputFieldBuilder().getBuilder(index); } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInputOrBuilder getTransactionInputOrBuilder( int index) { if (transactionInputBuilder_ == null) { @@ -5148,6 +7682,9 @@ public final class Protos { return transactionInputBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public java.util.List getTransactionInputOrBuilderList() { if (transactionInputBuilder_ != null) { @@ -5156,15 +7693,24 @@ public final class Protos { return java.util.Collections.unmodifiableList(transactionInput_); } } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInput.Builder addTransactionInputBuilder() { return getTransactionInputFieldBuilder().addBuilder( org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()); } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public org.bitcoinj.wallet.Protos.TransactionInput.Builder addTransactionInputBuilder( int index) { return getTransactionInputFieldBuilder().addBuilder( index, org.bitcoinj.wallet.Protos.TransactionInput.getDefaultInstance()); } + /** + * repeated .wallet.TransactionInput transaction_input = 6; + */ public java.util.List getTransactionInputBuilderList() { return getTransactionInputFieldBuilder().getBuilderList(); @@ -5183,7 +7729,7 @@ public final class Protos { } return transactionInputBuilder_; } - + // repeated .wallet.TransactionOutput transaction_output = 7; private java.util.List transactionOutput_ = java.util.Collections.emptyList(); @@ -5193,10 +7739,13 @@ public final class Protos { bitField0_ |= 0x00000040; } } - + private com.google.protobuf.RepeatedFieldBuilder< org.bitcoinj.wallet.Protos.TransactionOutput, org.bitcoinj.wallet.Protos.TransactionOutput.Builder, org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder> transactionOutputBuilder_; - + + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public java.util.List getTransactionOutputList() { if (transactionOutputBuilder_ == null) { return java.util.Collections.unmodifiableList(transactionOutput_); @@ -5204,6 +7753,9 @@ public final class Protos { return transactionOutputBuilder_.getMessageList(); } } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public int getTransactionOutputCount() { if (transactionOutputBuilder_ == null) { return transactionOutput_.size(); @@ -5211,6 +7763,9 @@ public final class Protos { return transactionOutputBuilder_.getCount(); } } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutput getTransactionOutput(int index) { if (transactionOutputBuilder_ == null) { return transactionOutput_.get(index); @@ -5218,6 +7773,9 @@ public final class Protos { return transactionOutputBuilder_.getMessage(index); } } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder setTransactionOutput( int index, org.bitcoinj.wallet.Protos.TransactionOutput value) { if (transactionOutputBuilder_ == null) { @@ -5232,6 +7790,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder setTransactionOutput( int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { @@ -5243,6 +7804,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder addTransactionOutput(org.bitcoinj.wallet.Protos.TransactionOutput value) { if (transactionOutputBuilder_ == null) { if (value == null) { @@ -5256,6 +7820,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder addTransactionOutput( int index, org.bitcoinj.wallet.Protos.TransactionOutput value) { if (transactionOutputBuilder_ == null) { @@ -5270,6 +7837,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder addTransactionOutput( org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { @@ -5281,6 +7851,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder addTransactionOutput( int index, org.bitcoinj.wallet.Protos.TransactionOutput.Builder builderForValue) { if (transactionOutputBuilder_ == null) { @@ -5292,6 +7865,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder addAllTransactionOutput( java.lang.Iterable values) { if (transactionOutputBuilder_ == null) { @@ -5303,6 +7879,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder clearTransactionOutput() { if (transactionOutputBuilder_ == null) { transactionOutput_ = java.util.Collections.emptyList(); @@ -5313,6 +7892,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public Builder removeTransactionOutput(int index) { if (transactionOutputBuilder_ == null) { ensureTransactionOutputIsMutable(); @@ -5323,10 +7905,16 @@ public final class Protos { } return this; } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutput.Builder getTransactionOutputBuilder( int index) { return getTransactionOutputFieldBuilder().getBuilder(index); } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutputOrBuilder getTransactionOutputOrBuilder( int index) { if (transactionOutputBuilder_ == null) { @@ -5334,6 +7922,9 @@ public final class Protos { return transactionOutputBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public java.util.List getTransactionOutputOrBuilderList() { if (transactionOutputBuilder_ != null) { @@ -5342,15 +7933,24 @@ public final class Protos { return java.util.Collections.unmodifiableList(transactionOutput_); } } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutput.Builder addTransactionOutputBuilder() { return getTransactionOutputFieldBuilder().addBuilder( org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()); } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public org.bitcoinj.wallet.Protos.TransactionOutput.Builder addTransactionOutputBuilder( int index) { return getTransactionOutputFieldBuilder().addBuilder( index, org.bitcoinj.wallet.Protos.TransactionOutput.getDefaultInstance()); } + /** + * repeated .wallet.TransactionOutput transaction_output = 7; + */ public java.util.List getTransactionOutputBuilderList() { return getTransactionOutputFieldBuilder().getBuilderList(); @@ -5369,25 +7969,53 @@ public final class Protos { } return transactionOutputBuilder_; } - + // repeated bytes block_hash = 8; - private java.util.List blockHash_ = java.util.Collections.emptyList();; + private java.util.List blockHash_ = java.util.Collections.emptyList(); private void ensureBlockHashIsMutable() { if (!((bitField0_ & 0x00000080) == 0x00000080)) { blockHash_ = new java.util.ArrayList(blockHash_); bitField0_ |= 0x00000080; } } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public java.util.List getBlockHashList() { return java.util.Collections.unmodifiableList(blockHash_); } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public int getBlockHashCount() { return blockHash_.size(); } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public com.google.protobuf.ByteString getBlockHash(int index) { return blockHash_.get(index); } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public Builder setBlockHash( int index, com.google.protobuf.ByteString value) { if (value == null) { @@ -5398,6 +8026,13 @@ public final class Protos { onChanged(); return this; } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public Builder addBlockHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -5407,6 +8042,13 @@ public final class Protos { onChanged(); return this; } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public Builder addAllBlockHash( java.lang.Iterable values) { ensureBlockHashIsMutable(); @@ -5414,20 +8056,41 @@ public final class Protos { onChanged(); return this; } + /** + * repeated bytes block_hash = 8; + * + *
+       * A list of blocks in which the transaction has been observed (on any chain).
+       * 
+ */ public Builder clearBlockHash() { - blockHash_ = java.util.Collections.emptyList();; + blockHash_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000080); onChanged(); return this; } - + // optional .wallet.TransactionConfidence confidence = 9; private org.bitcoinj.wallet.Protos.TransactionConfidence confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoinj.wallet.Protos.TransactionConfidence, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder, org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder> confidenceBuilder_; + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public boolean hasConfidence() { return ((bitField0_ & 0x00000100) == 0x00000100); } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidence getConfidence() { if (confidenceBuilder_ == null) { return confidence_; @@ -5435,6 +8098,13 @@ public final class Protos { return confidenceBuilder_.getMessage(); } } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public Builder setConfidence(org.bitcoinj.wallet.Protos.TransactionConfidence value) { if (confidenceBuilder_ == null) { if (value == null) { @@ -5448,6 +8118,13 @@ public final class Protos { bitField0_ |= 0x00000100; return this; } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public Builder setConfidence( org.bitcoinj.wallet.Protos.TransactionConfidence.Builder builderForValue) { if (confidenceBuilder_ == null) { @@ -5459,6 +8136,13 @@ public final class Protos { bitField0_ |= 0x00000100; return this; } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public Builder mergeConfidence(org.bitcoinj.wallet.Protos.TransactionConfidence value) { if (confidenceBuilder_ == null) { if (((bitField0_ & 0x00000100) == 0x00000100) && @@ -5475,6 +8159,13 @@ public final class Protos { bitField0_ |= 0x00000100; return this; } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public Builder clearConfidence() { if (confidenceBuilder_ == null) { confidence_ = org.bitcoinj.wallet.Protos.TransactionConfidence.getDefaultInstance(); @@ -5485,11 +8176,25 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000100); return this; } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidence.Builder getConfidenceBuilder() { bitField0_ |= 0x00000100; onChanged(); return getConfidenceFieldBuilder().getBuilder(); } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ public org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder getConfidenceOrBuilder() { if (confidenceBuilder_ != null) { return confidenceBuilder_.getMessageOrBuilder(); @@ -5497,6 +8202,13 @@ public final class Protos { return confidence_; } } + /** + * optional .wallet.TransactionConfidence confidence = 9; + * + *
+       * Data describing where the transaction is in the chain.
+       * 
+ */ private com.google.protobuf.SingleFieldBuilder< org.bitcoinj.wallet.Protos.TransactionConfidence, org.bitcoinj.wallet.Protos.TransactionConfidence.Builder, org.bitcoinj.wallet.Protos.TransactionConfidenceOrBuilder> getConfidenceFieldBuilder() { @@ -5510,15 +8222,24 @@ public final class Protos { } return confidenceBuilder_; } - + // optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; private org.bitcoinj.wallet.Protos.Transaction.Purpose purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN; + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ public boolean hasPurpose() { return ((bitField0_ & 0x00000200) == 0x00000200); } + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ public org.bitcoinj.wallet.Protos.Transaction.Purpose getPurpose() { return purpose_; } + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ public Builder setPurpose(org.bitcoinj.wallet.Protos.Transaction.Purpose value) { if (value == null) { throw new NullPointerException(); @@ -5528,417 +8249,158 @@ public final class Protos { onChanged(); return this; } + /** + * optional .wallet.Transaction.Purpose purpose = 10 [default = UNKNOWN]; + */ public Builder clearPurpose() { bitField0_ = (bitField0_ & ~0x00000200); purpose_ = org.bitcoinj.wallet.Protos.Transaction.Purpose.UNKNOWN; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.Transaction) } - + static { defaultInstance = new Transaction(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.Transaction) } - + public interface ScryptParametersOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes salt = 1; + /** + * required bytes salt = 1; + * + *
+     * Salt to use in generation of the wallet password (8 bytes)
+     * 
+ */ boolean hasSalt(); + /** + * required bytes salt = 1; + * + *
+     * Salt to use in generation of the wallet password (8 bytes)
+     * 
+ */ com.google.protobuf.ByteString getSalt(); - + // optional int64 n = 2 [default = 16384]; + /** + * optional int64 n = 2 [default = 16384]; + * + *
+     * CPU/ memory cost parameter
+     * 
+ */ boolean hasN(); + /** + * optional int64 n = 2 [default = 16384]; + * + *
+     * CPU/ memory cost parameter
+     * 
+ */ long getN(); - + // optional int32 r = 3 [default = 8]; + /** + * optional int32 r = 3 [default = 8]; + * + *
+     * Block size parameter
+     * 
+ */ boolean hasR(); + /** + * optional int32 r = 3 [default = 8]; + * + *
+     * Block size parameter
+     * 
+ */ int getR(); - + // optional int32 p = 4 [default = 1]; + /** + * optional int32 p = 4 [default = 1]; + * + *
+     * Parallelisation parameter
+     * 
+ */ boolean hasP(); + /** + * optional int32 p = 4 [default = 1]; + * + *
+     * Parallelisation parameter
+     * 
+ */ int getP(); } + /** + * Protobuf type {@code wallet.ScryptParameters} + * + *
+   ** The parameters used in the scrypt key derivation function.
+   *  The default values are taken from http://www.tarsnap.com/scrypt/scrypt-slides.pdf.
+   *  They can be increased - n is the number of iterations performed and
+   *  r and p can be used to tweak the algorithm - see:
+   *  http://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors
+   * 
+ */ public static final class ScryptParameters extends com.google.protobuf.GeneratedMessage implements ScryptParametersOrBuilder { // Use ScryptParameters.newBuilder() to construct. - private ScryptParameters(Builder builder) { + private ScryptParameters(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private ScryptParameters(boolean noInit) {} - + private ScryptParameters(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final ScryptParameters defaultInstance; public static ScryptParameters getDefaultInstance() { return defaultInstance; } - + public ScryptParameters getDefaultInstanceForType() { return defaultInstance; } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_fieldAccessorTable; - } - - private int bitField0_; - // required bytes salt = 1; - public static final int SALT_FIELD_NUMBER = 1; - private com.google.protobuf.ByteString salt_; - public boolean hasSalt() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getSalt() { - return salt_; - } - - // optional int64 n = 2 [default = 16384]; - public static final int N_FIELD_NUMBER = 2; - private long n_; - public boolean hasN() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public long getN() { - return n_; - } - - // optional int32 r = 3 [default = 8]; - public static final int R_FIELD_NUMBER = 3; - private int r_; - public boolean hasR() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public int getR() { - return r_; - } - - // optional int32 p = 4 [default = 1]; - public static final int P_FIELD_NUMBER = 4; - private int p_; - public boolean hasP() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public int getP() { - return p_; - } - - private void initFields() { - salt_ = com.google.protobuf.ByteString.EMPTY; - n_ = 16384L; - r_ = 8; - p_ = 1; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasSalt()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, salt_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeInt64(2, n_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeInt32(3, r_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeInt32(4, p_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, salt_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeInt64Size(2, n_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(3, r_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeInt32Size(4, p_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; + + private final com.google.protobuf.UnknownFieldSet unknownFields; @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; } - - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( + private ScryptParameters( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoinj.wallet.Protos.ScryptParameters prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_fieldAccessorTable; - } - - // Construct using org.bitcoinj.wallet.Protos.ScryptParameters.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - salt_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000001); - n_ = 16384L; - bitField0_ = (bitField0_ & ~0x00000002); - r_ = 8; - bitField0_ = (bitField0_ & ~0x00000004); - p_ = 1; - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return org.bitcoinj.wallet.Protos.ScryptParameters.getDescriptor(); - } - - public org.bitcoinj.wallet.Protos.ScryptParameters getDefaultInstanceForType() { - return org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance(); - } - - public org.bitcoinj.wallet.Protos.ScryptParameters build() { - org.bitcoinj.wallet.Protos.ScryptParameters result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private org.bitcoinj.wallet.Protos.ScryptParameters buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.ScryptParameters result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoinj.wallet.Protos.ScryptParameters buildPartial() { - org.bitcoinj.wallet.Protos.ScryptParameters result = new org.bitcoinj.wallet.Protos.ScryptParameters(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.salt_ = salt_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.n_ = n_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.r_ = r_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.p_ = p_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoinj.wallet.Protos.ScryptParameters) { - return mergeFrom((org.bitcoinj.wallet.Protos.ScryptParameters)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(org.bitcoinj.wallet.Protos.ScryptParameters other) { - if (other == org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance()) return this; - if (other.hasSalt()) { - setSalt(other.getSalt()); - } - if (other.hasN()) { - setN(other.getN()); - } - if (other.hasR()) { - setR(other.getR()); - } - if (other.hasP()) { - setP(other.getP()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasSalt()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -5964,374 +8426,310 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } - - private int bitField0_; - - // required bytes salt = 1; - private com.google.protobuf.ByteString salt_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasSalt() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public com.google.protobuf.ByteString getSalt() { - return salt_; - } - public Builder setSalt(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - salt_ = value; - onChanged(); - return this; - } - public Builder clearSalt() { - bitField0_ = (bitField0_ & ~0x00000001); - salt_ = getDefaultInstance().getSalt(); - onChanged(); - return this; - } - - // optional int64 n = 2 [default = 16384]; - private long n_ = 16384L; - public boolean hasN() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public long getN() { - return n_; - } - public Builder setN(long value) { - bitField0_ |= 0x00000002; - n_ = value; - onChanged(); - return this; - } - public Builder clearN() { - bitField0_ = (bitField0_ & ~0x00000002); - n_ = 16384L; - onChanged(); - return this; - } - - // optional int32 r = 3 [default = 8]; - private int r_ = 8; - public boolean hasR() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public int getR() { - return r_; - } - public Builder setR(int value) { - bitField0_ |= 0x00000004; - r_ = value; - onChanged(); - return this; - } - public Builder clearR() { - bitField0_ = (bitField0_ & ~0x00000004); - r_ = 8; - onChanged(); - return this; - } - - // optional int32 p = 4 [default = 1]; - private int p_ = 1; - public boolean hasP() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public int getP() { - return p_; - } - public Builder setP(int value) { - bitField0_ |= 0x00000008; - p_ = value; - onChanged(); - return this; - } - public Builder clearP() { - bitField0_ = (bitField0_ & ~0x00000008); - p_ = 1; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:wallet.ScryptParameters) } - - static { - defaultInstance = new ScryptParameters(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:wallet.ScryptParameters) - } - - public interface ExtensionOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required string id = 1; - boolean hasId(); - String getId(); - - // required bytes data = 2; - boolean hasData(); - com.google.protobuf.ByteString getData(); - - // required bool mandatory = 3; - boolean hasMandatory(); - boolean getMandatory(); - } - public static final class Extension extends - com.google.protobuf.GeneratedMessage - implements ExtensionOrBuilder { - // Use Extension.newBuilder() to construct. - private Extension(Builder builder) { - super(builder); - } - private Extension(boolean noInit) {} - - private static final Extension defaultInstance; - public static Extension getDefaultInstance() { - return defaultInstance; - } - - public Extension getDefaultInstanceForType() { - return defaultInstance; - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.ScryptParameters.class, org.bitcoinj.wallet.Protos.ScryptParameters.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public ScryptParameters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScryptParameters(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + private int bitField0_; - // required string id = 1; - public static final int ID_FIELD_NUMBER = 1; - private java.lang.Object id_; - public boolean hasId() { + // required bytes salt = 1; + public static final int SALT_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString salt_; + /** + * required bytes salt = 1; + * + *
+     * Salt to use in generation of the wallet password (8 bytes)
+     * 
+ */ + public boolean hasSalt() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getId() { - java.lang.Object ref = id_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - id_ = s; - } - return s; - } + /** + * required bytes salt = 1; + * + *
+     * Salt to use in generation of the wallet password (8 bytes)
+     * 
+ */ + public com.google.protobuf.ByteString getSalt() { + return salt_; } - private com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // required bytes data = 2; - public static final int DATA_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString data_; - public boolean hasData() { + + // optional int64 n = 2 [default = 16384]; + public static final int N_FIELD_NUMBER = 2; + private long n_; + /** + * optional int64 n = 2 [default = 16384]; + * + *
+     * CPU/ memory cost parameter
+     * 
+ */ + public boolean hasN() { return ((bitField0_ & 0x00000002) == 0x00000002); } - public com.google.protobuf.ByteString getData() { - return data_; + /** + * optional int64 n = 2 [default = 16384]; + * + *
+     * CPU/ memory cost parameter
+     * 
+ */ + public long getN() { + return n_; } - - // required bool mandatory = 3; - public static final int MANDATORY_FIELD_NUMBER = 3; - private boolean mandatory_; - public boolean hasMandatory() { + + // optional int32 r = 3 [default = 8]; + public static final int R_FIELD_NUMBER = 3; + private int r_; + /** + * optional int32 r = 3 [default = 8]; + * + *
+     * Block size parameter
+     * 
+ */ + public boolean hasR() { return ((bitField0_ & 0x00000004) == 0x00000004); } - public boolean getMandatory() { - return mandatory_; + /** + * optional int32 r = 3 [default = 8]; + * + *
+     * Block size parameter
+     * 
+ */ + public int getR() { + return r_; } - + + // optional int32 p = 4 [default = 1]; + public static final int P_FIELD_NUMBER = 4; + private int p_; + /** + * optional int32 p = 4 [default = 1]; + * + *
+     * Parallelisation parameter
+     * 
+ */ + public boolean hasP() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 p = 4 [default = 1]; + * + *
+     * Parallelisation parameter
+     * 
+ */ + public int getP() { + return p_; + } + private void initFields() { - id_ = ""; - data_ = com.google.protobuf.ByteString.EMPTY; - mandatory_ = false; + salt_ = com.google.protobuf.ByteString.EMPTY; + n_ = 16384L; + r_ = 8; + p_ = 1; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - - if (!hasId()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasData()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasMandatory()) { + + if (!hasSalt()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getIdBytes()); + output.writeBytes(1, salt_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, data_); + output.writeInt64(2, n_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(3, mandatory_); + output.writeInt32(3, r_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeInt32(4, p_); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getIdBytes()); + .computeBytesSize(1, salt_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, data_); + .computeInt64Size(2, n_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, mandatory_); + .computeInt32Size(3, r_); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, p_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - - public static org.bitcoinj.wallet.Protos.Extension parseFrom( + + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom( + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom(byte[] data) + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom( + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom(java.io.InputStream input) + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom( + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom(java.io.InputStream input) + public static org.bitcoinj.wallet.Protos.ScryptParameters parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } - public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom( + public static org.bitcoinj.wallet.Protos.ScryptParameters parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom( + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } - public static org.bitcoinj.wallet.Protos.Extension parseFrom( + public static org.bitcoinj.wallet.Protos.ScryptParameters parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(org.bitcoinj.wallet.Protos.Extension prototype) { + public static Builder newBuilder(org.bitcoinj.wallet.Protos.ScryptParameters prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.ScryptParameters} + * + *
+     ** The parameters used in the scrypt key derivation function.
+     *  The default values are taken from http://www.tarsnap.com/scrypt/scrypt-slides.pdf.
+     *  They can be increased - n is the number of iterations performed and
+     *  r and p can be used to tweak the algorithm - see:
+     *  http://stackoverflow.com/questions/11126315/what-are-optimal-scrypt-work-factors
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements org.bitcoinj.wallet.Protos.ExtensionOrBuilder { + implements org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.ScryptParameters.class, org.bitcoinj.wallet.Protos.ScryptParameters.Builder.class); } - - // Construct using org.bitcoinj.wallet.Protos.Extension.newBuilder() + + // Construct using org.bitcoinj.wallet.Protos.ScryptParameters.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -6342,130 +8740,444 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); - id_ = ""; + salt_ = com.google.protobuf.ByteString.EMPTY; bitField0_ = (bitField0_ & ~0x00000001); - data_ = com.google.protobuf.ByteString.EMPTY; + n_ = 16384L; bitField0_ = (bitField0_ & ~0x00000002); - mandatory_ = false; + r_ = 8; bitField0_ = (bitField0_ & ~0x00000004); + p_ = 1; + bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.Extension.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_ScryptParameters_descriptor; } - - public org.bitcoinj.wallet.Protos.Extension getDefaultInstanceForType() { - return org.bitcoinj.wallet.Protos.Extension.getDefaultInstance(); + + public org.bitcoinj.wallet.Protos.ScryptParameters getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance(); } - - public org.bitcoinj.wallet.Protos.Extension build() { - org.bitcoinj.wallet.Protos.Extension result = buildPartial(); + + public org.bitcoinj.wallet.Protos.ScryptParameters build() { + org.bitcoinj.wallet.Protos.ScryptParameters result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - - private org.bitcoinj.wallet.Protos.Extension buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.Extension result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public org.bitcoinj.wallet.Protos.Extension buildPartial() { - org.bitcoinj.wallet.Protos.Extension result = new org.bitcoinj.wallet.Protos.Extension(this); + + public org.bitcoinj.wallet.Protos.ScryptParameters buildPartial() { + org.bitcoinj.wallet.Protos.ScryptParameters result = new org.bitcoinj.wallet.Protos.ScryptParameters(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.id_ = id_; + result.salt_ = salt_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.data_ = data_; + result.n_ = n_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.mandatory_ = mandatory_; + result.r_ = r_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; + } + result.p_ = p_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof org.bitcoinj.wallet.Protos.Extension) { - return mergeFrom((org.bitcoinj.wallet.Protos.Extension)other); + if (other instanceof org.bitcoinj.wallet.Protos.ScryptParameters) { + return mergeFrom((org.bitcoinj.wallet.Protos.ScryptParameters)other); } else { super.mergeFrom(other); return this; } } - - public Builder mergeFrom(org.bitcoinj.wallet.Protos.Extension other) { - if (other == org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()) return this; - if (other.hasId()) { - setId(other.getId()); + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.ScryptParameters other) { + if (other == org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance()) return this; + if (other.hasSalt()) { + setSalt(other.getSalt()); } - if (other.hasData()) { - setData(other.getData()); + if (other.hasN()) { + setN(other.getN()); } - if (other.hasMandatory()) { - setMandatory(other.getMandatory()); + if (other.hasR()) { + setR(other.getR()); + } + if (other.hasP()) { + setP(other.getP()); } this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { - if (!hasId()) { - - return false; - } - if (!hasData()) { - - return false; - } - if (!hasMandatory()) { + if (!hasSalt()) { return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { + org.bitcoinj.wallet.Protos.ScryptParameters parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.ScryptParameters) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // required bytes salt = 1; + private com.google.protobuf.ByteString salt_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes salt = 1; + * + *
+       * Salt to use in generation of the wallet password (8 bytes)
+       * 
+ */ + public boolean hasSalt() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required bytes salt = 1; + * + *
+       * Salt to use in generation of the wallet password (8 bytes)
+       * 
+ */ + public com.google.protobuf.ByteString getSalt() { + return salt_; + } + /** + * required bytes salt = 1; + * + *
+       * Salt to use in generation of the wallet password (8 bytes)
+       * 
+ */ + public Builder setSalt(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + salt_ = value; + onChanged(); + return this; + } + /** + * required bytes salt = 1; + * + *
+       * Salt to use in generation of the wallet password (8 bytes)
+       * 
+ */ + public Builder clearSalt() { + bitField0_ = (bitField0_ & ~0x00000001); + salt_ = getDefaultInstance().getSalt(); + onChanged(); + return this; + } + + // optional int64 n = 2 [default = 16384]; + private long n_ = 16384L; + /** + * optional int64 n = 2 [default = 16384]; + * + *
+       * CPU/ memory cost parameter
+       * 
+ */ + public boolean hasN() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional int64 n = 2 [default = 16384]; + * + *
+       * CPU/ memory cost parameter
+       * 
+ */ + public long getN() { + return n_; + } + /** + * optional int64 n = 2 [default = 16384]; + * + *
+       * CPU/ memory cost parameter
+       * 
+ */ + public Builder setN(long value) { + bitField0_ |= 0x00000002; + n_ = value; + onChanged(); + return this; + } + /** + * optional int64 n = 2 [default = 16384]; + * + *
+       * CPU/ memory cost parameter
+       * 
+ */ + public Builder clearN() { + bitField0_ = (bitField0_ & ~0x00000002); + n_ = 16384L; + onChanged(); + return this; + } + + // optional int32 r = 3 [default = 8]; + private int r_ = 8; + /** + * optional int32 r = 3 [default = 8]; + * + *
+       * Block size parameter
+       * 
+ */ + public boolean hasR() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional int32 r = 3 [default = 8]; + * + *
+       * Block size parameter
+       * 
+ */ + public int getR() { + return r_; + } + /** + * optional int32 r = 3 [default = 8]; + * + *
+       * Block size parameter
+       * 
+ */ + public Builder setR(int value) { + bitField0_ |= 0x00000004; + r_ = value; + onChanged(); + return this; + } + /** + * optional int32 r = 3 [default = 8]; + * + *
+       * Block size parameter
+       * 
+ */ + public Builder clearR() { + bitField0_ = (bitField0_ & ~0x00000004); + r_ = 8; + onChanged(); + return this; + } + + // optional int32 p = 4 [default = 1]; + private int p_ = 1; + /** + * optional int32 p = 4 [default = 1]; + * + *
+       * Parallelisation parameter
+       * 
+ */ + public boolean hasP() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional int32 p = 4 [default = 1]; + * + *
+       * Parallelisation parameter
+       * 
+ */ + public int getP() { + return p_; + } + /** + * optional int32 p = 4 [default = 1]; + * + *
+       * Parallelisation parameter
+       * 
+ */ + public Builder setP(int value) { + bitField0_ |= 0x00000008; + p_ = value; + onChanged(); + return this; + } + /** + * optional int32 p = 4 [default = 1]; + * + *
+       * Parallelisation parameter
+       * 
+ */ + public Builder clearP() { + bitField0_ = (bitField0_ & ~0x00000008); + p_ = 1; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:wallet.ScryptParameters) + } + + static { + defaultInstance = new ScryptParameters(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:wallet.ScryptParameters) + } + + public interface ExtensionOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string id = 1; + /** + * required string id = 1; + * + *
+     * like org.whatever.foo.bar
+     * 
+ */ + boolean hasId(); + /** + * required string id = 1; + * + *
+     * like org.whatever.foo.bar
+     * 
+ */ + java.lang.String getId(); + /** + * required string id = 1; + * + *
+     * like org.whatever.foo.bar
+     * 
+ */ + com.google.protobuf.ByteString + getIdBytes(); + + // required bytes data = 2; + /** + * required bytes data = 2; + */ + boolean hasData(); + /** + * required bytes data = 2; + */ + com.google.protobuf.ByteString getData(); + + // required bool mandatory = 3; + /** + * required bool mandatory = 3; + * + *
+     * If we do not understand a mandatory extension, abort to prevent data loss.
+     * For example, this could be applied to a new type of holding, such as a contract, where
+     * dropping of an extension in a read/write cycle could cause loss of value.
+     * 
+ */ + boolean hasMandatory(); + /** + * required bool mandatory = 3; + * + *
+     * If we do not understand a mandatory extension, abort to prevent data loss.
+     * For example, this could be applied to a new type of holding, such as a contract, where
+     * dropping of an extension in a read/write cycle could cause loss of value.
+     * 
+ */ + boolean getMandatory(); + } + /** + * Protobuf type {@code wallet.Extension} + * + *
+   ** An extension to the wallet 
+   * 
+ */ + public static final class Extension extends + com.google.protobuf.GeneratedMessage + implements ExtensionOrBuilder { + // Use Extension.newBuilder() to construct. + private Extension(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Extension(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + + private static final Extension defaultInstance; + public static Extension getDefaultInstance() { + return defaultInstance; + } + + public Extension getDefaultInstanceForType() { + return defaultInstance; + } + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Extension( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { int tag = input.readTag(); switch (tag) { case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; + break; default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; + done = true; } break; } @@ -6486,26 +9198,493 @@ public final class Protos { } } } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Extension.class, org.bitcoinj.wallet.Protos.Extension.Builder.class); + } + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Extension parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Extension(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // required string id = 1; + public static final int ID_FIELD_NUMBER = 1; + private java.lang.Object id_; + /** + * required string id = 1; + * + *
+     * like org.whatever.foo.bar
+     * 
+ */ + public boolean hasId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * required string id = 1; + * + *
+     * like org.whatever.foo.bar
+     * 
+ */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + id_ = s; + } + return s; + } + } + /** + * required string id = 1; + * + *
+     * like org.whatever.foo.bar
+     * 
+ */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required bytes data = 2; + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + * required bytes data = 2; + */ + public boolean hasData() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * required bytes data = 2; + */ + public com.google.protobuf.ByteString getData() { + return data_; + } + + // required bool mandatory = 3; + public static final int MANDATORY_FIELD_NUMBER = 3; + private boolean mandatory_; + /** + * required bool mandatory = 3; + * + *
+     * If we do not understand a mandatory extension, abort to prevent data loss.
+     * For example, this could be applied to a new type of holding, such as a contract, where
+     * dropping of an extension in a read/write cycle could cause loss of value.
+     * 
+ */ + public boolean hasMandatory() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * required bool mandatory = 3; + * + *
+     * If we do not understand a mandatory extension, abort to prevent data loss.
+     * For example, this could be applied to a new type of holding, such as a contract, where
+     * dropping of an extension in a read/write cycle could cause loss of value.
+     * 
+ */ + public boolean getMandatory() { + return mandatory_; + } + + private void initFields() { + id_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + mandatory_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasId()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasData()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasMandatory()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getIdBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeBytes(2, data_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, mandatory_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getIdBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, mandatory_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.bitcoinj.wallet.Protos.Extension parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.bitcoinj.wallet.Protos.Extension parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.bitcoinj.wallet.Protos.Extension prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code wallet.Extension} + * + *
+     ** An extension to the wallet 
+     * 
+ */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements org.bitcoinj.wallet.Protos.ExtensionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Extension.class, org.bitcoinj.wallet.Protos.Extension.Builder.class); + } + + // Construct using org.bitcoinj.wallet.Protos.Extension.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + id_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + data_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + mandatory_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return org.bitcoinj.wallet.Protos.internal_static_wallet_Extension_descriptor; + } + + public org.bitcoinj.wallet.Protos.Extension getDefaultInstanceForType() { + return org.bitcoinj.wallet.Protos.Extension.getDefaultInstance(); + } + + public org.bitcoinj.wallet.Protos.Extension build() { + org.bitcoinj.wallet.Protos.Extension result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.bitcoinj.wallet.Protos.Extension buildPartial() { + org.bitcoinj.wallet.Protos.Extension result = new org.bitcoinj.wallet.Protos.Extension(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.id_ = id_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.data_ = data_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.mandatory_ = mandatory_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof org.bitcoinj.wallet.Protos.Extension) { + return mergeFrom((org.bitcoinj.wallet.Protos.Extension)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Extension other) { + if (other == org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()) return this; + if (other.hasId()) { + bitField0_ |= 0x00000001; + id_ = other.id_; + onChanged(); + } + if (other.hasData()) { + setData(other.getData()); + } + if (other.hasMandatory()) { + setMandatory(other.getMandatory()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasId()) { + + return false; + } + if (!hasData()) { + + return false; + } + if (!hasMandatory()) { + + return false; + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.bitcoinj.wallet.Protos.Extension parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.Extension) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; } - private int bitField0_; - + // required string id = 1; private java.lang.Object id_ = ""; + /** + * required string id = 1; + * + *
+       * like org.whatever.foo.bar
+       * 
+ */ public boolean hasId() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getId() { + /** + * required string id = 1; + * + *
+       * like org.whatever.foo.bar
+       * 
+ */ + public java.lang.String getId() { java.lang.Object ref = id_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); id_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } - public Builder setId(String value) { + /** + * required string id = 1; + * + *
+       * like org.whatever.foo.bar
+       * 
+ */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string id = 1; + * + *
+       * like org.whatever.foo.bar
+       * 
+ */ + public Builder setId( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -6514,26 +9693,54 @@ public final class Protos { onChanged(); return this; } + /** + * required string id = 1; + * + *
+       * like org.whatever.foo.bar
+       * 
+ */ public Builder clearId() { bitField0_ = (bitField0_ & ~0x00000001); id_ = getDefaultInstance().getId(); onChanged(); return this; } - void setId(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000001; + /** + * required string id = 1; + * + *
+       * like org.whatever.foo.bar
+       * 
+ */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; id_ = value; onChanged(); + return this; } - + // required bytes data = 2; private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * required bytes data = 2; + */ public boolean hasData() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * required bytes data = 2; + */ public com.google.protobuf.ByteString getData() { return data_; } + /** + * required bytes data = 2; + */ public Builder setData(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -6543,151 +9750,551 @@ public final class Protos { onChanged(); return this; } + /** + * required bytes data = 2; + */ public Builder clearData() { bitField0_ = (bitField0_ & ~0x00000002); data_ = getDefaultInstance().getData(); onChanged(); return this; } - + // required bool mandatory = 3; private boolean mandatory_ ; + /** + * required bool mandatory = 3; + * + *
+       * If we do not understand a mandatory extension, abort to prevent data loss.
+       * For example, this could be applied to a new type of holding, such as a contract, where
+       * dropping of an extension in a read/write cycle could cause loss of value.
+       * 
+ */ public boolean hasMandatory() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * required bool mandatory = 3; + * + *
+       * If we do not understand a mandatory extension, abort to prevent data loss.
+       * For example, this could be applied to a new type of holding, such as a contract, where
+       * dropping of an extension in a read/write cycle could cause loss of value.
+       * 
+ */ public boolean getMandatory() { return mandatory_; } + /** + * required bool mandatory = 3; + * + *
+       * If we do not understand a mandatory extension, abort to prevent data loss.
+       * For example, this could be applied to a new type of holding, such as a contract, where
+       * dropping of an extension in a read/write cycle could cause loss of value.
+       * 
+ */ public Builder setMandatory(boolean value) { bitField0_ |= 0x00000004; mandatory_ = value; onChanged(); return this; } + /** + * required bool mandatory = 3; + * + *
+       * If we do not understand a mandatory extension, abort to prevent data loss.
+       * For example, this could be applied to a new type of holding, such as a contract, where
+       * dropping of an extension in a read/write cycle could cause loss of value.
+       * 
+ */ public Builder clearMandatory() { bitField0_ = (bitField0_ & ~0x00000004); mandatory_ = false; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.Extension) } - + static { defaultInstance = new Extension(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.Extension) } - + public interface WalletOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string network_identifier = 1; + /** + * required string network_identifier = 1; + * + *
+     * the network used by this wallet
+     * 
+ */ boolean hasNetworkIdentifier(); - String getNetworkIdentifier(); - + /** + * required string network_identifier = 1; + * + *
+     * the network used by this wallet
+     * 
+ */ + java.lang.String getNetworkIdentifier(); + /** + * required string network_identifier = 1; + * + *
+     * the network used by this wallet
+     * 
+ */ + com.google.protobuf.ByteString + getNetworkIdentifierBytes(); + // optional bytes last_seen_block_hash = 2; + /** + * optional bytes last_seen_block_hash = 2; + * + *
+     * The SHA256 hash of the head of the best chain seen by this wallet.
+     * 
+ */ boolean hasLastSeenBlockHash(); + /** + * optional bytes last_seen_block_hash = 2; + * + *
+     * The SHA256 hash of the head of the best chain seen by this wallet.
+     * 
+ */ com.google.protobuf.ByteString getLastSeenBlockHash(); - + // optional uint32 last_seen_block_height = 12; + /** + * optional uint32 last_seen_block_height = 12; + * + *
+     * The height in the chain of the last seen block.
+     * 
+ */ boolean hasLastSeenBlockHeight(); + /** + * optional uint32 last_seen_block_height = 12; + * + *
+     * The height in the chain of the last seen block.
+     * 
+ */ int getLastSeenBlockHeight(); - + // repeated .wallet.Key key = 3; + /** + * repeated .wallet.Key key = 3; + */ java.util.List getKeyList(); + /** + * repeated .wallet.Key key = 3; + */ org.bitcoinj.wallet.Protos.Key getKey(int index); + /** + * repeated .wallet.Key key = 3; + */ int getKeyCount(); + /** + * repeated .wallet.Key key = 3; + */ java.util.List getKeyOrBuilderList(); + /** + * repeated .wallet.Key key = 3; + */ org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder( int index); - + // repeated .wallet.Transaction transaction = 4; + /** + * repeated .wallet.Transaction transaction = 4; + */ java.util.List getTransactionList(); + /** + * repeated .wallet.Transaction transaction = 4; + */ org.bitcoinj.wallet.Protos.Transaction getTransaction(int index); + /** + * repeated .wallet.Transaction transaction = 4; + */ int getTransactionCount(); + /** + * repeated .wallet.Transaction transaction = 4; + */ java.util.List getTransactionOrBuilderList(); + /** + * repeated .wallet.Transaction transaction = 4; + */ org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder( int index); - + // optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ boolean hasEncryptionType(); + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ org.bitcoinj.wallet.Protos.Wallet.EncryptionType getEncryptionType(); - + // optional .wallet.ScryptParameters encryption_parameters = 6; + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ boolean hasEncryptionParameters(); + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ org.bitcoinj.wallet.Protos.ScryptParameters getEncryptionParameters(); + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder getEncryptionParametersOrBuilder(); - + // optional int32 version = 7; + /** + * optional int32 version = 7; + * + *
+     * The version number of the wallet - used to detect wallets that were produced in the future
+     * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+     * 
+ */ boolean hasVersion(); + /** + * optional int32 version = 7; + * + *
+     * The version number of the wallet - used to detect wallets that were produced in the future
+     * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+     * 
+ */ int getVersion(); - + // repeated .wallet.Extension extension = 10; + /** + * repeated .wallet.Extension extension = 10; + */ java.util.List getExtensionList(); + /** + * repeated .wallet.Extension extension = 10; + */ org.bitcoinj.wallet.Protos.Extension getExtension(int index); + /** + * repeated .wallet.Extension extension = 10; + */ int getExtensionCount(); + /** + * repeated .wallet.Extension extension = 10; + */ java.util.List getExtensionOrBuilderList(); + /** + * repeated .wallet.Extension extension = 10; + */ org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder( int index); - + // optional string description = 11; + /** + * optional string description = 11; + * + *
+     * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+     * 
+ */ boolean hasDescription(); - String getDescription(); - + /** + * optional string description = 11; + * + *
+     * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+     * 
+ */ + java.lang.String getDescription(); + /** + * optional string description = 11; + * + *
+     * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+     * 
+ */ + com.google.protobuf.ByteString + getDescriptionBytes(); + // optional uint64 key_rotation_time = 13; + /** + * optional uint64 key_rotation_time = 13; + * + *
+     * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+     * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+     * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+     * 
+ */ boolean hasKeyRotationTime(); + /** + * optional uint64 key_rotation_time = 13; + * + *
+     * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+     * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+     * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+     * 
+ */ long getKeyRotationTime(); } + /** + * Protobuf type {@code wallet.Wallet} + * + *
+   ** A bitcoin wallet 
+   * 
+ */ public static final class Wallet extends com.google.protobuf.GeneratedMessage implements WalletOrBuilder { // Use Wallet.newBuilder() to construct. - private Wallet(Builder builder) { + private Wallet(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); + this.unknownFields = builder.getUnknownFields(); } - private Wallet(boolean noInit) {} - + private Wallet(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); } + private static final Wallet defaultInstance; public static Wallet getDefaultInstance() { return defaultInstance; } - + public Wallet getDefaultInstanceForType() { return defaultInstance; } - + + private final com.google.protobuf.UnknownFieldSet unknownFields; + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Wallet( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + bitField0_ |= 0x00000001; + networkIdentifier_ = input.readBytes(); + break; + } + case 18: { + bitField0_ |= 0x00000002; + lastSeenBlockHash_ = input.readBytes(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + key_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000008; + } + key_.add(input.readMessage(org.bitcoinj.wallet.Protos.Key.PARSER, extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + transaction_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + transaction_.add(input.readMessage(org.bitcoinj.wallet.Protos.Transaction.PARSER, extensionRegistry)); + break; + } + case 40: { + int rawValue = input.readEnum(); + org.bitcoinj.wallet.Protos.Wallet.EncryptionType value = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(5, rawValue); + } else { + bitField0_ |= 0x00000008; + encryptionType_ = value; + } + break; + } + case 50: { + org.bitcoinj.wallet.Protos.ScryptParameters.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = encryptionParameters_.toBuilder(); + } + encryptionParameters_ = input.readMessage(org.bitcoinj.wallet.Protos.ScryptParameters.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptionParameters_); + encryptionParameters_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 56: { + bitField0_ |= 0x00000020; + version_ = input.readInt32(); + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + extension_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + extension_.add(input.readMessage(org.bitcoinj.wallet.Protos.Extension.PARSER, extensionRegistry)); + break; + } + case 90: { + bitField0_ |= 0x00000040; + description_ = input.readBytes(); + break; + } + case 96: { + bitField0_ |= 0x00000004; + lastSeenBlockHeight_ = input.readUInt32(); + break; + } + case 104: { + bitField0_ |= 0x00000080; + keyRotationTime_ = input.readUInt64(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) { + key_ = java.util.Collections.unmodifiableList(key_); + } + if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) { + transaction_ = java.util.Collections.unmodifiableList(transaction_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + extension_ = java.util.Collections.unmodifiableList(extension_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Wallet.class, org.bitcoinj.wallet.Protos.Wallet.Builder.class); } - + + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public Wallet parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Wallet(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + /** + * Protobuf enum {@code wallet.Wallet.EncryptionType} + * + *
+     **
+     * The encryption type of the wallet.
+     *
+     * The encryption type is UNENCRYPTED for wallets where the wallet does not support encryption - wallets prior to
+     * encryption support are grandfathered in as this wallet type.
+     * When a wallet is ENCRYPTED_SCRYPT_AES the keys are either encrypted with the wallet password or are unencrypted.
+     * 
+ */ public enum EncryptionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * UNENCRYPTED = 1; + * + *
+       * All keys in the wallet are unencrypted
+       * 
+ */ UNENCRYPTED(0, 1), + /** + * ENCRYPTED_SCRYPT_AES = 2; + * + *
+       * All keys are encrypted with a passphrase based KDF of scrypt and AES encryption
+       * 
+ */ ENCRYPTED_SCRYPT_AES(1, 2), ; - + + /** + * UNENCRYPTED = 1; + * + *
+       * All keys in the wallet are unencrypted
+       * 
+ */ public static final int UNENCRYPTED_VALUE = 1; + /** + * ENCRYPTED_SCRYPT_AES = 2; + * + *
+       * All keys are encrypted with a passphrase based KDF of scrypt and AES encryption
+       * 
+ */ public static final int ENCRYPTED_SCRYPT_AES_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static EncryptionType valueOf(int value) { switch (value) { case 1: return UNENCRYPTED; @@ -6695,7 +10302,7 @@ public final class Protos { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -6707,7 +10314,7 @@ public final class Protos { return EncryptionType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -6720,11 +10327,9 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.Wallet.getDescriptor().getEnumTypes().get(0); } - - private static final EncryptionType[] VALUES = { - UNENCRYPTED, ENCRYPTED_SCRYPT_AES, - }; - + + private static final EncryptionType[] VALUES = values(); + public static EncryptionType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -6733,209 +10338,377 @@ public final class Protos { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private EncryptionType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:wallet.Wallet.EncryptionType) } - + private int bitField0_; // required string network_identifier = 1; public static final int NETWORK_IDENTIFIER_FIELD_NUMBER = 1; private java.lang.Object networkIdentifier_; + /** + * required string network_identifier = 1; + * + *
+     * the network used by this wallet
+     * 
+ */ public boolean hasNetworkIdentifier() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getNetworkIdentifier() { + /** + * required string network_identifier = 1; + * + *
+     * the network used by this wallet
+     * 
+ */ + public java.lang.String getNetworkIdentifier() { java.lang.Object ref = networkIdentifier_; - if (ref instanceof String) { - return (String) ref; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { networkIdentifier_ = s; } return s; } } - private com.google.protobuf.ByteString getNetworkIdentifierBytes() { + /** + * required string network_identifier = 1; + * + *
+     * the network used by this wallet
+     * 
+ */ + public com.google.protobuf.ByteString + getNetworkIdentifierBytes() { java.lang.Object ref = networkIdentifier_; - if (ref instanceof String) { + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); networkIdentifier_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } - + // optional bytes last_seen_block_hash = 2; public static final int LAST_SEEN_BLOCK_HASH_FIELD_NUMBER = 2; private com.google.protobuf.ByteString lastSeenBlockHash_; + /** + * optional bytes last_seen_block_hash = 2; + * + *
+     * The SHA256 hash of the head of the best chain seen by this wallet.
+     * 
+ */ public boolean hasLastSeenBlockHash() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional bytes last_seen_block_hash = 2; + * + *
+     * The SHA256 hash of the head of the best chain seen by this wallet.
+     * 
+ */ public com.google.protobuf.ByteString getLastSeenBlockHash() { return lastSeenBlockHash_; } - + // optional uint32 last_seen_block_height = 12; public static final int LAST_SEEN_BLOCK_HEIGHT_FIELD_NUMBER = 12; private int lastSeenBlockHeight_; + /** + * optional uint32 last_seen_block_height = 12; + * + *
+     * The height in the chain of the last seen block.
+     * 
+ */ public boolean hasLastSeenBlockHeight() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional uint32 last_seen_block_height = 12; + * + *
+     * The height in the chain of the last seen block.
+     * 
+ */ public int getLastSeenBlockHeight() { return lastSeenBlockHeight_; } - + // repeated .wallet.Key key = 3; public static final int KEY_FIELD_NUMBER = 3; private java.util.List key_; + /** + * repeated .wallet.Key key = 3; + */ public java.util.List getKeyList() { return key_; } + /** + * repeated .wallet.Key key = 3; + */ public java.util.List getKeyOrBuilderList() { return key_; } + /** + * repeated .wallet.Key key = 3; + */ public int getKeyCount() { return key_.size(); } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.Key getKey(int index) { return key_.get(index); } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder( int index) { return key_.get(index); } - + // repeated .wallet.Transaction transaction = 4; public static final int TRANSACTION_FIELD_NUMBER = 4; private java.util.List transaction_; + /** + * repeated .wallet.Transaction transaction = 4; + */ public java.util.List getTransactionList() { return transaction_; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public java.util.List getTransactionOrBuilderList() { return transaction_; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public int getTransactionCount() { return transaction_.size(); } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.Transaction getTransaction(int index) { return transaction_.get(index); } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder( int index) { return transaction_.get(index); } - + // optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 5; private org.bitcoinj.wallet.Protos.Wallet.EncryptionType encryptionType_; + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ public boolean hasEncryptionType() { return ((bitField0_ & 0x00000008) == 0x00000008); } + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ public org.bitcoinj.wallet.Protos.Wallet.EncryptionType getEncryptionType() { return encryptionType_; } - + // optional .wallet.ScryptParameters encryption_parameters = 6; public static final int ENCRYPTION_PARAMETERS_FIELD_NUMBER = 6; private org.bitcoinj.wallet.Protos.ScryptParameters encryptionParameters_; + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public boolean hasEncryptionParameters() { return ((bitField0_ & 0x00000010) == 0x00000010); } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public org.bitcoinj.wallet.Protos.ScryptParameters getEncryptionParameters() { return encryptionParameters_; } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder getEncryptionParametersOrBuilder() { return encryptionParameters_; } - + // optional int32 version = 7; public static final int VERSION_FIELD_NUMBER = 7; private int version_; + /** + * optional int32 version = 7; + * + *
+     * The version number of the wallet - used to detect wallets that were produced in the future
+     * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+     * 
+ */ public boolean hasVersion() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional int32 version = 7; + * + *
+     * The version number of the wallet - used to detect wallets that were produced in the future
+     * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+     * 
+ */ public int getVersion() { return version_; } - + // repeated .wallet.Extension extension = 10; public static final int EXTENSION_FIELD_NUMBER = 10; private java.util.List extension_; + /** + * repeated .wallet.Extension extension = 10; + */ public java.util.List getExtensionList() { return extension_; } + /** + * repeated .wallet.Extension extension = 10; + */ public java.util.List getExtensionOrBuilderList() { return extension_; } + /** + * repeated .wallet.Extension extension = 10; + */ public int getExtensionCount() { return extension_.size(); } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.Extension getExtension(int index) { return extension_.get(index); } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder( int index) { return extension_.get(index); } - + // optional string description = 11; public static final int DESCRIPTION_FIELD_NUMBER = 11; private java.lang.Object description_; + /** + * optional string description = 11; + * + *
+     * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+     * 
+ */ public boolean hasDescription() { return ((bitField0_ & 0x00000040) == 0x00000040); } - public String getDescription() { + /** + * optional string description = 11; + * + *
+     * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+     * 
+ */ + public java.lang.String getDescription() { java.lang.Object ref = description_; - if (ref instanceof String) { - return (String) ref; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; } else { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { description_ = s; } return s; } } - private com.google.protobuf.ByteString getDescriptionBytes() { + /** + * optional string description = 11; + * + *
+     * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+     * 
+ */ + public com.google.protobuf.ByteString + getDescriptionBytes() { java.lang.Object ref = description_; - if (ref instanceof String) { + if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); description_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } - + // optional uint64 key_rotation_time = 13; public static final int KEY_ROTATION_TIME_FIELD_NUMBER = 13; private long keyRotationTime_; + /** + * optional uint64 key_rotation_time = 13; + * + *
+     * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+     * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+     * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+     * 
+ */ public boolean hasKeyRotationTime() { return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional uint64 key_rotation_time = 13; + * + *
+     * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+     * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+     * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+     * 
+ */ public long getKeyRotationTime() { return keyRotationTime_; } - + private void initFields() { networkIdentifier_ = ""; lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY; @@ -6953,7 +10726,7 @@ public final class Protos { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasNetworkIdentifier()) { memoizedIsInitialized = 0; return false; @@ -6985,7 +10758,7 @@ public final class Protos { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -7024,12 +10797,12 @@ public final class Protos { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -7079,94 +10852,87 @@ public final class Protos { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static org.bitcoinj.wallet.Protos.Wallet parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); + return PARSER.parseFrom(data); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(data, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom(java.io.InputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Wallet parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input); } public static org.bitcoinj.wallet.Protos.Wallet parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } + return PARSER.parseDelimitedFrom(input, extensionRegistry); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); + return PARSER.parseFrom(input); } public static org.bitcoinj.wallet.Protos.Wallet parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); + return PARSER.parseFrom(input, extensionRegistry); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(org.bitcoinj.wallet.Protos.Wallet prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } + /** + * Protobuf type {@code wallet.Wallet} + * + *
+     ** A bitcoin wallet 
+     * 
+ */ public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements org.bitcoinj.wallet.Protos.WalletOrBuilder { @@ -7174,18 +10940,21 @@ public final class Protos { getDescriptor() { return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable; + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_fieldAccessorTable + .ensureFieldAccessorsInitialized( + org.bitcoinj.wallet.Protos.Wallet.class, org.bitcoinj.wallet.Protos.Wallet.Builder.class); } - + // Construct using org.bitcoinj.wallet.Protos.Wallet.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(BuilderParent parent) { + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -7200,7 +10969,7 @@ public final class Protos { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); networkIdentifier_ = ""; @@ -7243,20 +11012,20 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000400); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return org.bitcoinj.wallet.Protos.Wallet.getDescriptor(); + return org.bitcoinj.wallet.Protos.internal_static_wallet_Wallet_descriptor; } - + public org.bitcoinj.wallet.Protos.Wallet getDefaultInstanceForType() { return org.bitcoinj.wallet.Protos.Wallet.getDefaultInstance(); } - + public org.bitcoinj.wallet.Protos.Wallet build() { org.bitcoinj.wallet.Protos.Wallet result = buildPartial(); if (!result.isInitialized()) { @@ -7264,17 +11033,7 @@ public final class Protos { } return result; } - - private org.bitcoinj.wallet.Protos.Wallet buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - org.bitcoinj.wallet.Protos.Wallet result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - + public org.bitcoinj.wallet.Protos.Wallet buildPartial() { org.bitcoinj.wallet.Protos.Wallet result = new org.bitcoinj.wallet.Protos.Wallet(this); int from_bitField0_ = bitField0_; @@ -7346,7 +11105,7 @@ public final class Protos { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.bitcoinj.wallet.Protos.Wallet) { return mergeFrom((org.bitcoinj.wallet.Protos.Wallet)other); @@ -7355,11 +11114,13 @@ public final class Protos { return this; } } - + public Builder mergeFrom(org.bitcoinj.wallet.Protos.Wallet other) { if (other == org.bitcoinj.wallet.Protos.Wallet.getDefaultInstance()) return this; if (other.hasNetworkIdentifier()) { - setNetworkIdentifier(other.getNetworkIdentifier()); + bitField0_ |= 0x00000001; + networkIdentifier_ = other.networkIdentifier_; + onChanged(); } if (other.hasLastSeenBlockHash()) { setLastSeenBlockHash(other.getLastSeenBlockHash()); @@ -7455,7 +11216,9 @@ public final class Protos { } } if (other.hasDescription()) { - setDescription(other.getDescription()); + bitField0_ |= 0x00000200; + description_ = other.description_; + onChanged(); } if (other.hasKeyRotationTime()) { setKeyRotationTime(other.getKeyRotationTime()); @@ -7463,7 +11226,7 @@ public final class Protos { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasNetworkIdentifier()) { @@ -7495,120 +11258,85 @@ public final class Protos { } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - networkIdentifier_ = input.readBytes(); - break; - } - case 18: { - bitField0_ |= 0x00000002; - lastSeenBlockHash_ = input.readBytes(); - break; - } - case 26: { - org.bitcoinj.wallet.Protos.Key.Builder subBuilder = org.bitcoinj.wallet.Protos.Key.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addKey(subBuilder.buildPartial()); - break; - } - case 34: { - org.bitcoinj.wallet.Protos.Transaction.Builder subBuilder = org.bitcoinj.wallet.Protos.Transaction.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addTransaction(subBuilder.buildPartial()); - break; - } - case 40: { - int rawValue = input.readEnum(); - org.bitcoinj.wallet.Protos.Wallet.EncryptionType value = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(5, rawValue); - } else { - bitField0_ |= 0x00000020; - encryptionType_ = value; - } - break; - } - case 50: { - org.bitcoinj.wallet.Protos.ScryptParameters.Builder subBuilder = org.bitcoinj.wallet.Protos.ScryptParameters.newBuilder(); - if (hasEncryptionParameters()) { - subBuilder.mergeFrom(getEncryptionParameters()); - } - input.readMessage(subBuilder, extensionRegistry); - setEncryptionParameters(subBuilder.buildPartial()); - break; - } - case 56: { - bitField0_ |= 0x00000080; - version_ = input.readInt32(); - break; - } - case 82: { - org.bitcoinj.wallet.Protos.Extension.Builder subBuilder = org.bitcoinj.wallet.Protos.Extension.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addExtension(subBuilder.buildPartial()); - break; - } - case 90: { - bitField0_ |= 0x00000200; - description_ = input.readBytes(); - break; - } - case 96: { - bitField0_ |= 0x00000004; - lastSeenBlockHeight_ = input.readUInt32(); - break; - } - case 104: { - bitField0_ |= 0x00000400; - keyRotationTime_ = input.readUInt64(); - break; - } + org.bitcoinj.wallet.Protos.Wallet parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.bitcoinj.wallet.Protos.Wallet) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - private int bitField0_; - + // required string network_identifier = 1; private java.lang.Object networkIdentifier_ = ""; + /** + * required string network_identifier = 1; + * + *
+       * the network used by this wallet
+       * 
+ */ public boolean hasNetworkIdentifier() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getNetworkIdentifier() { + /** + * required string network_identifier = 1; + * + *
+       * the network used by this wallet
+       * 
+ */ + public java.lang.String getNetworkIdentifier() { java.lang.Object ref = networkIdentifier_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); networkIdentifier_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } - public Builder setNetworkIdentifier(String value) { + /** + * required string network_identifier = 1; + * + *
+       * the network used by this wallet
+       * 
+ */ + public com.google.protobuf.ByteString + getNetworkIdentifierBytes() { + java.lang.Object ref = networkIdentifier_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + networkIdentifier_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * required string network_identifier = 1; + * + *
+       * the network used by this wallet
+       * 
+ */ + public Builder setNetworkIdentifier( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -7617,26 +11345,66 @@ public final class Protos { onChanged(); return this; } + /** + * required string network_identifier = 1; + * + *
+       * the network used by this wallet
+       * 
+ */ public Builder clearNetworkIdentifier() { bitField0_ = (bitField0_ & ~0x00000001); networkIdentifier_ = getDefaultInstance().getNetworkIdentifier(); onChanged(); return this; } - void setNetworkIdentifier(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000001; + /** + * required string network_identifier = 1; + * + *
+       * the network used by this wallet
+       * 
+ */ + public Builder setNetworkIdentifierBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; networkIdentifier_ = value; onChanged(); + return this; } - + // optional bytes last_seen_block_hash = 2; private com.google.protobuf.ByteString lastSeenBlockHash_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes last_seen_block_hash = 2; + * + *
+       * The SHA256 hash of the head of the best chain seen by this wallet.
+       * 
+ */ public boolean hasLastSeenBlockHash() { return ((bitField0_ & 0x00000002) == 0x00000002); } + /** + * optional bytes last_seen_block_hash = 2; + * + *
+       * The SHA256 hash of the head of the best chain seen by this wallet.
+       * 
+ */ public com.google.protobuf.ByteString getLastSeenBlockHash() { return lastSeenBlockHash_; } + /** + * optional bytes last_seen_block_hash = 2; + * + *
+       * The SHA256 hash of the head of the best chain seen by this wallet.
+       * 
+ */ public Builder setLastSeenBlockHash(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); @@ -7646,34 +11414,69 @@ public final class Protos { onChanged(); return this; } + /** + * optional bytes last_seen_block_hash = 2; + * + *
+       * The SHA256 hash of the head of the best chain seen by this wallet.
+       * 
+ */ public Builder clearLastSeenBlockHash() { bitField0_ = (bitField0_ & ~0x00000002); lastSeenBlockHash_ = getDefaultInstance().getLastSeenBlockHash(); onChanged(); return this; } - + // optional uint32 last_seen_block_height = 12; private int lastSeenBlockHeight_ ; + /** + * optional uint32 last_seen_block_height = 12; + * + *
+       * The height in the chain of the last seen block.
+       * 
+ */ public boolean hasLastSeenBlockHeight() { return ((bitField0_ & 0x00000004) == 0x00000004); } + /** + * optional uint32 last_seen_block_height = 12; + * + *
+       * The height in the chain of the last seen block.
+       * 
+ */ public int getLastSeenBlockHeight() { return lastSeenBlockHeight_; } + /** + * optional uint32 last_seen_block_height = 12; + * + *
+       * The height in the chain of the last seen block.
+       * 
+ */ public Builder setLastSeenBlockHeight(int value) { bitField0_ |= 0x00000004; lastSeenBlockHeight_ = value; onChanged(); return this; } + /** + * optional uint32 last_seen_block_height = 12; + * + *
+       * The height in the chain of the last seen block.
+       * 
+ */ public Builder clearLastSeenBlockHeight() { bitField0_ = (bitField0_ & ~0x00000004); lastSeenBlockHeight_ = 0; onChanged(); return this; } - + // repeated .wallet.Key key = 3; private java.util.List key_ = java.util.Collections.emptyList(); @@ -7683,10 +11486,13 @@ public final class Protos { bitField0_ |= 0x00000008; } } - + private com.google.protobuf.RepeatedFieldBuilder< org.bitcoinj.wallet.Protos.Key, org.bitcoinj.wallet.Protos.Key.Builder, org.bitcoinj.wallet.Protos.KeyOrBuilder> keyBuilder_; - + + /** + * repeated .wallet.Key key = 3; + */ public java.util.List getKeyList() { if (keyBuilder_ == null) { return java.util.Collections.unmodifiableList(key_); @@ -7694,6 +11500,9 @@ public final class Protos { return keyBuilder_.getMessageList(); } } + /** + * repeated .wallet.Key key = 3; + */ public int getKeyCount() { if (keyBuilder_ == null) { return key_.size(); @@ -7701,6 +11510,9 @@ public final class Protos { return keyBuilder_.getCount(); } } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.Key getKey(int index) { if (keyBuilder_ == null) { return key_.get(index); @@ -7708,6 +11520,9 @@ public final class Protos { return keyBuilder_.getMessage(index); } } + /** + * repeated .wallet.Key key = 3; + */ public Builder setKey( int index, org.bitcoinj.wallet.Protos.Key value) { if (keyBuilder_ == null) { @@ -7722,6 +11537,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder setKey( int index, org.bitcoinj.wallet.Protos.Key.Builder builderForValue) { if (keyBuilder_ == null) { @@ -7733,6 +11551,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder addKey(org.bitcoinj.wallet.Protos.Key value) { if (keyBuilder_ == null) { if (value == null) { @@ -7746,6 +11567,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder addKey( int index, org.bitcoinj.wallet.Protos.Key value) { if (keyBuilder_ == null) { @@ -7760,6 +11584,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder addKey( org.bitcoinj.wallet.Protos.Key.Builder builderForValue) { if (keyBuilder_ == null) { @@ -7771,6 +11598,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder addKey( int index, org.bitcoinj.wallet.Protos.Key.Builder builderForValue) { if (keyBuilder_ == null) { @@ -7782,6 +11612,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder addAllKey( java.lang.Iterable values) { if (keyBuilder_ == null) { @@ -7793,6 +11626,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder clearKey() { if (keyBuilder_ == null) { key_ = java.util.Collections.emptyList(); @@ -7803,6 +11639,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public Builder removeKey(int index) { if (keyBuilder_ == null) { ensureKeyIsMutable(); @@ -7813,10 +11652,16 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.Key.Builder getKeyBuilder( int index) { return getKeyFieldBuilder().getBuilder(index); } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.KeyOrBuilder getKeyOrBuilder( int index) { if (keyBuilder_ == null) { @@ -7824,6 +11669,9 @@ public final class Protos { return keyBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .wallet.Key key = 3; + */ public java.util.List getKeyOrBuilderList() { if (keyBuilder_ != null) { @@ -7832,15 +11680,24 @@ public final class Protos { return java.util.Collections.unmodifiableList(key_); } } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.Key.Builder addKeyBuilder() { return getKeyFieldBuilder().addBuilder( org.bitcoinj.wallet.Protos.Key.getDefaultInstance()); } + /** + * repeated .wallet.Key key = 3; + */ public org.bitcoinj.wallet.Protos.Key.Builder addKeyBuilder( int index) { return getKeyFieldBuilder().addBuilder( index, org.bitcoinj.wallet.Protos.Key.getDefaultInstance()); } + /** + * repeated .wallet.Key key = 3; + */ public java.util.List getKeyBuilderList() { return getKeyFieldBuilder().getBuilderList(); @@ -7859,7 +11716,7 @@ public final class Protos { } return keyBuilder_; } - + // repeated .wallet.Transaction transaction = 4; private java.util.List transaction_ = java.util.Collections.emptyList(); @@ -7869,10 +11726,13 @@ public final class Protos { bitField0_ |= 0x00000010; } } - + private com.google.protobuf.RepeatedFieldBuilder< org.bitcoinj.wallet.Protos.Transaction, org.bitcoinj.wallet.Protos.Transaction.Builder, org.bitcoinj.wallet.Protos.TransactionOrBuilder> transactionBuilder_; - + + /** + * repeated .wallet.Transaction transaction = 4; + */ public java.util.List getTransactionList() { if (transactionBuilder_ == null) { return java.util.Collections.unmodifiableList(transaction_); @@ -7880,6 +11740,9 @@ public final class Protos { return transactionBuilder_.getMessageList(); } } + /** + * repeated .wallet.Transaction transaction = 4; + */ public int getTransactionCount() { if (transactionBuilder_ == null) { return transaction_.size(); @@ -7887,6 +11750,9 @@ public final class Protos { return transactionBuilder_.getCount(); } } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.Transaction getTransaction(int index) { if (transactionBuilder_ == null) { return transaction_.get(index); @@ -7894,6 +11760,9 @@ public final class Protos { return transactionBuilder_.getMessage(index); } } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder setTransaction( int index, org.bitcoinj.wallet.Protos.Transaction value) { if (transactionBuilder_ == null) { @@ -7908,6 +11777,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder setTransaction( int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { if (transactionBuilder_ == null) { @@ -7919,6 +11791,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder addTransaction(org.bitcoinj.wallet.Protos.Transaction value) { if (transactionBuilder_ == null) { if (value == null) { @@ -7932,6 +11807,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder addTransaction( int index, org.bitcoinj.wallet.Protos.Transaction value) { if (transactionBuilder_ == null) { @@ -7946,6 +11824,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder addTransaction( org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { if (transactionBuilder_ == null) { @@ -7957,6 +11838,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder addTransaction( int index, org.bitcoinj.wallet.Protos.Transaction.Builder builderForValue) { if (transactionBuilder_ == null) { @@ -7968,6 +11852,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder addAllTransaction( java.lang.Iterable values) { if (transactionBuilder_ == null) { @@ -7979,6 +11866,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder clearTransaction() { if (transactionBuilder_ == null) { transaction_ = java.util.Collections.emptyList(); @@ -7989,6 +11879,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public Builder removeTransaction(int index) { if (transactionBuilder_ == null) { ensureTransactionIsMutable(); @@ -7999,10 +11892,16 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.Transaction.Builder getTransactionBuilder( int index) { return getTransactionFieldBuilder().getBuilder(index); } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.TransactionOrBuilder getTransactionOrBuilder( int index) { if (transactionBuilder_ == null) { @@ -8010,6 +11909,9 @@ public final class Protos { return transactionBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .wallet.Transaction transaction = 4; + */ public java.util.List getTransactionOrBuilderList() { if (transactionBuilder_ != null) { @@ -8018,15 +11920,24 @@ public final class Protos { return java.util.Collections.unmodifiableList(transaction_); } } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.Transaction.Builder addTransactionBuilder() { return getTransactionFieldBuilder().addBuilder( org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()); } + /** + * repeated .wallet.Transaction transaction = 4; + */ public org.bitcoinj.wallet.Protos.Transaction.Builder addTransactionBuilder( int index) { return getTransactionFieldBuilder().addBuilder( index, org.bitcoinj.wallet.Protos.Transaction.getDefaultInstance()); } + /** + * repeated .wallet.Transaction transaction = 4; + */ public java.util.List getTransactionBuilderList() { return getTransactionFieldBuilder().getBuilderList(); @@ -8045,15 +11956,24 @@ public final class Protos { } return transactionBuilder_; } - + // optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; private org.bitcoinj.wallet.Protos.Wallet.EncryptionType encryptionType_ = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.UNENCRYPTED; + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ public boolean hasEncryptionType() { return ((bitField0_ & 0x00000020) == 0x00000020); } + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ public org.bitcoinj.wallet.Protos.Wallet.EncryptionType getEncryptionType() { return encryptionType_; } + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ public Builder setEncryptionType(org.bitcoinj.wallet.Protos.Wallet.EncryptionType value) { if (value == null) { throw new NullPointerException(); @@ -8063,20 +11983,29 @@ public final class Protos { onChanged(); return this; } + /** + * optional .wallet.Wallet.EncryptionType encryption_type = 5 [default = UNENCRYPTED]; + */ public Builder clearEncryptionType() { bitField0_ = (bitField0_ & ~0x00000020); encryptionType_ = org.bitcoinj.wallet.Protos.Wallet.EncryptionType.UNENCRYPTED; onChanged(); return this; } - + // optional .wallet.ScryptParameters encryption_parameters = 6; private org.bitcoinj.wallet.Protos.ScryptParameters encryptionParameters_ = org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< org.bitcoinj.wallet.Protos.ScryptParameters, org.bitcoinj.wallet.Protos.ScryptParameters.Builder, org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder> encryptionParametersBuilder_; + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public boolean hasEncryptionParameters() { return ((bitField0_ & 0x00000040) == 0x00000040); } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public org.bitcoinj.wallet.Protos.ScryptParameters getEncryptionParameters() { if (encryptionParametersBuilder_ == null) { return encryptionParameters_; @@ -8084,6 +12013,9 @@ public final class Protos { return encryptionParametersBuilder_.getMessage(); } } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public Builder setEncryptionParameters(org.bitcoinj.wallet.Protos.ScryptParameters value) { if (encryptionParametersBuilder_ == null) { if (value == null) { @@ -8097,6 +12029,9 @@ public final class Protos { bitField0_ |= 0x00000040; return this; } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public Builder setEncryptionParameters( org.bitcoinj.wallet.Protos.ScryptParameters.Builder builderForValue) { if (encryptionParametersBuilder_ == null) { @@ -8108,6 +12043,9 @@ public final class Protos { bitField0_ |= 0x00000040; return this; } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public Builder mergeEncryptionParameters(org.bitcoinj.wallet.Protos.ScryptParameters value) { if (encryptionParametersBuilder_ == null) { if (((bitField0_ & 0x00000040) == 0x00000040) && @@ -8124,6 +12062,9 @@ public final class Protos { bitField0_ |= 0x00000040; return this; } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public Builder clearEncryptionParameters() { if (encryptionParametersBuilder_ == null) { encryptionParameters_ = org.bitcoinj.wallet.Protos.ScryptParameters.getDefaultInstance(); @@ -8134,11 +12075,17 @@ public final class Protos { bitField0_ = (bitField0_ & ~0x00000040); return this; } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public org.bitcoinj.wallet.Protos.ScryptParameters.Builder getEncryptionParametersBuilder() { bitField0_ |= 0x00000040; onChanged(); return getEncryptionParametersFieldBuilder().getBuilder(); } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ public org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder getEncryptionParametersOrBuilder() { if (encryptionParametersBuilder_ != null) { return encryptionParametersBuilder_.getMessageOrBuilder(); @@ -8146,6 +12093,9 @@ public final class Protos { return encryptionParameters_; } } + /** + * optional .wallet.ScryptParameters encryption_parameters = 6; + */ private com.google.protobuf.SingleFieldBuilder< org.bitcoinj.wallet.Protos.ScryptParameters, org.bitcoinj.wallet.Protos.ScryptParameters.Builder, org.bitcoinj.wallet.Protos.ScryptParametersOrBuilder> getEncryptionParametersFieldBuilder() { @@ -8159,28 +12109,60 @@ public final class Protos { } return encryptionParametersBuilder_; } - + // optional int32 version = 7; private int version_ ; + /** + * optional int32 version = 7; + * + *
+       * The version number of the wallet - used to detect wallets that were produced in the future
+       * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+       * 
+ */ public boolean hasVersion() { return ((bitField0_ & 0x00000080) == 0x00000080); } + /** + * optional int32 version = 7; + * + *
+       * The version number of the wallet - used to detect wallets that were produced in the future
+       * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+       * 
+ */ public int getVersion() { return version_; } + /** + * optional int32 version = 7; + * + *
+       * The version number of the wallet - used to detect wallets that were produced in the future
+       * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+       * 
+ */ public Builder setVersion(int value) { bitField0_ |= 0x00000080; version_ = value; onChanged(); return this; } + /** + * optional int32 version = 7; + * + *
+       * The version number of the wallet - used to detect wallets that were produced in the future
+       * (i.e the wallet may contain some future format this protobuf/ code does not know about)
+       * 
+ */ public Builder clearVersion() { bitField0_ = (bitField0_ & ~0x00000080); version_ = 0; onChanged(); return this; } - + // repeated .wallet.Extension extension = 10; private java.util.List extension_ = java.util.Collections.emptyList(); @@ -8190,10 +12172,13 @@ public final class Protos { bitField0_ |= 0x00000100; } } - + private com.google.protobuf.RepeatedFieldBuilder< org.bitcoinj.wallet.Protos.Extension, org.bitcoinj.wallet.Protos.Extension.Builder, org.bitcoinj.wallet.Protos.ExtensionOrBuilder> extensionBuilder_; - + + /** + * repeated .wallet.Extension extension = 10; + */ public java.util.List getExtensionList() { if (extensionBuilder_ == null) { return java.util.Collections.unmodifiableList(extension_); @@ -8201,6 +12186,9 @@ public final class Protos { return extensionBuilder_.getMessageList(); } } + /** + * repeated .wallet.Extension extension = 10; + */ public int getExtensionCount() { if (extensionBuilder_ == null) { return extension_.size(); @@ -8208,6 +12196,9 @@ public final class Protos { return extensionBuilder_.getCount(); } } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.Extension getExtension(int index) { if (extensionBuilder_ == null) { return extension_.get(index); @@ -8215,6 +12206,9 @@ public final class Protos { return extensionBuilder_.getMessage(index); } } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder setExtension( int index, org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { @@ -8229,6 +12223,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder setExtension( int index, org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) { if (extensionBuilder_ == null) { @@ -8240,6 +12237,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder addExtension(org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { if (value == null) { @@ -8253,6 +12253,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder addExtension( int index, org.bitcoinj.wallet.Protos.Extension value) { if (extensionBuilder_ == null) { @@ -8267,6 +12270,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder addExtension( org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) { if (extensionBuilder_ == null) { @@ -8278,6 +12284,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder addExtension( int index, org.bitcoinj.wallet.Protos.Extension.Builder builderForValue) { if (extensionBuilder_ == null) { @@ -8289,6 +12298,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder addAllExtension( java.lang.Iterable values) { if (extensionBuilder_ == null) { @@ -8300,6 +12312,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder clearExtension() { if (extensionBuilder_ == null) { extension_ = java.util.Collections.emptyList(); @@ -8310,6 +12325,9 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public Builder removeExtension(int index) { if (extensionBuilder_ == null) { ensureExtensionIsMutable(); @@ -8320,10 +12338,16 @@ public final class Protos { } return this; } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.Extension.Builder getExtensionBuilder( int index) { return getExtensionFieldBuilder().getBuilder(index); } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.ExtensionOrBuilder getExtensionOrBuilder( int index) { if (extensionBuilder_ == null) { @@ -8331,6 +12355,9 @@ public final class Protos { return extensionBuilder_.getMessageOrBuilder(index); } } + /** + * repeated .wallet.Extension extension = 10; + */ public java.util.List getExtensionOrBuilderList() { if (extensionBuilder_ != null) { @@ -8339,15 +12366,24 @@ public final class Protos { return java.util.Collections.unmodifiableList(extension_); } } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.Extension.Builder addExtensionBuilder() { return getExtensionFieldBuilder().addBuilder( org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()); } + /** + * repeated .wallet.Extension extension = 10; + */ public org.bitcoinj.wallet.Protos.Extension.Builder addExtensionBuilder( int index) { return getExtensionFieldBuilder().addBuilder( index, org.bitcoinj.wallet.Protos.Extension.getDefaultInstance()); } + /** + * repeated .wallet.Extension extension = 10; + */ public java.util.List getExtensionBuilderList() { return getExtensionFieldBuilder().getBuilderList(); @@ -8366,23 +12402,66 @@ public final class Protos { } return extensionBuilder_; } - + // optional string description = 11; private java.lang.Object description_ = ""; + /** + * optional string description = 11; + * + *
+       * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+       * 
+ */ public boolean hasDescription() { return ((bitField0_ & 0x00000200) == 0x00000200); } - public String getDescription() { + /** + * optional string description = 11; + * + *
+       * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+       * 
+ */ + public java.lang.String getDescription() { java.lang.Object ref = description_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + if (!(ref instanceof java.lang.String)) { + java.lang.String s = ((com.google.protobuf.ByteString) ref) + .toStringUtf8(); description_ = s; return s; } else { - return (String) ref; + return (java.lang.String) ref; } } - public Builder setDescription(String value) { + /** + * optional string description = 11; + * + *
+       * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+       * 
+ */ + public com.google.protobuf.ByteString + getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string description = 11; + * + *
+       * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+       * 
+ */ + public Builder setDescription( + java.lang.String value) { if (value == null) { throw new NullPointerException(); } @@ -8391,50 +12470,105 @@ public final class Protos { onChanged(); return this; } + /** + * optional string description = 11; + * + *
+       * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+       * 
+ */ public Builder clearDescription() { bitField0_ = (bitField0_ & ~0x00000200); description_ = getDefaultInstance().getDescription(); onChanged(); return this; } - void setDescription(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000200; + /** + * optional string description = 11; + * + *
+       * A UTF8 encoded text description of the wallet that is intended for end user provided text.
+       * 
+ */ + public Builder setDescriptionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; description_ = value; onChanged(); + return this; } - + // optional uint64 key_rotation_time = 13; private long keyRotationTime_ ; + /** + * optional uint64 key_rotation_time = 13; + * + *
+       * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+       * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+       * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+       * 
+ */ public boolean hasKeyRotationTime() { return ((bitField0_ & 0x00000400) == 0x00000400); } + /** + * optional uint64 key_rotation_time = 13; + * + *
+       * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+       * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+       * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+       * 
+ */ public long getKeyRotationTime() { return keyRotationTime_; } + /** + * optional uint64 key_rotation_time = 13; + * + *
+       * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+       * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+       * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+       * 
+ */ public Builder setKeyRotationTime(long value) { bitField0_ |= 0x00000400; keyRotationTime_ = value; onChanged(); return this; } + /** + * optional uint64 key_rotation_time = 13; + * + *
+       * UNIX time in seconds since the epoch. If set, then any keys created before this date are assumed to be no longer
+       * wanted. Money sent to them will be re-spent automatically to the first key that was created after this time. It
+       * can be used to recover a compromised wallet, or just as part of preventative defence-in-depth measures.
+       * 
+ */ public Builder clearKeyRotationTime() { bitField0_ = (bitField0_ & ~0x00000400); keyRotationTime_ = 0L; onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:wallet.Wallet) } - + static { defaultInstance = new Wallet(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:wallet.Wallet) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_wallet_PeerAddress_descriptor; private static @@ -8485,7 +12619,7 @@ public final class Protos { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_wallet_Wallet_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -8561,81 +12695,61 @@ public final class Protos { internal_static_wallet_PeerAddress_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_PeerAddress_descriptor, - new java.lang.String[] { "IpAddress", "Port", "Services", }, - org.bitcoinj.wallet.Protos.PeerAddress.class, - org.bitcoinj.wallet.Protos.PeerAddress.Builder.class); + new java.lang.String[] { "IpAddress", "Port", "Services", }); internal_static_wallet_EncryptedPrivateKey_descriptor = getDescriptor().getMessageTypes().get(1); internal_static_wallet_EncryptedPrivateKey_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_EncryptedPrivateKey_descriptor, - new java.lang.String[] { "InitialisationVector", "EncryptedPrivateKey", }, - org.bitcoinj.wallet.Protos.EncryptedPrivateKey.class, - org.bitcoinj.wallet.Protos.EncryptedPrivateKey.Builder.class); + new java.lang.String[] { "InitialisationVector", "EncryptedPrivateKey", }); internal_static_wallet_Key_descriptor = getDescriptor().getMessageTypes().get(2); internal_static_wallet_Key_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_Key_descriptor, - new java.lang.String[] { "Type", "PrivateKey", "EncryptedPrivateKey", "PublicKey", "Label", "CreationTimestamp", }, - org.bitcoinj.wallet.Protos.Key.class, - org.bitcoinj.wallet.Protos.Key.Builder.class); + new java.lang.String[] { "Type", "PrivateKey", "EncryptedPrivateKey", "PublicKey", "Label", "CreationTimestamp", }); internal_static_wallet_TransactionInput_descriptor = getDescriptor().getMessageTypes().get(3); internal_static_wallet_TransactionInput_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_TransactionInput_descriptor, - new java.lang.String[] { "TransactionOutPointHash", "TransactionOutPointIndex", "ScriptBytes", "Sequence", }, - org.bitcoinj.wallet.Protos.TransactionInput.class, - org.bitcoinj.wallet.Protos.TransactionInput.Builder.class); + new java.lang.String[] { "TransactionOutPointHash", "TransactionOutPointIndex", "ScriptBytes", "Sequence", }); internal_static_wallet_TransactionOutput_descriptor = getDescriptor().getMessageTypes().get(4); internal_static_wallet_TransactionOutput_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_TransactionOutput_descriptor, - new java.lang.String[] { "Value", "ScriptBytes", "SpentByTransactionHash", "SpentByTransactionIndex", }, - org.bitcoinj.wallet.Protos.TransactionOutput.class, - org.bitcoinj.wallet.Protos.TransactionOutput.Builder.class); + new java.lang.String[] { "Value", "ScriptBytes", "SpentByTransactionHash", "SpentByTransactionIndex", }); internal_static_wallet_TransactionConfidence_descriptor = getDescriptor().getMessageTypes().get(5); internal_static_wallet_TransactionConfidence_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_TransactionConfidence_descriptor, - new java.lang.String[] { "Type", "AppearedAtHeight", "OverridingTransaction", "Depth", "WorkDone", "BroadcastBy", "Source", }, - org.bitcoinj.wallet.Protos.TransactionConfidence.class, - org.bitcoinj.wallet.Protos.TransactionConfidence.Builder.class); + new java.lang.String[] { "Type", "AppearedAtHeight", "OverridingTransaction", "Depth", "WorkDone", "BroadcastBy", "Source", }); internal_static_wallet_Transaction_descriptor = getDescriptor().getMessageTypes().get(6); internal_static_wallet_Transaction_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_Transaction_descriptor, - new java.lang.String[] { "Version", "Hash", "Pool", "LockTime", "UpdatedAt", "TransactionInput", "TransactionOutput", "BlockHash", "Confidence", "Purpose", }, - org.bitcoinj.wallet.Protos.Transaction.class, - org.bitcoinj.wallet.Protos.Transaction.Builder.class); + new java.lang.String[] { "Version", "Hash", "Pool", "LockTime", "UpdatedAt", "TransactionInput", "TransactionOutput", "BlockHash", "Confidence", "Purpose", }); internal_static_wallet_ScryptParameters_descriptor = getDescriptor().getMessageTypes().get(7); internal_static_wallet_ScryptParameters_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_ScryptParameters_descriptor, - new java.lang.String[] { "Salt", "N", "R", "P", }, - org.bitcoinj.wallet.Protos.ScryptParameters.class, - org.bitcoinj.wallet.Protos.ScryptParameters.Builder.class); + new java.lang.String[] { "Salt", "N", "R", "P", }); internal_static_wallet_Extension_descriptor = getDescriptor().getMessageTypes().get(8); internal_static_wallet_Extension_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_Extension_descriptor, - new java.lang.String[] { "Id", "Data", "Mandatory", }, - org.bitcoinj.wallet.Protos.Extension.class, - org.bitcoinj.wallet.Protos.Extension.Builder.class); + new java.lang.String[] { "Id", "Data", "Mandatory", }); internal_static_wallet_Wallet_descriptor = getDescriptor().getMessageTypes().get(9); internal_static_wallet_Wallet_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_wallet_Wallet_descriptor, - new java.lang.String[] { "NetworkIdentifier", "LastSeenBlockHash", "LastSeenBlockHeight", "Key", "Transaction", "EncryptionType", "EncryptionParameters", "Version", "Extension", "Description", "KeyRotationTime", }, - org.bitcoinj.wallet.Protos.Wallet.class, - org.bitcoinj.wallet.Protos.Wallet.Builder.class); + new java.lang.String[] { "NetworkIdentifier", "LastSeenBlockHash", "LastSeenBlockHeight", "Key", "Transaction", "EncryptionType", "EncryptionParameters", "Version", "Extension", "Description", "KeyRotationTime", }); return null; } }; @@ -8644,6 +12758,6 @@ public final class Protos { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/pom.xml b/pom.xml index b99705c43..7c95f02f9 100644 --- a/pom.xml +++ b/pom.xml @@ -148,7 +148,7 @@ 4.8.2 1.6.4 10.8.2.2 - 2.4.1 + 2.5.0 3.6.3.Final gen