PageRenderTime 93ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 1ms

/core/src/main/java/org/bitcoin/paymentchannel/Protos.java

https://code.google.com/
Java | 8084 lines | 5525 code | 450 blank | 2109 comment | 830 complexity | 90fedbd2bcfe7f60ebb0059125ba9f1c MD5 | raw file
Possible License(s): Apache-2.0
  1. // Generated by the protocol buffer compiler. DO NOT EDIT!
  2. // source: paymentchannel.proto
  3. package org.bitcoin.paymentchannel;
  4. public final class Protos {
  5. private Protos() {}
  6. public static void registerAllExtensions(
  7. com.google.protobuf.ExtensionRegistry registry) {
  8. }
  9. public interface TwoWayChannelMessageOrBuilder
  10. extends com.google.protobuf.MessageOrBuilder {
  11. // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;
  12. /**
  13. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  14. *
  15. * <pre>
  16. * This is required so if a new message type is added in future, old software aborts trying
  17. * to read the message as early as possible. If the message doesn't parse, the socket should
  18. * be closed.
  19. * </pre>
  20. */
  21. boolean hasType();
  22. /**
  23. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  24. *
  25. * <pre>
  26. * This is required so if a new message type is added in future, old software aborts trying
  27. * to read the message as early as possible. If the message doesn't parse, the socket should
  28. * be closed.
  29. * </pre>
  30. */
  31. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType();
  32. // optional .paymentchannels.ClientVersion client_version = 2;
  33. /**
  34. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  35. *
  36. * <pre>
  37. * Now one optional field for each message. Only the field specified by type should be read.
  38. * </pre>
  39. */
  40. boolean hasClientVersion();
  41. /**
  42. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  43. *
  44. * <pre>
  45. * Now one optional field for each message. Only the field specified by type should be read.
  46. * </pre>
  47. */
  48. org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion();
  49. /**
  50. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  51. *
  52. * <pre>
  53. * Now one optional field for each message. Only the field specified by type should be read.
  54. * </pre>
  55. */
  56. org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder();
  57. // optional .paymentchannels.ServerVersion server_version = 3;
  58. /**
  59. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  60. */
  61. boolean hasServerVersion();
  62. /**
  63. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  64. */
  65. org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion();
  66. /**
  67. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  68. */
  69. org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder();
  70. // optional .paymentchannels.Initiate initiate = 4;
  71. /**
  72. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  73. */
  74. boolean hasInitiate();
  75. /**
  76. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  77. */
  78. org.bitcoin.paymentchannel.Protos.Initiate getInitiate();
  79. /**
  80. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  81. */
  82. org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder();
  83. // optional .paymentchannels.ProvideRefund provide_refund = 5;
  84. /**
  85. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  86. */
  87. boolean hasProvideRefund();
  88. /**
  89. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  90. */
  91. org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund();
  92. /**
  93. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  94. */
  95. org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder();
  96. // optional .paymentchannels.ReturnRefund return_refund = 6;
  97. /**
  98. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  99. */
  100. boolean hasReturnRefund();
  101. /**
  102. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  103. */
  104. org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund();
  105. /**
  106. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  107. */
  108. org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder();
  109. // optional .paymentchannels.ProvideContract provide_contract = 7;
  110. /**
  111. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  112. */
  113. boolean hasProvideContract();
  114. /**
  115. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  116. */
  117. org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract();
  118. /**
  119. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  120. */
  121. org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder();
  122. // optional .paymentchannels.UpdatePayment update_payment = 8;
  123. /**
  124. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  125. */
  126. boolean hasUpdatePayment();
  127. /**
  128. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  129. */
  130. org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment();
  131. /**
  132. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  133. */
  134. org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder();
  135. // optional .paymentchannels.Close close = 9;
  136. /**
  137. * <code>optional .paymentchannels.Close close = 9;</code>
  138. */
  139. boolean hasClose();
  140. /**
  141. * <code>optional .paymentchannels.Close close = 9;</code>
  142. */
  143. org.bitcoin.paymentchannel.Protos.Close getClose();
  144. /**
  145. * <code>optional .paymentchannels.Close close = 9;</code>
  146. */
  147. org.bitcoin.paymentchannel.Protos.CloseOrBuilder getCloseOrBuilder();
  148. // optional .paymentchannels.Error error = 10;
  149. /**
  150. * <code>optional .paymentchannels.Error error = 10;</code>
  151. */
  152. boolean hasError();
  153. /**
  154. * <code>optional .paymentchannels.Error error = 10;</code>
  155. */
  156. org.bitcoin.paymentchannel.Protos.Error getError();
  157. /**
  158. * <code>optional .paymentchannels.Error error = 10;</code>
  159. */
  160. org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder();
  161. }
  162. /**
  163. * Protobuf type {@code paymentchannels.TwoWayChannelMessage}
  164. *
  165. * <pre>
  166. * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
  167. * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
  168. * and "secondary" as "server".
  169. * </pre>
  170. */
  171. public static final class TwoWayChannelMessage extends
  172. com.google.protobuf.GeneratedMessage
  173. implements TwoWayChannelMessageOrBuilder {
  174. // Use TwoWayChannelMessage.newBuilder() to construct.
  175. private TwoWayChannelMessage(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  176. super(builder);
  177. this.unknownFields = builder.getUnknownFields();
  178. }
  179. private TwoWayChannelMessage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  180. private static final TwoWayChannelMessage defaultInstance;
  181. public static TwoWayChannelMessage getDefaultInstance() {
  182. return defaultInstance;
  183. }
  184. public TwoWayChannelMessage getDefaultInstanceForType() {
  185. return defaultInstance;
  186. }
  187. private final com.google.protobuf.UnknownFieldSet unknownFields;
  188. @java.lang.Override
  189. public final com.google.protobuf.UnknownFieldSet
  190. getUnknownFields() {
  191. return this.unknownFields;
  192. }
  193. private TwoWayChannelMessage(
  194. com.google.protobuf.CodedInputStream input,
  195. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  196. throws com.google.protobuf.InvalidProtocolBufferException {
  197. initFields();
  198. int mutable_bitField0_ = 0;
  199. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  200. com.google.protobuf.UnknownFieldSet.newBuilder();
  201. try {
  202. boolean done = false;
  203. while (!done) {
  204. int tag = input.readTag();
  205. switch (tag) {
  206. case 0:
  207. done = true;
  208. break;
  209. default: {
  210. if (!parseUnknownField(input, unknownFields,
  211. extensionRegistry, tag)) {
  212. done = true;
  213. }
  214. break;
  215. }
  216. case 8: {
  217. int rawValue = input.readEnum();
  218. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.valueOf(rawValue);
  219. if (value == null) {
  220. unknownFields.mergeVarintField(1, rawValue);
  221. } else {
  222. bitField0_ |= 0x00000001;
  223. type_ = value;
  224. }
  225. break;
  226. }
  227. case 18: {
  228. org.bitcoin.paymentchannel.Protos.ClientVersion.Builder subBuilder = null;
  229. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  230. subBuilder = clientVersion_.toBuilder();
  231. }
  232. clientVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ClientVersion.PARSER, extensionRegistry);
  233. if (subBuilder != null) {
  234. subBuilder.mergeFrom(clientVersion_);
  235. clientVersion_ = subBuilder.buildPartial();
  236. }
  237. bitField0_ |= 0x00000002;
  238. break;
  239. }
  240. case 26: {
  241. org.bitcoin.paymentchannel.Protos.ServerVersion.Builder subBuilder = null;
  242. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  243. subBuilder = serverVersion_.toBuilder();
  244. }
  245. serverVersion_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ServerVersion.PARSER, extensionRegistry);
  246. if (subBuilder != null) {
  247. subBuilder.mergeFrom(serverVersion_);
  248. serverVersion_ = subBuilder.buildPartial();
  249. }
  250. bitField0_ |= 0x00000004;
  251. break;
  252. }
  253. case 34: {
  254. org.bitcoin.paymentchannel.Protos.Initiate.Builder subBuilder = null;
  255. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  256. subBuilder = initiate_.toBuilder();
  257. }
  258. initiate_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Initiate.PARSER, extensionRegistry);
  259. if (subBuilder != null) {
  260. subBuilder.mergeFrom(initiate_);
  261. initiate_ = subBuilder.buildPartial();
  262. }
  263. bitField0_ |= 0x00000008;
  264. break;
  265. }
  266. case 42: {
  267. org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder subBuilder = null;
  268. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  269. subBuilder = provideRefund_.toBuilder();
  270. }
  271. provideRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideRefund.PARSER, extensionRegistry);
  272. if (subBuilder != null) {
  273. subBuilder.mergeFrom(provideRefund_);
  274. provideRefund_ = subBuilder.buildPartial();
  275. }
  276. bitField0_ |= 0x00000010;
  277. break;
  278. }
  279. case 50: {
  280. org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder subBuilder = null;
  281. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  282. subBuilder = returnRefund_.toBuilder();
  283. }
  284. returnRefund_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ReturnRefund.PARSER, extensionRegistry);
  285. if (subBuilder != null) {
  286. subBuilder.mergeFrom(returnRefund_);
  287. returnRefund_ = subBuilder.buildPartial();
  288. }
  289. bitField0_ |= 0x00000020;
  290. break;
  291. }
  292. case 58: {
  293. org.bitcoin.paymentchannel.Protos.ProvideContract.Builder subBuilder = null;
  294. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  295. subBuilder = provideContract_.toBuilder();
  296. }
  297. provideContract_ = input.readMessage(org.bitcoin.paymentchannel.Protos.ProvideContract.PARSER, extensionRegistry);
  298. if (subBuilder != null) {
  299. subBuilder.mergeFrom(provideContract_);
  300. provideContract_ = subBuilder.buildPartial();
  301. }
  302. bitField0_ |= 0x00000040;
  303. break;
  304. }
  305. case 66: {
  306. org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder subBuilder = null;
  307. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  308. subBuilder = updatePayment_.toBuilder();
  309. }
  310. updatePayment_ = input.readMessage(org.bitcoin.paymentchannel.Protos.UpdatePayment.PARSER, extensionRegistry);
  311. if (subBuilder != null) {
  312. subBuilder.mergeFrom(updatePayment_);
  313. updatePayment_ = subBuilder.buildPartial();
  314. }
  315. bitField0_ |= 0x00000080;
  316. break;
  317. }
  318. case 74: {
  319. org.bitcoin.paymentchannel.Protos.Close.Builder subBuilder = null;
  320. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  321. subBuilder = close_.toBuilder();
  322. }
  323. close_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Close.PARSER, extensionRegistry);
  324. if (subBuilder != null) {
  325. subBuilder.mergeFrom(close_);
  326. close_ = subBuilder.buildPartial();
  327. }
  328. bitField0_ |= 0x00000100;
  329. break;
  330. }
  331. case 82: {
  332. org.bitcoin.paymentchannel.Protos.Error.Builder subBuilder = null;
  333. if (((bitField0_ & 0x00000200) == 0x00000200)) {
  334. subBuilder = error_.toBuilder();
  335. }
  336. error_ = input.readMessage(org.bitcoin.paymentchannel.Protos.Error.PARSER, extensionRegistry);
  337. if (subBuilder != null) {
  338. subBuilder.mergeFrom(error_);
  339. error_ = subBuilder.buildPartial();
  340. }
  341. bitField0_ |= 0x00000200;
  342. break;
  343. }
  344. }
  345. }
  346. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  347. throw e.setUnfinishedMessage(this);
  348. } catch (java.io.IOException e) {
  349. throw new com.google.protobuf.InvalidProtocolBufferException(
  350. e.getMessage()).setUnfinishedMessage(this);
  351. } finally {
  352. this.unknownFields = unknownFields.build();
  353. makeExtensionsImmutable();
  354. }
  355. }
  356. public static final com.google.protobuf.Descriptors.Descriptor
  357. getDescriptor() {
  358. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  359. }
  360. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  361. internalGetFieldAccessorTable() {
  362. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable
  363. .ensureFieldAccessorsInitialized(
  364. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class);
  365. }
  366. public static com.google.protobuf.Parser<TwoWayChannelMessage> PARSER =
  367. new com.google.protobuf.AbstractParser<TwoWayChannelMessage>() {
  368. public TwoWayChannelMessage parsePartialFrom(
  369. com.google.protobuf.CodedInputStream input,
  370. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  371. throws com.google.protobuf.InvalidProtocolBufferException {
  372. return new TwoWayChannelMessage(input, extensionRegistry);
  373. }
  374. };
  375. @java.lang.Override
  376. public com.google.protobuf.Parser<TwoWayChannelMessage> getParserForType() {
  377. return PARSER;
  378. }
  379. /**
  380. * Protobuf enum {@code paymentchannels.TwoWayChannelMessage.MessageType}
  381. */
  382. public enum MessageType
  383. implements com.google.protobuf.ProtocolMessageEnum {
  384. /**
  385. * <code>CLIENT_VERSION = 1;</code>
  386. */
  387. CLIENT_VERSION(0, 1),
  388. /**
  389. * <code>SERVER_VERSION = 2;</code>
  390. */
  391. SERVER_VERSION(1, 2),
  392. /**
  393. * <code>INITIATE = 3;</code>
  394. */
  395. INITIATE(2, 3),
  396. /**
  397. * <code>PROVIDE_REFUND = 4;</code>
  398. */
  399. PROVIDE_REFUND(3, 4),
  400. /**
  401. * <code>RETURN_REFUND = 5;</code>
  402. */
  403. RETURN_REFUND(4, 5),
  404. /**
  405. * <code>PROVIDE_CONTRACT = 6;</code>
  406. */
  407. PROVIDE_CONTRACT(5, 6),
  408. /**
  409. * <code>CHANNEL_OPEN = 7;</code>
  410. *
  411. * <pre>
  412. * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
  413. * secondary to the primary to indicate that the provided contract was received,
  414. * verified, and broadcast successfully and the primary can now provide UPDATE messages
  415. * at will to begin paying secondary. If the channel is interrupted after the
  416. * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
  417. * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
  418. * message.
  419. * </pre>
  420. */
  421. CHANNEL_OPEN(6, 7),
  422. /**
  423. * <code>UPDATE_PAYMENT = 8;</code>
  424. */
  425. UPDATE_PAYMENT(7, 8),
  426. /**
  427. * <code>CLOSE = 9;</code>
  428. *
  429. * <pre>
  430. * Either side can send this message. If the client sends it to the server, then the server
  431. * takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a
  432. * valid transaction, which it then broadcasts on the network.
  433. *
  434. * If the server sends it to the client, then it can either be a simple "good bye" message or
  435. * it can include the fully signed close transaction and give it back so the client can
  436. * eventually broadcast it as well, in case the server fails to do so for some reason (and
  437. * more usefully so the client can build on it). In that case the server replies to a CLOSE
  438. * with another CLOSE and then disconnects.
  439. * </pre>
  440. */
  441. CLOSE(8, 9),
  442. /**
  443. * <code>ERROR = 10;</code>
  444. *
  445. * <pre>
  446. * Used to indicate an error condition.
  447. * Both parties should make an effort to send either an ERROR or a CLOSE immediately
  448. * before closing the socket (unless they just received an ERROR or a CLOSE). This is important
  449. * because the protocol may not run over TCP.
  450. * </pre>
  451. */
  452. ERROR(9, 10),
  453. ;
  454. /**
  455. * <code>CLIENT_VERSION = 1;</code>
  456. */
  457. public static final int CLIENT_VERSION_VALUE = 1;
  458. /**
  459. * <code>SERVER_VERSION = 2;</code>
  460. */
  461. public static final int SERVER_VERSION_VALUE = 2;
  462. /**
  463. * <code>INITIATE = 3;</code>
  464. */
  465. public static final int INITIATE_VALUE = 3;
  466. /**
  467. * <code>PROVIDE_REFUND = 4;</code>
  468. */
  469. public static final int PROVIDE_REFUND_VALUE = 4;
  470. /**
  471. * <code>RETURN_REFUND = 5;</code>
  472. */
  473. public static final int RETURN_REFUND_VALUE = 5;
  474. /**
  475. * <code>PROVIDE_CONTRACT = 6;</code>
  476. */
  477. public static final int PROVIDE_CONTRACT_VALUE = 6;
  478. /**
  479. * <code>CHANNEL_OPEN = 7;</code>
  480. *
  481. * <pre>
  482. * Note that there are no optional fields set for CHANNEL_OPEN, it is sent from the
  483. * secondary to the primary to indicate that the provided contract was received,
  484. * verified, and broadcast successfully and the primary can now provide UPDATE messages
  485. * at will to begin paying secondary. If the channel is interrupted after the
  486. * CHANNEL_OPEN message (ie closed without an explicit CLOSE or ERROR) the primary may
  487. * reopen the channel by setting the contract transaction hash in its CLIENT_VERSION
  488. * message.
  489. * </pre>
  490. */
  491. public static final int CHANNEL_OPEN_VALUE = 7;
  492. /**
  493. * <code>UPDATE_PAYMENT = 8;</code>
  494. */
  495. public static final int UPDATE_PAYMENT_VALUE = 8;
  496. /**
  497. * <code>CLOSE = 9;</code>
  498. *
  499. * <pre>
  500. * Either side can send this message. If the client sends it to the server, then the server
  501. * takes the most recent signature it received in an UPDATE_PAYMENT and uses it to create a
  502. * valid transaction, which it then broadcasts on the network.
  503. *
  504. * If the server sends it to the client, then it can either be a simple "good bye" message or
  505. * it can include the fully signed close transaction and give it back so the client can
  506. * eventually broadcast it as well, in case the server fails to do so for some reason (and
  507. * more usefully so the client can build on it). In that case the server replies to a CLOSE
  508. * with another CLOSE and then disconnects.
  509. * </pre>
  510. */
  511. public static final int CLOSE_VALUE = 9;
  512. /**
  513. * <code>ERROR = 10;</code>
  514. *
  515. * <pre>
  516. * Used to indicate an error condition.
  517. * Both parties should make an effort to send either an ERROR or a CLOSE immediately
  518. * before closing the socket (unless they just received an ERROR or a CLOSE). This is important
  519. * because the protocol may not run over TCP.
  520. * </pre>
  521. */
  522. public static final int ERROR_VALUE = 10;
  523. public final int getNumber() { return value; }
  524. public static MessageType valueOf(int value) {
  525. switch (value) {
  526. case 1: return CLIENT_VERSION;
  527. case 2: return SERVER_VERSION;
  528. case 3: return INITIATE;
  529. case 4: return PROVIDE_REFUND;
  530. case 5: return RETURN_REFUND;
  531. case 6: return PROVIDE_CONTRACT;
  532. case 7: return CHANNEL_OPEN;
  533. case 8: return UPDATE_PAYMENT;
  534. case 9: return CLOSE;
  535. case 10: return ERROR;
  536. default: return null;
  537. }
  538. }
  539. public static com.google.protobuf.Internal.EnumLiteMap<MessageType>
  540. internalGetValueMap() {
  541. return internalValueMap;
  542. }
  543. private static com.google.protobuf.Internal.EnumLiteMap<MessageType>
  544. internalValueMap =
  545. new com.google.protobuf.Internal.EnumLiteMap<MessageType>() {
  546. public MessageType findValueByNumber(int number) {
  547. return MessageType.valueOf(number);
  548. }
  549. };
  550. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  551. getValueDescriptor() {
  552. return getDescriptor().getValues().get(index);
  553. }
  554. public final com.google.protobuf.Descriptors.EnumDescriptor
  555. getDescriptorForType() {
  556. return getDescriptor();
  557. }
  558. public static final com.google.protobuf.Descriptors.EnumDescriptor
  559. getDescriptor() {
  560. return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDescriptor().getEnumTypes().get(0);
  561. }
  562. private static final MessageType[] VALUES = values();
  563. public static MessageType valueOf(
  564. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  565. if (desc.getType() != getDescriptor()) {
  566. throw new java.lang.IllegalArgumentException(
  567. "EnumValueDescriptor is not for this type.");
  568. }
  569. return VALUES[desc.getIndex()];
  570. }
  571. private final int index;
  572. private final int value;
  573. private MessageType(int index, int value) {
  574. this.index = index;
  575. this.value = value;
  576. }
  577. // @@protoc_insertion_point(enum_scope:paymentchannels.TwoWayChannelMessage.MessageType)
  578. }
  579. private int bitField0_;
  580. // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;
  581. public static final int TYPE_FIELD_NUMBER = 1;
  582. private org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType type_;
  583. /**
  584. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  585. *
  586. * <pre>
  587. * This is required so if a new message type is added in future, old software aborts trying
  588. * to read the message as early as possible. If the message doesn't parse, the socket should
  589. * be closed.
  590. * </pre>
  591. */
  592. public boolean hasType() {
  593. return ((bitField0_ & 0x00000001) == 0x00000001);
  594. }
  595. /**
  596. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  597. *
  598. * <pre>
  599. * This is required so if a new message type is added in future, old software aborts trying
  600. * to read the message as early as possible. If the message doesn't parse, the socket should
  601. * be closed.
  602. * </pre>
  603. */
  604. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() {
  605. return type_;
  606. }
  607. // optional .paymentchannels.ClientVersion client_version = 2;
  608. public static final int CLIENT_VERSION_FIELD_NUMBER = 2;
  609. private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_;
  610. /**
  611. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  612. *
  613. * <pre>
  614. * Now one optional field for each message. Only the field specified by type should be read.
  615. * </pre>
  616. */
  617. public boolean hasClientVersion() {
  618. return ((bitField0_ & 0x00000002) == 0x00000002);
  619. }
  620. /**
  621. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  622. *
  623. * <pre>
  624. * Now one optional field for each message. Only the field specified by type should be read.
  625. * </pre>
  626. */
  627. public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() {
  628. return clientVersion_;
  629. }
  630. /**
  631. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  632. *
  633. * <pre>
  634. * Now one optional field for each message. Only the field specified by type should be read.
  635. * </pre>
  636. */
  637. public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() {
  638. return clientVersion_;
  639. }
  640. // optional .paymentchannels.ServerVersion server_version = 3;
  641. public static final int SERVER_VERSION_FIELD_NUMBER = 3;
  642. private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_;
  643. /**
  644. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  645. */
  646. public boolean hasServerVersion() {
  647. return ((bitField0_ & 0x00000004) == 0x00000004);
  648. }
  649. /**
  650. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  651. */
  652. public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() {
  653. return serverVersion_;
  654. }
  655. /**
  656. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  657. */
  658. public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() {
  659. return serverVersion_;
  660. }
  661. // optional .paymentchannels.Initiate initiate = 4;
  662. public static final int INITIATE_FIELD_NUMBER = 4;
  663. private org.bitcoin.paymentchannel.Protos.Initiate initiate_;
  664. /**
  665. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  666. */
  667. public boolean hasInitiate() {
  668. return ((bitField0_ & 0x00000008) == 0x00000008);
  669. }
  670. /**
  671. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  672. */
  673. public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() {
  674. return initiate_;
  675. }
  676. /**
  677. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  678. */
  679. public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() {
  680. return initiate_;
  681. }
  682. // optional .paymentchannels.ProvideRefund provide_refund = 5;
  683. public static final int PROVIDE_REFUND_FIELD_NUMBER = 5;
  684. private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_;
  685. /**
  686. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  687. */
  688. public boolean hasProvideRefund() {
  689. return ((bitField0_ & 0x00000010) == 0x00000010);
  690. }
  691. /**
  692. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  693. */
  694. public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() {
  695. return provideRefund_;
  696. }
  697. /**
  698. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  699. */
  700. public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() {
  701. return provideRefund_;
  702. }
  703. // optional .paymentchannels.ReturnRefund return_refund = 6;
  704. public static final int RETURN_REFUND_FIELD_NUMBER = 6;
  705. private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_;
  706. /**
  707. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  708. */
  709. public boolean hasReturnRefund() {
  710. return ((bitField0_ & 0x00000020) == 0x00000020);
  711. }
  712. /**
  713. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  714. */
  715. public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() {
  716. return returnRefund_;
  717. }
  718. /**
  719. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  720. */
  721. public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() {
  722. return returnRefund_;
  723. }
  724. // optional .paymentchannels.ProvideContract provide_contract = 7;
  725. public static final int PROVIDE_CONTRACT_FIELD_NUMBER = 7;
  726. private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_;
  727. /**
  728. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  729. */
  730. public boolean hasProvideContract() {
  731. return ((bitField0_ & 0x00000040) == 0x00000040);
  732. }
  733. /**
  734. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  735. */
  736. public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() {
  737. return provideContract_;
  738. }
  739. /**
  740. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  741. */
  742. public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() {
  743. return provideContract_;
  744. }
  745. // optional .paymentchannels.UpdatePayment update_payment = 8;
  746. public static final int UPDATE_PAYMENT_FIELD_NUMBER = 8;
  747. private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_;
  748. /**
  749. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  750. */
  751. public boolean hasUpdatePayment() {
  752. return ((bitField0_ & 0x00000080) == 0x00000080);
  753. }
  754. /**
  755. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  756. */
  757. public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() {
  758. return updatePayment_;
  759. }
  760. /**
  761. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  762. */
  763. public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() {
  764. return updatePayment_;
  765. }
  766. // optional .paymentchannels.Close close = 9;
  767. public static final int CLOSE_FIELD_NUMBER = 9;
  768. private org.bitcoin.paymentchannel.Protos.Close close_;
  769. /**
  770. * <code>optional .paymentchannels.Close close = 9;</code>
  771. */
  772. public boolean hasClose() {
  773. return ((bitField0_ & 0x00000100) == 0x00000100);
  774. }
  775. /**
  776. * <code>optional .paymentchannels.Close close = 9;</code>
  777. */
  778. public org.bitcoin.paymentchannel.Protos.Close getClose() {
  779. return close_;
  780. }
  781. /**
  782. * <code>optional .paymentchannels.Close close = 9;</code>
  783. */
  784. public org.bitcoin.paymentchannel.Protos.CloseOrBuilder getCloseOrBuilder() {
  785. return close_;
  786. }
  787. // optional .paymentchannels.Error error = 10;
  788. public static final int ERROR_FIELD_NUMBER = 10;
  789. private org.bitcoin.paymentchannel.Protos.Error error_;
  790. /**
  791. * <code>optional .paymentchannels.Error error = 10;</code>
  792. */
  793. public boolean hasError() {
  794. return ((bitField0_ & 0x00000200) == 0x00000200);
  795. }
  796. /**
  797. * <code>optional .paymentchannels.Error error = 10;</code>
  798. */
  799. public org.bitcoin.paymentchannel.Protos.Error getError() {
  800. return error_;
  801. }
  802. /**
  803. * <code>optional .paymentchannels.Error error = 10;</code>
  804. */
  805. public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() {
  806. return error_;
  807. }
  808. private void initFields() {
  809. type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION;
  810. clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  811. serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  812. initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  813. provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  814. returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  815. provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  816. updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  817. close_ = org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  818. error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  819. }
  820. private byte memoizedIsInitialized = -1;
  821. public final boolean isInitialized() {
  822. byte isInitialized = memoizedIsInitialized;
  823. if (isInitialized != -1) return isInitialized == 1;
  824. if (!hasType()) {
  825. memoizedIsInitialized = 0;
  826. return false;
  827. }
  828. if (hasClientVersion()) {
  829. if (!getClientVersion().isInitialized()) {
  830. memoizedIsInitialized = 0;
  831. return false;
  832. }
  833. }
  834. if (hasServerVersion()) {
  835. if (!getServerVersion().isInitialized()) {
  836. memoizedIsInitialized = 0;
  837. return false;
  838. }
  839. }
  840. if (hasInitiate()) {
  841. if (!getInitiate().isInitialized()) {
  842. memoizedIsInitialized = 0;
  843. return false;
  844. }
  845. }
  846. if (hasProvideRefund()) {
  847. if (!getProvideRefund().isInitialized()) {
  848. memoizedIsInitialized = 0;
  849. return false;
  850. }
  851. }
  852. if (hasReturnRefund()) {
  853. if (!getReturnRefund().isInitialized()) {
  854. memoizedIsInitialized = 0;
  855. return false;
  856. }
  857. }
  858. if (hasProvideContract()) {
  859. if (!getProvideContract().isInitialized()) {
  860. memoizedIsInitialized = 0;
  861. return false;
  862. }
  863. }
  864. if (hasUpdatePayment()) {
  865. if (!getUpdatePayment().isInitialized()) {
  866. memoizedIsInitialized = 0;
  867. return false;
  868. }
  869. }
  870. if (hasClose()) {
  871. if (!getClose().isInitialized()) {
  872. memoizedIsInitialized = 0;
  873. return false;
  874. }
  875. }
  876. memoizedIsInitialized = 1;
  877. return true;
  878. }
  879. public void writeTo(com.google.protobuf.CodedOutputStream output)
  880. throws java.io.IOException {
  881. getSerializedSize();
  882. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  883. output.writeEnum(1, type_.getNumber());
  884. }
  885. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  886. output.writeMessage(2, clientVersion_);
  887. }
  888. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  889. output.writeMessage(3, serverVersion_);
  890. }
  891. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  892. output.writeMessage(4, initiate_);
  893. }
  894. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  895. output.writeMessage(5, provideRefund_);
  896. }
  897. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  898. output.writeMessage(6, returnRefund_);
  899. }
  900. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  901. output.writeMessage(7, provideContract_);
  902. }
  903. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  904. output.writeMessage(8, updatePayment_);
  905. }
  906. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  907. output.writeMessage(9, close_);
  908. }
  909. if (((bitField0_ & 0x00000200) == 0x00000200)) {
  910. output.writeMessage(10, error_);
  911. }
  912. getUnknownFields().writeTo(output);
  913. }
  914. private int memoizedSerializedSize = -1;
  915. public int getSerializedSize() {
  916. int size = memoizedSerializedSize;
  917. if (size != -1) return size;
  918. size = 0;
  919. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  920. size += com.google.protobuf.CodedOutputStream
  921. .computeEnumSize(1, type_.getNumber());
  922. }
  923. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  924. size += com.google.protobuf.CodedOutputStream
  925. .computeMessageSize(2, clientVersion_);
  926. }
  927. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  928. size += com.google.protobuf.CodedOutputStream
  929. .computeMessageSize(3, serverVersion_);
  930. }
  931. if (((bitField0_ & 0x00000008) == 0x00000008)) {
  932. size += com.google.protobuf.CodedOutputStream
  933. .computeMessageSize(4, initiate_);
  934. }
  935. if (((bitField0_ & 0x00000010) == 0x00000010)) {
  936. size += com.google.protobuf.CodedOutputStream
  937. .computeMessageSize(5, provideRefund_);
  938. }
  939. if (((bitField0_ & 0x00000020) == 0x00000020)) {
  940. size += com.google.protobuf.CodedOutputStream
  941. .computeMessageSize(6, returnRefund_);
  942. }
  943. if (((bitField0_ & 0x00000040) == 0x00000040)) {
  944. size += com.google.protobuf.CodedOutputStream
  945. .computeMessageSize(7, provideContract_);
  946. }
  947. if (((bitField0_ & 0x00000080) == 0x00000080)) {
  948. size += com.google.protobuf.CodedOutputStream
  949. .computeMessageSize(8, updatePayment_);
  950. }
  951. if (((bitField0_ & 0x00000100) == 0x00000100)) {
  952. size += com.google.protobuf.CodedOutputStream
  953. .computeMessageSize(9, close_);
  954. }
  955. if (((bitField0_ & 0x00000200) == 0x00000200)) {
  956. size += com.google.protobuf.CodedOutputStream
  957. .computeMessageSize(10, error_);
  958. }
  959. size += getUnknownFields().getSerializedSize();
  960. memoizedSerializedSize = size;
  961. return size;
  962. }
  963. private static final long serialVersionUID = 0L;
  964. @java.lang.Override
  965. protected java.lang.Object writeReplace()
  966. throws java.io.ObjectStreamException {
  967. return super.writeReplace();
  968. }
  969. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  970. com.google.protobuf.ByteString data)
  971. throws com.google.protobuf.InvalidProtocolBufferException {
  972. return PARSER.parseFrom(data);
  973. }
  974. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  975. com.google.protobuf.ByteString data,
  976. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  977. throws com.google.protobuf.InvalidProtocolBufferException {
  978. return PARSER.parseFrom(data, extensionRegistry);
  979. }
  980. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(byte[] data)
  981. throws com.google.protobuf.InvalidProtocolBufferException {
  982. return PARSER.parseFrom(data);
  983. }
  984. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  985. byte[] data,
  986. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  987. throws com.google.protobuf.InvalidProtocolBufferException {
  988. return PARSER.parseFrom(data, extensionRegistry);
  989. }
  990. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(java.io.InputStream input)
  991. throws java.io.IOException {
  992. return PARSER.parseFrom(input);
  993. }
  994. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  995. java.io.InputStream input,
  996. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  997. throws java.io.IOException {
  998. return PARSER.parseFrom(input, extensionRegistry);
  999. }
  1000. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom(java.io.InputStream input)
  1001. throws java.io.IOException {
  1002. return PARSER.parseDelimitedFrom(input);
  1003. }
  1004. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseDelimitedFrom(
  1005. java.io.InputStream input,
  1006. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1007. throws java.io.IOException {
  1008. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  1009. }
  1010. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  1011. com.google.protobuf.CodedInputStream input)
  1012. throws java.io.IOException {
  1013. return PARSER.parseFrom(input);
  1014. }
  1015. public static org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parseFrom(
  1016. com.google.protobuf.CodedInputStream input,
  1017. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1018. throws java.io.IOException {
  1019. return PARSER.parseFrom(input, extensionRegistry);
  1020. }
  1021. public static Builder newBuilder() { return Builder.create(); }
  1022. public Builder newBuilderForType() { return newBuilder(); }
  1023. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage prototype) {
  1024. return newBuilder().mergeFrom(prototype);
  1025. }
  1026. public Builder toBuilder() { return newBuilder(this); }
  1027. @java.lang.Override
  1028. protected Builder newBuilderForType(
  1029. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1030. Builder builder = new Builder(parent);
  1031. return builder;
  1032. }
  1033. /**
  1034. * Protobuf type {@code paymentchannels.TwoWayChannelMessage}
  1035. *
  1036. * <pre>
  1037. * This message is designed to be either sent raw over the network (e.g. length prefixed) or embedded inside another
  1038. * protocol that is being extended to support micropayments. In this file "primary" typically can be read as "client"
  1039. * and "secondary" as "server".
  1040. * </pre>
  1041. */
  1042. public static final class Builder extends
  1043. com.google.protobuf.GeneratedMessage.Builder<Builder>
  1044. implements org.bitcoin.paymentchannel.Protos.TwoWayChannelMessageOrBuilder {
  1045. public static final com.google.protobuf.Descriptors.Descriptor
  1046. getDescriptor() {
  1047. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  1048. }
  1049. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  1050. internalGetFieldAccessorTable() {
  1051. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable
  1052. .ensureFieldAccessorsInitialized(
  1053. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.class, org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.Builder.class);
  1054. }
  1055. // Construct using org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.newBuilder()
  1056. private Builder() {
  1057. maybeForceBuilderInitialization();
  1058. }
  1059. private Builder(
  1060. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  1061. super(parent);
  1062. maybeForceBuilderInitialization();
  1063. }
  1064. private void maybeForceBuilderInitialization() {
  1065. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  1066. getClientVersionFieldBuilder();
  1067. getServerVersionFieldBuilder();
  1068. getInitiateFieldBuilder();
  1069. getProvideRefundFieldBuilder();
  1070. getReturnRefundFieldBuilder();
  1071. getProvideContractFieldBuilder();
  1072. getUpdatePaymentFieldBuilder();
  1073. getCloseFieldBuilder();
  1074. getErrorFieldBuilder();
  1075. }
  1076. }
  1077. private static Builder create() {
  1078. return new Builder();
  1079. }
  1080. public Builder clear() {
  1081. super.clear();
  1082. type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION;
  1083. bitField0_ = (bitField0_ & ~0x00000001);
  1084. if (clientVersionBuilder_ == null) {
  1085. clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  1086. } else {
  1087. clientVersionBuilder_.clear();
  1088. }
  1089. bitField0_ = (bitField0_ & ~0x00000002);
  1090. if (serverVersionBuilder_ == null) {
  1091. serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  1092. } else {
  1093. serverVersionBuilder_.clear();
  1094. }
  1095. bitField0_ = (bitField0_ & ~0x00000004);
  1096. if (initiateBuilder_ == null) {
  1097. initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  1098. } else {
  1099. initiateBuilder_.clear();
  1100. }
  1101. bitField0_ = (bitField0_ & ~0x00000008);
  1102. if (provideRefundBuilder_ == null) {
  1103. provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  1104. } else {
  1105. provideRefundBuilder_.clear();
  1106. }
  1107. bitField0_ = (bitField0_ & ~0x00000010);
  1108. if (returnRefundBuilder_ == null) {
  1109. returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  1110. } else {
  1111. returnRefundBuilder_.clear();
  1112. }
  1113. bitField0_ = (bitField0_ & ~0x00000020);
  1114. if (provideContractBuilder_ == null) {
  1115. provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  1116. } else {
  1117. provideContractBuilder_.clear();
  1118. }
  1119. bitField0_ = (bitField0_ & ~0x00000040);
  1120. if (updatePaymentBuilder_ == null) {
  1121. updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  1122. } else {
  1123. updatePaymentBuilder_.clear();
  1124. }
  1125. bitField0_ = (bitField0_ & ~0x00000080);
  1126. if (closeBuilder_ == null) {
  1127. close_ = org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  1128. } else {
  1129. closeBuilder_.clear();
  1130. }
  1131. bitField0_ = (bitField0_ & ~0x00000100);
  1132. if (errorBuilder_ == null) {
  1133. error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  1134. } else {
  1135. errorBuilder_.clear();
  1136. }
  1137. bitField0_ = (bitField0_ & ~0x00000200);
  1138. return this;
  1139. }
  1140. public Builder clone() {
  1141. return create().mergeFrom(buildPartial());
  1142. }
  1143. public com.google.protobuf.Descriptors.Descriptor
  1144. getDescriptorForType() {
  1145. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  1146. }
  1147. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage getDefaultInstanceForType() {
  1148. return org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance();
  1149. }
  1150. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage build() {
  1151. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = buildPartial();
  1152. if (!result.isInitialized()) {
  1153. throw newUninitializedMessageException(result);
  1154. }
  1155. return result;
  1156. }
  1157. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage buildPartial() {
  1158. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage result = new org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage(this);
  1159. int from_bitField0_ = bitField0_;
  1160. int to_bitField0_ = 0;
  1161. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  1162. to_bitField0_ |= 0x00000001;
  1163. }
  1164. result.type_ = type_;
  1165. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  1166. to_bitField0_ |= 0x00000002;
  1167. }
  1168. if (clientVersionBuilder_ == null) {
  1169. result.clientVersion_ = clientVersion_;
  1170. } else {
  1171. result.clientVersion_ = clientVersionBuilder_.build();
  1172. }
  1173. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  1174. to_bitField0_ |= 0x00000004;
  1175. }
  1176. if (serverVersionBuilder_ == null) {
  1177. result.serverVersion_ = serverVersion_;
  1178. } else {
  1179. result.serverVersion_ = serverVersionBuilder_.build();
  1180. }
  1181. if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
  1182. to_bitField0_ |= 0x00000008;
  1183. }
  1184. if (initiateBuilder_ == null) {
  1185. result.initiate_ = initiate_;
  1186. } else {
  1187. result.initiate_ = initiateBuilder_.build();
  1188. }
  1189. if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
  1190. to_bitField0_ |= 0x00000010;
  1191. }
  1192. if (provideRefundBuilder_ == null) {
  1193. result.provideRefund_ = provideRefund_;
  1194. } else {
  1195. result.provideRefund_ = provideRefundBuilder_.build();
  1196. }
  1197. if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
  1198. to_bitField0_ |= 0x00000020;
  1199. }
  1200. if (returnRefundBuilder_ == null) {
  1201. result.returnRefund_ = returnRefund_;
  1202. } else {
  1203. result.returnRefund_ = returnRefundBuilder_.build();
  1204. }
  1205. if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
  1206. to_bitField0_ |= 0x00000040;
  1207. }
  1208. if (provideContractBuilder_ == null) {
  1209. result.provideContract_ = provideContract_;
  1210. } else {
  1211. result.provideContract_ = provideContractBuilder_.build();
  1212. }
  1213. if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
  1214. to_bitField0_ |= 0x00000080;
  1215. }
  1216. if (updatePaymentBuilder_ == null) {
  1217. result.updatePayment_ = updatePayment_;
  1218. } else {
  1219. result.updatePayment_ = updatePaymentBuilder_.build();
  1220. }
  1221. if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
  1222. to_bitField0_ |= 0x00000100;
  1223. }
  1224. if (closeBuilder_ == null) {
  1225. result.close_ = close_;
  1226. } else {
  1227. result.close_ = closeBuilder_.build();
  1228. }
  1229. if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
  1230. to_bitField0_ |= 0x00000200;
  1231. }
  1232. if (errorBuilder_ == null) {
  1233. result.error_ = error_;
  1234. } else {
  1235. result.error_ = errorBuilder_.build();
  1236. }
  1237. result.bitField0_ = to_bitField0_;
  1238. onBuilt();
  1239. return result;
  1240. }
  1241. public Builder mergeFrom(com.google.protobuf.Message other) {
  1242. if (other instanceof org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) {
  1243. return mergeFrom((org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage)other);
  1244. } else {
  1245. super.mergeFrom(other);
  1246. return this;
  1247. }
  1248. }
  1249. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage other) {
  1250. if (other == org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.getDefaultInstance()) return this;
  1251. if (other.hasType()) {
  1252. setType(other.getType());
  1253. }
  1254. if (other.hasClientVersion()) {
  1255. mergeClientVersion(other.getClientVersion());
  1256. }
  1257. if (other.hasServerVersion()) {
  1258. mergeServerVersion(other.getServerVersion());
  1259. }
  1260. if (other.hasInitiate()) {
  1261. mergeInitiate(other.getInitiate());
  1262. }
  1263. if (other.hasProvideRefund()) {
  1264. mergeProvideRefund(other.getProvideRefund());
  1265. }
  1266. if (other.hasReturnRefund()) {
  1267. mergeReturnRefund(other.getReturnRefund());
  1268. }
  1269. if (other.hasProvideContract()) {
  1270. mergeProvideContract(other.getProvideContract());
  1271. }
  1272. if (other.hasUpdatePayment()) {
  1273. mergeUpdatePayment(other.getUpdatePayment());
  1274. }
  1275. if (other.hasClose()) {
  1276. mergeClose(other.getClose());
  1277. }
  1278. if (other.hasError()) {
  1279. mergeError(other.getError());
  1280. }
  1281. this.mergeUnknownFields(other.getUnknownFields());
  1282. return this;
  1283. }
  1284. public final boolean isInitialized() {
  1285. if (!hasType()) {
  1286. return false;
  1287. }
  1288. if (hasClientVersion()) {
  1289. if (!getClientVersion().isInitialized()) {
  1290. return false;
  1291. }
  1292. }
  1293. if (hasServerVersion()) {
  1294. if (!getServerVersion().isInitialized()) {
  1295. return false;
  1296. }
  1297. }
  1298. if (hasInitiate()) {
  1299. if (!getInitiate().isInitialized()) {
  1300. return false;
  1301. }
  1302. }
  1303. if (hasProvideRefund()) {
  1304. if (!getProvideRefund().isInitialized()) {
  1305. return false;
  1306. }
  1307. }
  1308. if (hasReturnRefund()) {
  1309. if (!getReturnRefund().isInitialized()) {
  1310. return false;
  1311. }
  1312. }
  1313. if (hasProvideContract()) {
  1314. if (!getProvideContract().isInitialized()) {
  1315. return false;
  1316. }
  1317. }
  1318. if (hasUpdatePayment()) {
  1319. if (!getUpdatePayment().isInitialized()) {
  1320. return false;
  1321. }
  1322. }
  1323. if (hasClose()) {
  1324. if (!getClose().isInitialized()) {
  1325. return false;
  1326. }
  1327. }
  1328. return true;
  1329. }
  1330. public Builder mergeFrom(
  1331. com.google.protobuf.CodedInputStream input,
  1332. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  1333. throws java.io.IOException {
  1334. org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage parsedMessage = null;
  1335. try {
  1336. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  1337. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  1338. parsedMessage = (org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage) e.getUnfinishedMessage();
  1339. throw e;
  1340. } finally {
  1341. if (parsedMessage != null) {
  1342. mergeFrom(parsedMessage);
  1343. }
  1344. }
  1345. return this;
  1346. }
  1347. private int bitField0_;
  1348. // required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;
  1349. private org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION;
  1350. /**
  1351. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  1352. *
  1353. * <pre>
  1354. * This is required so if a new message type is added in future, old software aborts trying
  1355. * to read the message as early as possible. If the message doesn't parse, the socket should
  1356. * be closed.
  1357. * </pre>
  1358. */
  1359. public boolean hasType() {
  1360. return ((bitField0_ & 0x00000001) == 0x00000001);
  1361. }
  1362. /**
  1363. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  1364. *
  1365. * <pre>
  1366. * This is required so if a new message type is added in future, old software aborts trying
  1367. * to read the message as early as possible. If the message doesn't parse, the socket should
  1368. * be closed.
  1369. * </pre>
  1370. */
  1371. public org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType getType() {
  1372. return type_;
  1373. }
  1374. /**
  1375. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  1376. *
  1377. * <pre>
  1378. * This is required so if a new message type is added in future, old software aborts trying
  1379. * to read the message as early as possible. If the message doesn't parse, the socket should
  1380. * be closed.
  1381. * </pre>
  1382. */
  1383. public Builder setType(org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType value) {
  1384. if (value == null) {
  1385. throw new NullPointerException();
  1386. }
  1387. bitField0_ |= 0x00000001;
  1388. type_ = value;
  1389. onChanged();
  1390. return this;
  1391. }
  1392. /**
  1393. * <code>required .paymentchannels.TwoWayChannelMessage.MessageType type = 1;</code>
  1394. *
  1395. * <pre>
  1396. * This is required so if a new message type is added in future, old software aborts trying
  1397. * to read the message as early as possible. If the message doesn't parse, the socket should
  1398. * be closed.
  1399. * </pre>
  1400. */
  1401. public Builder clearType() {
  1402. bitField0_ = (bitField0_ & ~0x00000001);
  1403. type_ = org.bitcoin.paymentchannel.Protos.TwoWayChannelMessage.MessageType.CLIENT_VERSION;
  1404. onChanged();
  1405. return this;
  1406. }
  1407. // optional .paymentchannels.ClientVersion client_version = 2;
  1408. private org.bitcoin.paymentchannel.Protos.ClientVersion clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  1409. private com.google.protobuf.SingleFieldBuilder<
  1410. org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder> clientVersionBuilder_;
  1411. /**
  1412. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1413. *
  1414. * <pre>
  1415. * Now one optional field for each message. Only the field specified by type should be read.
  1416. * </pre>
  1417. */
  1418. public boolean hasClientVersion() {
  1419. return ((bitField0_ & 0x00000002) == 0x00000002);
  1420. }
  1421. /**
  1422. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1423. *
  1424. * <pre>
  1425. * Now one optional field for each message. Only the field specified by type should be read.
  1426. * </pre>
  1427. */
  1428. public org.bitcoin.paymentchannel.Protos.ClientVersion getClientVersion() {
  1429. if (clientVersionBuilder_ == null) {
  1430. return clientVersion_;
  1431. } else {
  1432. return clientVersionBuilder_.getMessage();
  1433. }
  1434. }
  1435. /**
  1436. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1437. *
  1438. * <pre>
  1439. * Now one optional field for each message. Only the field specified by type should be read.
  1440. * </pre>
  1441. */
  1442. public Builder setClientVersion(org.bitcoin.paymentchannel.Protos.ClientVersion value) {
  1443. if (clientVersionBuilder_ == null) {
  1444. if (value == null) {
  1445. throw new NullPointerException();
  1446. }
  1447. clientVersion_ = value;
  1448. onChanged();
  1449. } else {
  1450. clientVersionBuilder_.setMessage(value);
  1451. }
  1452. bitField0_ |= 0x00000002;
  1453. return this;
  1454. }
  1455. /**
  1456. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1457. *
  1458. * <pre>
  1459. * Now one optional field for each message. Only the field specified by type should be read.
  1460. * </pre>
  1461. */
  1462. public Builder setClientVersion(
  1463. org.bitcoin.paymentchannel.Protos.ClientVersion.Builder builderForValue) {
  1464. if (clientVersionBuilder_ == null) {
  1465. clientVersion_ = builderForValue.build();
  1466. onChanged();
  1467. } else {
  1468. clientVersionBuilder_.setMessage(builderForValue.build());
  1469. }
  1470. bitField0_ |= 0x00000002;
  1471. return this;
  1472. }
  1473. /**
  1474. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1475. *
  1476. * <pre>
  1477. * Now one optional field for each message. Only the field specified by type should be read.
  1478. * </pre>
  1479. */
  1480. public Builder mergeClientVersion(org.bitcoin.paymentchannel.Protos.ClientVersion value) {
  1481. if (clientVersionBuilder_ == null) {
  1482. if (((bitField0_ & 0x00000002) == 0x00000002) &&
  1483. clientVersion_ != org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance()) {
  1484. clientVersion_ =
  1485. org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder(clientVersion_).mergeFrom(value).buildPartial();
  1486. } else {
  1487. clientVersion_ = value;
  1488. }
  1489. onChanged();
  1490. } else {
  1491. clientVersionBuilder_.mergeFrom(value);
  1492. }
  1493. bitField0_ |= 0x00000002;
  1494. return this;
  1495. }
  1496. /**
  1497. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1498. *
  1499. * <pre>
  1500. * Now one optional field for each message. Only the field specified by type should be read.
  1501. * </pre>
  1502. */
  1503. public Builder clearClientVersion() {
  1504. if (clientVersionBuilder_ == null) {
  1505. clientVersion_ = org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  1506. onChanged();
  1507. } else {
  1508. clientVersionBuilder_.clear();
  1509. }
  1510. bitField0_ = (bitField0_ & ~0x00000002);
  1511. return this;
  1512. }
  1513. /**
  1514. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1515. *
  1516. * <pre>
  1517. * Now one optional field for each message. Only the field specified by type should be read.
  1518. * </pre>
  1519. */
  1520. public org.bitcoin.paymentchannel.Protos.ClientVersion.Builder getClientVersionBuilder() {
  1521. bitField0_ |= 0x00000002;
  1522. onChanged();
  1523. return getClientVersionFieldBuilder().getBuilder();
  1524. }
  1525. /**
  1526. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1527. *
  1528. * <pre>
  1529. * Now one optional field for each message. Only the field specified by type should be read.
  1530. * </pre>
  1531. */
  1532. public org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder getClientVersionOrBuilder() {
  1533. if (clientVersionBuilder_ != null) {
  1534. return clientVersionBuilder_.getMessageOrBuilder();
  1535. } else {
  1536. return clientVersion_;
  1537. }
  1538. }
  1539. /**
  1540. * <code>optional .paymentchannels.ClientVersion client_version = 2;</code>
  1541. *
  1542. * <pre>
  1543. * Now one optional field for each message. Only the field specified by type should be read.
  1544. * </pre>
  1545. */
  1546. private com.google.protobuf.SingleFieldBuilder<
  1547. org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder>
  1548. getClientVersionFieldBuilder() {
  1549. if (clientVersionBuilder_ == null) {
  1550. clientVersionBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  1551. org.bitcoin.paymentchannel.Protos.ClientVersion, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder, org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder>(
  1552. clientVersion_,
  1553. getParentForChildren(),
  1554. isClean());
  1555. clientVersion_ = null;
  1556. }
  1557. return clientVersionBuilder_;
  1558. }
  1559. // optional .paymentchannels.ServerVersion server_version = 3;
  1560. private org.bitcoin.paymentchannel.Protos.ServerVersion serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  1561. private com.google.protobuf.SingleFieldBuilder<
  1562. org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder> serverVersionBuilder_;
  1563. /**
  1564. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1565. */
  1566. public boolean hasServerVersion() {
  1567. return ((bitField0_ & 0x00000004) == 0x00000004);
  1568. }
  1569. /**
  1570. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1571. */
  1572. public org.bitcoin.paymentchannel.Protos.ServerVersion getServerVersion() {
  1573. if (serverVersionBuilder_ == null) {
  1574. return serverVersion_;
  1575. } else {
  1576. return serverVersionBuilder_.getMessage();
  1577. }
  1578. }
  1579. /**
  1580. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1581. */
  1582. public Builder setServerVersion(org.bitcoin.paymentchannel.Protos.ServerVersion value) {
  1583. if (serverVersionBuilder_ == null) {
  1584. if (value == null) {
  1585. throw new NullPointerException();
  1586. }
  1587. serverVersion_ = value;
  1588. onChanged();
  1589. } else {
  1590. serverVersionBuilder_.setMessage(value);
  1591. }
  1592. bitField0_ |= 0x00000004;
  1593. return this;
  1594. }
  1595. /**
  1596. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1597. */
  1598. public Builder setServerVersion(
  1599. org.bitcoin.paymentchannel.Protos.ServerVersion.Builder builderForValue) {
  1600. if (serverVersionBuilder_ == null) {
  1601. serverVersion_ = builderForValue.build();
  1602. onChanged();
  1603. } else {
  1604. serverVersionBuilder_.setMessage(builderForValue.build());
  1605. }
  1606. bitField0_ |= 0x00000004;
  1607. return this;
  1608. }
  1609. /**
  1610. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1611. */
  1612. public Builder mergeServerVersion(org.bitcoin.paymentchannel.Protos.ServerVersion value) {
  1613. if (serverVersionBuilder_ == null) {
  1614. if (((bitField0_ & 0x00000004) == 0x00000004) &&
  1615. serverVersion_ != org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance()) {
  1616. serverVersion_ =
  1617. org.bitcoin.paymentchannel.Protos.ServerVersion.newBuilder(serverVersion_).mergeFrom(value).buildPartial();
  1618. } else {
  1619. serverVersion_ = value;
  1620. }
  1621. onChanged();
  1622. } else {
  1623. serverVersionBuilder_.mergeFrom(value);
  1624. }
  1625. bitField0_ |= 0x00000004;
  1626. return this;
  1627. }
  1628. /**
  1629. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1630. */
  1631. public Builder clearServerVersion() {
  1632. if (serverVersionBuilder_ == null) {
  1633. serverVersion_ = org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  1634. onChanged();
  1635. } else {
  1636. serverVersionBuilder_.clear();
  1637. }
  1638. bitField0_ = (bitField0_ & ~0x00000004);
  1639. return this;
  1640. }
  1641. /**
  1642. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1643. */
  1644. public org.bitcoin.paymentchannel.Protos.ServerVersion.Builder getServerVersionBuilder() {
  1645. bitField0_ |= 0x00000004;
  1646. onChanged();
  1647. return getServerVersionFieldBuilder().getBuilder();
  1648. }
  1649. /**
  1650. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1651. */
  1652. public org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder getServerVersionOrBuilder() {
  1653. if (serverVersionBuilder_ != null) {
  1654. return serverVersionBuilder_.getMessageOrBuilder();
  1655. } else {
  1656. return serverVersion_;
  1657. }
  1658. }
  1659. /**
  1660. * <code>optional .paymentchannels.ServerVersion server_version = 3;</code>
  1661. */
  1662. private com.google.protobuf.SingleFieldBuilder<
  1663. org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder>
  1664. getServerVersionFieldBuilder() {
  1665. if (serverVersionBuilder_ == null) {
  1666. serverVersionBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  1667. org.bitcoin.paymentchannel.Protos.ServerVersion, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder, org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder>(
  1668. serverVersion_,
  1669. getParentForChildren(),
  1670. isClean());
  1671. serverVersion_ = null;
  1672. }
  1673. return serverVersionBuilder_;
  1674. }
  1675. // optional .paymentchannels.Initiate initiate = 4;
  1676. private org.bitcoin.paymentchannel.Protos.Initiate initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  1677. private com.google.protobuf.SingleFieldBuilder<
  1678. org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder> initiateBuilder_;
  1679. /**
  1680. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1681. */
  1682. public boolean hasInitiate() {
  1683. return ((bitField0_ & 0x00000008) == 0x00000008);
  1684. }
  1685. /**
  1686. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1687. */
  1688. public org.bitcoin.paymentchannel.Protos.Initiate getInitiate() {
  1689. if (initiateBuilder_ == null) {
  1690. return initiate_;
  1691. } else {
  1692. return initiateBuilder_.getMessage();
  1693. }
  1694. }
  1695. /**
  1696. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1697. */
  1698. public Builder setInitiate(org.bitcoin.paymentchannel.Protos.Initiate value) {
  1699. if (initiateBuilder_ == null) {
  1700. if (value == null) {
  1701. throw new NullPointerException();
  1702. }
  1703. initiate_ = value;
  1704. onChanged();
  1705. } else {
  1706. initiateBuilder_.setMessage(value);
  1707. }
  1708. bitField0_ |= 0x00000008;
  1709. return this;
  1710. }
  1711. /**
  1712. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1713. */
  1714. public Builder setInitiate(
  1715. org.bitcoin.paymentchannel.Protos.Initiate.Builder builderForValue) {
  1716. if (initiateBuilder_ == null) {
  1717. initiate_ = builderForValue.build();
  1718. onChanged();
  1719. } else {
  1720. initiateBuilder_.setMessage(builderForValue.build());
  1721. }
  1722. bitField0_ |= 0x00000008;
  1723. return this;
  1724. }
  1725. /**
  1726. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1727. */
  1728. public Builder mergeInitiate(org.bitcoin.paymentchannel.Protos.Initiate value) {
  1729. if (initiateBuilder_ == null) {
  1730. if (((bitField0_ & 0x00000008) == 0x00000008) &&
  1731. initiate_ != org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) {
  1732. initiate_ =
  1733. org.bitcoin.paymentchannel.Protos.Initiate.newBuilder(initiate_).mergeFrom(value).buildPartial();
  1734. } else {
  1735. initiate_ = value;
  1736. }
  1737. onChanged();
  1738. } else {
  1739. initiateBuilder_.mergeFrom(value);
  1740. }
  1741. bitField0_ |= 0x00000008;
  1742. return this;
  1743. }
  1744. /**
  1745. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1746. */
  1747. public Builder clearInitiate() {
  1748. if (initiateBuilder_ == null) {
  1749. initiate_ = org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  1750. onChanged();
  1751. } else {
  1752. initiateBuilder_.clear();
  1753. }
  1754. bitField0_ = (bitField0_ & ~0x00000008);
  1755. return this;
  1756. }
  1757. /**
  1758. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1759. */
  1760. public org.bitcoin.paymentchannel.Protos.Initiate.Builder getInitiateBuilder() {
  1761. bitField0_ |= 0x00000008;
  1762. onChanged();
  1763. return getInitiateFieldBuilder().getBuilder();
  1764. }
  1765. /**
  1766. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1767. */
  1768. public org.bitcoin.paymentchannel.Protos.InitiateOrBuilder getInitiateOrBuilder() {
  1769. if (initiateBuilder_ != null) {
  1770. return initiateBuilder_.getMessageOrBuilder();
  1771. } else {
  1772. return initiate_;
  1773. }
  1774. }
  1775. /**
  1776. * <code>optional .paymentchannels.Initiate initiate = 4;</code>
  1777. */
  1778. private com.google.protobuf.SingleFieldBuilder<
  1779. org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder>
  1780. getInitiateFieldBuilder() {
  1781. if (initiateBuilder_ == null) {
  1782. initiateBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  1783. org.bitcoin.paymentchannel.Protos.Initiate, org.bitcoin.paymentchannel.Protos.Initiate.Builder, org.bitcoin.paymentchannel.Protos.InitiateOrBuilder>(
  1784. initiate_,
  1785. getParentForChildren(),
  1786. isClean());
  1787. initiate_ = null;
  1788. }
  1789. return initiateBuilder_;
  1790. }
  1791. // optional .paymentchannels.ProvideRefund provide_refund = 5;
  1792. private org.bitcoin.paymentchannel.Protos.ProvideRefund provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  1793. private com.google.protobuf.SingleFieldBuilder<
  1794. org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder> provideRefundBuilder_;
  1795. /**
  1796. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1797. */
  1798. public boolean hasProvideRefund() {
  1799. return ((bitField0_ & 0x00000010) == 0x00000010);
  1800. }
  1801. /**
  1802. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1803. */
  1804. public org.bitcoin.paymentchannel.Protos.ProvideRefund getProvideRefund() {
  1805. if (provideRefundBuilder_ == null) {
  1806. return provideRefund_;
  1807. } else {
  1808. return provideRefundBuilder_.getMessage();
  1809. }
  1810. }
  1811. /**
  1812. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1813. */
  1814. public Builder setProvideRefund(org.bitcoin.paymentchannel.Protos.ProvideRefund value) {
  1815. if (provideRefundBuilder_ == null) {
  1816. if (value == null) {
  1817. throw new NullPointerException();
  1818. }
  1819. provideRefund_ = value;
  1820. onChanged();
  1821. } else {
  1822. provideRefundBuilder_.setMessage(value);
  1823. }
  1824. bitField0_ |= 0x00000010;
  1825. return this;
  1826. }
  1827. /**
  1828. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1829. */
  1830. public Builder setProvideRefund(
  1831. org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder builderForValue) {
  1832. if (provideRefundBuilder_ == null) {
  1833. provideRefund_ = builderForValue.build();
  1834. onChanged();
  1835. } else {
  1836. provideRefundBuilder_.setMessage(builderForValue.build());
  1837. }
  1838. bitField0_ |= 0x00000010;
  1839. return this;
  1840. }
  1841. /**
  1842. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1843. */
  1844. public Builder mergeProvideRefund(org.bitcoin.paymentchannel.Protos.ProvideRefund value) {
  1845. if (provideRefundBuilder_ == null) {
  1846. if (((bitField0_ & 0x00000010) == 0x00000010) &&
  1847. provideRefund_ != org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance()) {
  1848. provideRefund_ =
  1849. org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder(provideRefund_).mergeFrom(value).buildPartial();
  1850. } else {
  1851. provideRefund_ = value;
  1852. }
  1853. onChanged();
  1854. } else {
  1855. provideRefundBuilder_.mergeFrom(value);
  1856. }
  1857. bitField0_ |= 0x00000010;
  1858. return this;
  1859. }
  1860. /**
  1861. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1862. */
  1863. public Builder clearProvideRefund() {
  1864. if (provideRefundBuilder_ == null) {
  1865. provideRefund_ = org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  1866. onChanged();
  1867. } else {
  1868. provideRefundBuilder_.clear();
  1869. }
  1870. bitField0_ = (bitField0_ & ~0x00000010);
  1871. return this;
  1872. }
  1873. /**
  1874. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1875. */
  1876. public org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder getProvideRefundBuilder() {
  1877. bitField0_ |= 0x00000010;
  1878. onChanged();
  1879. return getProvideRefundFieldBuilder().getBuilder();
  1880. }
  1881. /**
  1882. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1883. */
  1884. public org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder getProvideRefundOrBuilder() {
  1885. if (provideRefundBuilder_ != null) {
  1886. return provideRefundBuilder_.getMessageOrBuilder();
  1887. } else {
  1888. return provideRefund_;
  1889. }
  1890. }
  1891. /**
  1892. * <code>optional .paymentchannels.ProvideRefund provide_refund = 5;</code>
  1893. */
  1894. private com.google.protobuf.SingleFieldBuilder<
  1895. org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder>
  1896. getProvideRefundFieldBuilder() {
  1897. if (provideRefundBuilder_ == null) {
  1898. provideRefundBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  1899. org.bitcoin.paymentchannel.Protos.ProvideRefund, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder, org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder>(
  1900. provideRefund_,
  1901. getParentForChildren(),
  1902. isClean());
  1903. provideRefund_ = null;
  1904. }
  1905. return provideRefundBuilder_;
  1906. }
  1907. // optional .paymentchannels.ReturnRefund return_refund = 6;
  1908. private org.bitcoin.paymentchannel.Protos.ReturnRefund returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  1909. private com.google.protobuf.SingleFieldBuilder<
  1910. org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder> returnRefundBuilder_;
  1911. /**
  1912. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1913. */
  1914. public boolean hasReturnRefund() {
  1915. return ((bitField0_ & 0x00000020) == 0x00000020);
  1916. }
  1917. /**
  1918. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1919. */
  1920. public org.bitcoin.paymentchannel.Protos.ReturnRefund getReturnRefund() {
  1921. if (returnRefundBuilder_ == null) {
  1922. return returnRefund_;
  1923. } else {
  1924. return returnRefundBuilder_.getMessage();
  1925. }
  1926. }
  1927. /**
  1928. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1929. */
  1930. public Builder setReturnRefund(org.bitcoin.paymentchannel.Protos.ReturnRefund value) {
  1931. if (returnRefundBuilder_ == null) {
  1932. if (value == null) {
  1933. throw new NullPointerException();
  1934. }
  1935. returnRefund_ = value;
  1936. onChanged();
  1937. } else {
  1938. returnRefundBuilder_.setMessage(value);
  1939. }
  1940. bitField0_ |= 0x00000020;
  1941. return this;
  1942. }
  1943. /**
  1944. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1945. */
  1946. public Builder setReturnRefund(
  1947. org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder builderForValue) {
  1948. if (returnRefundBuilder_ == null) {
  1949. returnRefund_ = builderForValue.build();
  1950. onChanged();
  1951. } else {
  1952. returnRefundBuilder_.setMessage(builderForValue.build());
  1953. }
  1954. bitField0_ |= 0x00000020;
  1955. return this;
  1956. }
  1957. /**
  1958. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1959. */
  1960. public Builder mergeReturnRefund(org.bitcoin.paymentchannel.Protos.ReturnRefund value) {
  1961. if (returnRefundBuilder_ == null) {
  1962. if (((bitField0_ & 0x00000020) == 0x00000020) &&
  1963. returnRefund_ != org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance()) {
  1964. returnRefund_ =
  1965. org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder(returnRefund_).mergeFrom(value).buildPartial();
  1966. } else {
  1967. returnRefund_ = value;
  1968. }
  1969. onChanged();
  1970. } else {
  1971. returnRefundBuilder_.mergeFrom(value);
  1972. }
  1973. bitField0_ |= 0x00000020;
  1974. return this;
  1975. }
  1976. /**
  1977. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1978. */
  1979. public Builder clearReturnRefund() {
  1980. if (returnRefundBuilder_ == null) {
  1981. returnRefund_ = org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  1982. onChanged();
  1983. } else {
  1984. returnRefundBuilder_.clear();
  1985. }
  1986. bitField0_ = (bitField0_ & ~0x00000020);
  1987. return this;
  1988. }
  1989. /**
  1990. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1991. */
  1992. public org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder getReturnRefundBuilder() {
  1993. bitField0_ |= 0x00000020;
  1994. onChanged();
  1995. return getReturnRefundFieldBuilder().getBuilder();
  1996. }
  1997. /**
  1998. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  1999. */
  2000. public org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder getReturnRefundOrBuilder() {
  2001. if (returnRefundBuilder_ != null) {
  2002. return returnRefundBuilder_.getMessageOrBuilder();
  2003. } else {
  2004. return returnRefund_;
  2005. }
  2006. }
  2007. /**
  2008. * <code>optional .paymentchannels.ReturnRefund return_refund = 6;</code>
  2009. */
  2010. private com.google.protobuf.SingleFieldBuilder<
  2011. org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder>
  2012. getReturnRefundFieldBuilder() {
  2013. if (returnRefundBuilder_ == null) {
  2014. returnRefundBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  2015. org.bitcoin.paymentchannel.Protos.ReturnRefund, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder, org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder>(
  2016. returnRefund_,
  2017. getParentForChildren(),
  2018. isClean());
  2019. returnRefund_ = null;
  2020. }
  2021. return returnRefundBuilder_;
  2022. }
  2023. // optional .paymentchannels.ProvideContract provide_contract = 7;
  2024. private org.bitcoin.paymentchannel.Protos.ProvideContract provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  2025. private com.google.protobuf.SingleFieldBuilder<
  2026. org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder> provideContractBuilder_;
  2027. /**
  2028. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2029. */
  2030. public boolean hasProvideContract() {
  2031. return ((bitField0_ & 0x00000040) == 0x00000040);
  2032. }
  2033. /**
  2034. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2035. */
  2036. public org.bitcoin.paymentchannel.Protos.ProvideContract getProvideContract() {
  2037. if (provideContractBuilder_ == null) {
  2038. return provideContract_;
  2039. } else {
  2040. return provideContractBuilder_.getMessage();
  2041. }
  2042. }
  2043. /**
  2044. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2045. */
  2046. public Builder setProvideContract(org.bitcoin.paymentchannel.Protos.ProvideContract value) {
  2047. if (provideContractBuilder_ == null) {
  2048. if (value == null) {
  2049. throw new NullPointerException();
  2050. }
  2051. provideContract_ = value;
  2052. onChanged();
  2053. } else {
  2054. provideContractBuilder_.setMessage(value);
  2055. }
  2056. bitField0_ |= 0x00000040;
  2057. return this;
  2058. }
  2059. /**
  2060. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2061. */
  2062. public Builder setProvideContract(
  2063. org.bitcoin.paymentchannel.Protos.ProvideContract.Builder builderForValue) {
  2064. if (provideContractBuilder_ == null) {
  2065. provideContract_ = builderForValue.build();
  2066. onChanged();
  2067. } else {
  2068. provideContractBuilder_.setMessage(builderForValue.build());
  2069. }
  2070. bitField0_ |= 0x00000040;
  2071. return this;
  2072. }
  2073. /**
  2074. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2075. */
  2076. public Builder mergeProvideContract(org.bitcoin.paymentchannel.Protos.ProvideContract value) {
  2077. if (provideContractBuilder_ == null) {
  2078. if (((bitField0_ & 0x00000040) == 0x00000040) &&
  2079. provideContract_ != org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance()) {
  2080. provideContract_ =
  2081. org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder(provideContract_).mergeFrom(value).buildPartial();
  2082. } else {
  2083. provideContract_ = value;
  2084. }
  2085. onChanged();
  2086. } else {
  2087. provideContractBuilder_.mergeFrom(value);
  2088. }
  2089. bitField0_ |= 0x00000040;
  2090. return this;
  2091. }
  2092. /**
  2093. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2094. */
  2095. public Builder clearProvideContract() {
  2096. if (provideContractBuilder_ == null) {
  2097. provideContract_ = org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  2098. onChanged();
  2099. } else {
  2100. provideContractBuilder_.clear();
  2101. }
  2102. bitField0_ = (bitField0_ & ~0x00000040);
  2103. return this;
  2104. }
  2105. /**
  2106. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2107. */
  2108. public org.bitcoin.paymentchannel.Protos.ProvideContract.Builder getProvideContractBuilder() {
  2109. bitField0_ |= 0x00000040;
  2110. onChanged();
  2111. return getProvideContractFieldBuilder().getBuilder();
  2112. }
  2113. /**
  2114. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2115. */
  2116. public org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder getProvideContractOrBuilder() {
  2117. if (provideContractBuilder_ != null) {
  2118. return provideContractBuilder_.getMessageOrBuilder();
  2119. } else {
  2120. return provideContract_;
  2121. }
  2122. }
  2123. /**
  2124. * <code>optional .paymentchannels.ProvideContract provide_contract = 7;</code>
  2125. */
  2126. private com.google.protobuf.SingleFieldBuilder<
  2127. org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder>
  2128. getProvideContractFieldBuilder() {
  2129. if (provideContractBuilder_ == null) {
  2130. provideContractBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  2131. org.bitcoin.paymentchannel.Protos.ProvideContract, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder, org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder>(
  2132. provideContract_,
  2133. getParentForChildren(),
  2134. isClean());
  2135. provideContract_ = null;
  2136. }
  2137. return provideContractBuilder_;
  2138. }
  2139. // optional .paymentchannels.UpdatePayment update_payment = 8;
  2140. private org.bitcoin.paymentchannel.Protos.UpdatePayment updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  2141. private com.google.protobuf.SingleFieldBuilder<
  2142. org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder> updatePaymentBuilder_;
  2143. /**
  2144. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2145. */
  2146. public boolean hasUpdatePayment() {
  2147. return ((bitField0_ & 0x00000080) == 0x00000080);
  2148. }
  2149. /**
  2150. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2151. */
  2152. public org.bitcoin.paymentchannel.Protos.UpdatePayment getUpdatePayment() {
  2153. if (updatePaymentBuilder_ == null) {
  2154. return updatePayment_;
  2155. } else {
  2156. return updatePaymentBuilder_.getMessage();
  2157. }
  2158. }
  2159. /**
  2160. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2161. */
  2162. public Builder setUpdatePayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) {
  2163. if (updatePaymentBuilder_ == null) {
  2164. if (value == null) {
  2165. throw new NullPointerException();
  2166. }
  2167. updatePayment_ = value;
  2168. onChanged();
  2169. } else {
  2170. updatePaymentBuilder_.setMessage(value);
  2171. }
  2172. bitField0_ |= 0x00000080;
  2173. return this;
  2174. }
  2175. /**
  2176. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2177. */
  2178. public Builder setUpdatePayment(
  2179. org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder builderForValue) {
  2180. if (updatePaymentBuilder_ == null) {
  2181. updatePayment_ = builderForValue.build();
  2182. onChanged();
  2183. } else {
  2184. updatePaymentBuilder_.setMessage(builderForValue.build());
  2185. }
  2186. bitField0_ |= 0x00000080;
  2187. return this;
  2188. }
  2189. /**
  2190. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2191. */
  2192. public Builder mergeUpdatePayment(org.bitcoin.paymentchannel.Protos.UpdatePayment value) {
  2193. if (updatePaymentBuilder_ == null) {
  2194. if (((bitField0_ & 0x00000080) == 0x00000080) &&
  2195. updatePayment_ != org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) {
  2196. updatePayment_ =
  2197. org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder(updatePayment_).mergeFrom(value).buildPartial();
  2198. } else {
  2199. updatePayment_ = value;
  2200. }
  2201. onChanged();
  2202. } else {
  2203. updatePaymentBuilder_.mergeFrom(value);
  2204. }
  2205. bitField0_ |= 0x00000080;
  2206. return this;
  2207. }
  2208. /**
  2209. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2210. */
  2211. public Builder clearUpdatePayment() {
  2212. if (updatePaymentBuilder_ == null) {
  2213. updatePayment_ = org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  2214. onChanged();
  2215. } else {
  2216. updatePaymentBuilder_.clear();
  2217. }
  2218. bitField0_ = (bitField0_ & ~0x00000080);
  2219. return this;
  2220. }
  2221. /**
  2222. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2223. */
  2224. public org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder getUpdatePaymentBuilder() {
  2225. bitField0_ |= 0x00000080;
  2226. onChanged();
  2227. return getUpdatePaymentFieldBuilder().getBuilder();
  2228. }
  2229. /**
  2230. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2231. */
  2232. public org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder getUpdatePaymentOrBuilder() {
  2233. if (updatePaymentBuilder_ != null) {
  2234. return updatePaymentBuilder_.getMessageOrBuilder();
  2235. } else {
  2236. return updatePayment_;
  2237. }
  2238. }
  2239. /**
  2240. * <code>optional .paymentchannels.UpdatePayment update_payment = 8;</code>
  2241. */
  2242. private com.google.protobuf.SingleFieldBuilder<
  2243. org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder>
  2244. getUpdatePaymentFieldBuilder() {
  2245. if (updatePaymentBuilder_ == null) {
  2246. updatePaymentBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  2247. org.bitcoin.paymentchannel.Protos.UpdatePayment, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder, org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder>(
  2248. updatePayment_,
  2249. getParentForChildren(),
  2250. isClean());
  2251. updatePayment_ = null;
  2252. }
  2253. return updatePaymentBuilder_;
  2254. }
  2255. // optional .paymentchannels.Close close = 9;
  2256. private org.bitcoin.paymentchannel.Protos.Close close_ = org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  2257. private com.google.protobuf.SingleFieldBuilder<
  2258. org.bitcoin.paymentchannel.Protos.Close, org.bitcoin.paymentchannel.Protos.Close.Builder, org.bitcoin.paymentchannel.Protos.CloseOrBuilder> closeBuilder_;
  2259. /**
  2260. * <code>optional .paymentchannels.Close close = 9;</code>
  2261. */
  2262. public boolean hasClose() {
  2263. return ((bitField0_ & 0x00000100) == 0x00000100);
  2264. }
  2265. /**
  2266. * <code>optional .paymentchannels.Close close = 9;</code>
  2267. */
  2268. public org.bitcoin.paymentchannel.Protos.Close getClose() {
  2269. if (closeBuilder_ == null) {
  2270. return close_;
  2271. } else {
  2272. return closeBuilder_.getMessage();
  2273. }
  2274. }
  2275. /**
  2276. * <code>optional .paymentchannels.Close close = 9;</code>
  2277. */
  2278. public Builder setClose(org.bitcoin.paymentchannel.Protos.Close value) {
  2279. if (closeBuilder_ == null) {
  2280. if (value == null) {
  2281. throw new NullPointerException();
  2282. }
  2283. close_ = value;
  2284. onChanged();
  2285. } else {
  2286. closeBuilder_.setMessage(value);
  2287. }
  2288. bitField0_ |= 0x00000100;
  2289. return this;
  2290. }
  2291. /**
  2292. * <code>optional .paymentchannels.Close close = 9;</code>
  2293. */
  2294. public Builder setClose(
  2295. org.bitcoin.paymentchannel.Protos.Close.Builder builderForValue) {
  2296. if (closeBuilder_ == null) {
  2297. close_ = builderForValue.build();
  2298. onChanged();
  2299. } else {
  2300. closeBuilder_.setMessage(builderForValue.build());
  2301. }
  2302. bitField0_ |= 0x00000100;
  2303. return this;
  2304. }
  2305. /**
  2306. * <code>optional .paymentchannels.Close close = 9;</code>
  2307. */
  2308. public Builder mergeClose(org.bitcoin.paymentchannel.Protos.Close value) {
  2309. if (closeBuilder_ == null) {
  2310. if (((bitField0_ & 0x00000100) == 0x00000100) &&
  2311. close_ != org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance()) {
  2312. close_ =
  2313. org.bitcoin.paymentchannel.Protos.Close.newBuilder(close_).mergeFrom(value).buildPartial();
  2314. } else {
  2315. close_ = value;
  2316. }
  2317. onChanged();
  2318. } else {
  2319. closeBuilder_.mergeFrom(value);
  2320. }
  2321. bitField0_ |= 0x00000100;
  2322. return this;
  2323. }
  2324. /**
  2325. * <code>optional .paymentchannels.Close close = 9;</code>
  2326. */
  2327. public Builder clearClose() {
  2328. if (closeBuilder_ == null) {
  2329. close_ = org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  2330. onChanged();
  2331. } else {
  2332. closeBuilder_.clear();
  2333. }
  2334. bitField0_ = (bitField0_ & ~0x00000100);
  2335. return this;
  2336. }
  2337. /**
  2338. * <code>optional .paymentchannels.Close close = 9;</code>
  2339. */
  2340. public org.bitcoin.paymentchannel.Protos.Close.Builder getCloseBuilder() {
  2341. bitField0_ |= 0x00000100;
  2342. onChanged();
  2343. return getCloseFieldBuilder().getBuilder();
  2344. }
  2345. /**
  2346. * <code>optional .paymentchannels.Close close = 9;</code>
  2347. */
  2348. public org.bitcoin.paymentchannel.Protos.CloseOrBuilder getCloseOrBuilder() {
  2349. if (closeBuilder_ != null) {
  2350. return closeBuilder_.getMessageOrBuilder();
  2351. } else {
  2352. return close_;
  2353. }
  2354. }
  2355. /**
  2356. * <code>optional .paymentchannels.Close close = 9;</code>
  2357. */
  2358. private com.google.protobuf.SingleFieldBuilder<
  2359. org.bitcoin.paymentchannel.Protos.Close, org.bitcoin.paymentchannel.Protos.Close.Builder, org.bitcoin.paymentchannel.Protos.CloseOrBuilder>
  2360. getCloseFieldBuilder() {
  2361. if (closeBuilder_ == null) {
  2362. closeBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  2363. org.bitcoin.paymentchannel.Protos.Close, org.bitcoin.paymentchannel.Protos.Close.Builder, org.bitcoin.paymentchannel.Protos.CloseOrBuilder>(
  2364. close_,
  2365. getParentForChildren(),
  2366. isClean());
  2367. close_ = null;
  2368. }
  2369. return closeBuilder_;
  2370. }
  2371. // optional .paymentchannels.Error error = 10;
  2372. private org.bitcoin.paymentchannel.Protos.Error error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  2373. private com.google.protobuf.SingleFieldBuilder<
  2374. org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder> errorBuilder_;
  2375. /**
  2376. * <code>optional .paymentchannels.Error error = 10;</code>
  2377. */
  2378. public boolean hasError() {
  2379. return ((bitField0_ & 0x00000200) == 0x00000200);
  2380. }
  2381. /**
  2382. * <code>optional .paymentchannels.Error error = 10;</code>
  2383. */
  2384. public org.bitcoin.paymentchannel.Protos.Error getError() {
  2385. if (errorBuilder_ == null) {
  2386. return error_;
  2387. } else {
  2388. return errorBuilder_.getMessage();
  2389. }
  2390. }
  2391. /**
  2392. * <code>optional .paymentchannels.Error error = 10;</code>
  2393. */
  2394. public Builder setError(org.bitcoin.paymentchannel.Protos.Error value) {
  2395. if (errorBuilder_ == null) {
  2396. if (value == null) {
  2397. throw new NullPointerException();
  2398. }
  2399. error_ = value;
  2400. onChanged();
  2401. } else {
  2402. errorBuilder_.setMessage(value);
  2403. }
  2404. bitField0_ |= 0x00000200;
  2405. return this;
  2406. }
  2407. /**
  2408. * <code>optional .paymentchannels.Error error = 10;</code>
  2409. */
  2410. public Builder setError(
  2411. org.bitcoin.paymentchannel.Protos.Error.Builder builderForValue) {
  2412. if (errorBuilder_ == null) {
  2413. error_ = builderForValue.build();
  2414. onChanged();
  2415. } else {
  2416. errorBuilder_.setMessage(builderForValue.build());
  2417. }
  2418. bitField0_ |= 0x00000200;
  2419. return this;
  2420. }
  2421. /**
  2422. * <code>optional .paymentchannels.Error error = 10;</code>
  2423. */
  2424. public Builder mergeError(org.bitcoin.paymentchannel.Protos.Error value) {
  2425. if (errorBuilder_ == null) {
  2426. if (((bitField0_ & 0x00000200) == 0x00000200) &&
  2427. error_ != org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) {
  2428. error_ =
  2429. org.bitcoin.paymentchannel.Protos.Error.newBuilder(error_).mergeFrom(value).buildPartial();
  2430. } else {
  2431. error_ = value;
  2432. }
  2433. onChanged();
  2434. } else {
  2435. errorBuilder_.mergeFrom(value);
  2436. }
  2437. bitField0_ |= 0x00000200;
  2438. return this;
  2439. }
  2440. /**
  2441. * <code>optional .paymentchannels.Error error = 10;</code>
  2442. */
  2443. public Builder clearError() {
  2444. if (errorBuilder_ == null) {
  2445. error_ = org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  2446. onChanged();
  2447. } else {
  2448. errorBuilder_.clear();
  2449. }
  2450. bitField0_ = (bitField0_ & ~0x00000200);
  2451. return this;
  2452. }
  2453. /**
  2454. * <code>optional .paymentchannels.Error error = 10;</code>
  2455. */
  2456. public org.bitcoin.paymentchannel.Protos.Error.Builder getErrorBuilder() {
  2457. bitField0_ |= 0x00000200;
  2458. onChanged();
  2459. return getErrorFieldBuilder().getBuilder();
  2460. }
  2461. /**
  2462. * <code>optional .paymentchannels.Error error = 10;</code>
  2463. */
  2464. public org.bitcoin.paymentchannel.Protos.ErrorOrBuilder getErrorOrBuilder() {
  2465. if (errorBuilder_ != null) {
  2466. return errorBuilder_.getMessageOrBuilder();
  2467. } else {
  2468. return error_;
  2469. }
  2470. }
  2471. /**
  2472. * <code>optional .paymentchannels.Error error = 10;</code>
  2473. */
  2474. private com.google.protobuf.SingleFieldBuilder<
  2475. org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder>
  2476. getErrorFieldBuilder() {
  2477. if (errorBuilder_ == null) {
  2478. errorBuilder_ = new com.google.protobuf.SingleFieldBuilder<
  2479. org.bitcoin.paymentchannel.Protos.Error, org.bitcoin.paymentchannel.Protos.Error.Builder, org.bitcoin.paymentchannel.Protos.ErrorOrBuilder>(
  2480. error_,
  2481. getParentForChildren(),
  2482. isClean());
  2483. error_ = null;
  2484. }
  2485. return errorBuilder_;
  2486. }
  2487. // @@protoc_insertion_point(builder_scope:paymentchannels.TwoWayChannelMessage)
  2488. }
  2489. static {
  2490. defaultInstance = new TwoWayChannelMessage(true);
  2491. defaultInstance.initFields();
  2492. }
  2493. // @@protoc_insertion_point(class_scope:paymentchannels.TwoWayChannelMessage)
  2494. }
  2495. public interface ClientVersionOrBuilder
  2496. extends com.google.protobuf.MessageOrBuilder {
  2497. // required int32 major = 1;
  2498. /**
  2499. * <code>required int32 major = 1;</code>
  2500. */
  2501. boolean hasMajor();
  2502. /**
  2503. * <code>required int32 major = 1;</code>
  2504. */
  2505. int getMajor();
  2506. // optional int32 minor = 2 [default = 0];
  2507. /**
  2508. * <code>optional int32 minor = 2 [default = 0];</code>
  2509. */
  2510. boolean hasMinor();
  2511. /**
  2512. * <code>optional int32 minor = 2 [default = 0];</code>
  2513. */
  2514. int getMinor();
  2515. // optional bytes previous_channel_contract_hash = 3;
  2516. /**
  2517. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  2518. *
  2519. * <pre>
  2520. * The hash of the multisig contract of a previous channel. This indicates that the primary
  2521. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  2522. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  2523. * follows SERVER_VERSION with an Initiate representing a new channel
  2524. * </pre>
  2525. */
  2526. boolean hasPreviousChannelContractHash();
  2527. /**
  2528. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  2529. *
  2530. * <pre>
  2531. * The hash of the multisig contract of a previous channel. This indicates that the primary
  2532. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  2533. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  2534. * follows SERVER_VERSION with an Initiate representing a new channel
  2535. * </pre>
  2536. */
  2537. com.google.protobuf.ByteString getPreviousChannelContractHash();
  2538. }
  2539. /**
  2540. * Protobuf type {@code paymentchannels.ClientVersion}
  2541. *
  2542. * <pre>
  2543. * Sent by primary to secondary on opening the connection. If anything is received before this is
  2544. * sent, the socket is closed.
  2545. * </pre>
  2546. */
  2547. public static final class ClientVersion extends
  2548. com.google.protobuf.GeneratedMessage
  2549. implements ClientVersionOrBuilder {
  2550. // Use ClientVersion.newBuilder() to construct.
  2551. private ClientVersion(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  2552. super(builder);
  2553. this.unknownFields = builder.getUnknownFields();
  2554. }
  2555. private ClientVersion(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  2556. private static final ClientVersion defaultInstance;
  2557. public static ClientVersion getDefaultInstance() {
  2558. return defaultInstance;
  2559. }
  2560. public ClientVersion getDefaultInstanceForType() {
  2561. return defaultInstance;
  2562. }
  2563. private final com.google.protobuf.UnknownFieldSet unknownFields;
  2564. @java.lang.Override
  2565. public final com.google.protobuf.UnknownFieldSet
  2566. getUnknownFields() {
  2567. return this.unknownFields;
  2568. }
  2569. private ClientVersion(
  2570. com.google.protobuf.CodedInputStream input,
  2571. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2572. throws com.google.protobuf.InvalidProtocolBufferException {
  2573. initFields();
  2574. int mutable_bitField0_ = 0;
  2575. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  2576. com.google.protobuf.UnknownFieldSet.newBuilder();
  2577. try {
  2578. boolean done = false;
  2579. while (!done) {
  2580. int tag = input.readTag();
  2581. switch (tag) {
  2582. case 0:
  2583. done = true;
  2584. break;
  2585. default: {
  2586. if (!parseUnknownField(input, unknownFields,
  2587. extensionRegistry, tag)) {
  2588. done = true;
  2589. }
  2590. break;
  2591. }
  2592. case 8: {
  2593. bitField0_ |= 0x00000001;
  2594. major_ = input.readInt32();
  2595. break;
  2596. }
  2597. case 16: {
  2598. bitField0_ |= 0x00000002;
  2599. minor_ = input.readInt32();
  2600. break;
  2601. }
  2602. case 26: {
  2603. bitField0_ |= 0x00000004;
  2604. previousChannelContractHash_ = input.readBytes();
  2605. break;
  2606. }
  2607. }
  2608. }
  2609. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  2610. throw e.setUnfinishedMessage(this);
  2611. } catch (java.io.IOException e) {
  2612. throw new com.google.protobuf.InvalidProtocolBufferException(
  2613. e.getMessage()).setUnfinishedMessage(this);
  2614. } finally {
  2615. this.unknownFields = unknownFields.build();
  2616. makeExtensionsImmutable();
  2617. }
  2618. }
  2619. public static final com.google.protobuf.Descriptors.Descriptor
  2620. getDescriptor() {
  2621. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor;
  2622. }
  2623. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  2624. internalGetFieldAccessorTable() {
  2625. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable
  2626. .ensureFieldAccessorsInitialized(
  2627. org.bitcoin.paymentchannel.Protos.ClientVersion.class, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class);
  2628. }
  2629. public static com.google.protobuf.Parser<ClientVersion> PARSER =
  2630. new com.google.protobuf.AbstractParser<ClientVersion>() {
  2631. public ClientVersion parsePartialFrom(
  2632. com.google.protobuf.CodedInputStream input,
  2633. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2634. throws com.google.protobuf.InvalidProtocolBufferException {
  2635. return new ClientVersion(input, extensionRegistry);
  2636. }
  2637. };
  2638. @java.lang.Override
  2639. public com.google.protobuf.Parser<ClientVersion> getParserForType() {
  2640. return PARSER;
  2641. }
  2642. private int bitField0_;
  2643. // required int32 major = 1;
  2644. public static final int MAJOR_FIELD_NUMBER = 1;
  2645. private int major_;
  2646. /**
  2647. * <code>required int32 major = 1;</code>
  2648. */
  2649. public boolean hasMajor() {
  2650. return ((bitField0_ & 0x00000001) == 0x00000001);
  2651. }
  2652. /**
  2653. * <code>required int32 major = 1;</code>
  2654. */
  2655. public int getMajor() {
  2656. return major_;
  2657. }
  2658. // optional int32 minor = 2 [default = 0];
  2659. public static final int MINOR_FIELD_NUMBER = 2;
  2660. private int minor_;
  2661. /**
  2662. * <code>optional int32 minor = 2 [default = 0];</code>
  2663. */
  2664. public boolean hasMinor() {
  2665. return ((bitField0_ & 0x00000002) == 0x00000002);
  2666. }
  2667. /**
  2668. * <code>optional int32 minor = 2 [default = 0];</code>
  2669. */
  2670. public int getMinor() {
  2671. return minor_;
  2672. }
  2673. // optional bytes previous_channel_contract_hash = 3;
  2674. public static final int PREVIOUS_CHANNEL_CONTRACT_HASH_FIELD_NUMBER = 3;
  2675. private com.google.protobuf.ByteString previousChannelContractHash_;
  2676. /**
  2677. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  2678. *
  2679. * <pre>
  2680. * The hash of the multisig contract of a previous channel. This indicates that the primary
  2681. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  2682. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  2683. * follows SERVER_VERSION with an Initiate representing a new channel
  2684. * </pre>
  2685. */
  2686. public boolean hasPreviousChannelContractHash() {
  2687. return ((bitField0_ & 0x00000004) == 0x00000004);
  2688. }
  2689. /**
  2690. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  2691. *
  2692. * <pre>
  2693. * The hash of the multisig contract of a previous channel. This indicates that the primary
  2694. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  2695. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  2696. * follows SERVER_VERSION with an Initiate representing a new channel
  2697. * </pre>
  2698. */
  2699. public com.google.protobuf.ByteString getPreviousChannelContractHash() {
  2700. return previousChannelContractHash_;
  2701. }
  2702. private void initFields() {
  2703. major_ = 0;
  2704. minor_ = 0;
  2705. previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY;
  2706. }
  2707. private byte memoizedIsInitialized = -1;
  2708. public final boolean isInitialized() {
  2709. byte isInitialized = memoizedIsInitialized;
  2710. if (isInitialized != -1) return isInitialized == 1;
  2711. if (!hasMajor()) {
  2712. memoizedIsInitialized = 0;
  2713. return false;
  2714. }
  2715. memoizedIsInitialized = 1;
  2716. return true;
  2717. }
  2718. public void writeTo(com.google.protobuf.CodedOutputStream output)
  2719. throws java.io.IOException {
  2720. getSerializedSize();
  2721. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  2722. output.writeInt32(1, major_);
  2723. }
  2724. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  2725. output.writeInt32(2, minor_);
  2726. }
  2727. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  2728. output.writeBytes(3, previousChannelContractHash_);
  2729. }
  2730. getUnknownFields().writeTo(output);
  2731. }
  2732. private int memoizedSerializedSize = -1;
  2733. public int getSerializedSize() {
  2734. int size = memoizedSerializedSize;
  2735. if (size != -1) return size;
  2736. size = 0;
  2737. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  2738. size += com.google.protobuf.CodedOutputStream
  2739. .computeInt32Size(1, major_);
  2740. }
  2741. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  2742. size += com.google.protobuf.CodedOutputStream
  2743. .computeInt32Size(2, minor_);
  2744. }
  2745. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  2746. size += com.google.protobuf.CodedOutputStream
  2747. .computeBytesSize(3, previousChannelContractHash_);
  2748. }
  2749. size += getUnknownFields().getSerializedSize();
  2750. memoizedSerializedSize = size;
  2751. return size;
  2752. }
  2753. private static final long serialVersionUID = 0L;
  2754. @java.lang.Override
  2755. protected java.lang.Object writeReplace()
  2756. throws java.io.ObjectStreamException {
  2757. return super.writeReplace();
  2758. }
  2759. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(
  2760. com.google.protobuf.ByteString data)
  2761. throws com.google.protobuf.InvalidProtocolBufferException {
  2762. return PARSER.parseFrom(data);
  2763. }
  2764. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(
  2765. com.google.protobuf.ByteString data,
  2766. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2767. throws com.google.protobuf.InvalidProtocolBufferException {
  2768. return PARSER.parseFrom(data, extensionRegistry);
  2769. }
  2770. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(byte[] data)
  2771. throws com.google.protobuf.InvalidProtocolBufferException {
  2772. return PARSER.parseFrom(data);
  2773. }
  2774. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(
  2775. byte[] data,
  2776. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2777. throws com.google.protobuf.InvalidProtocolBufferException {
  2778. return PARSER.parseFrom(data, extensionRegistry);
  2779. }
  2780. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(java.io.InputStream input)
  2781. throws java.io.IOException {
  2782. return PARSER.parseFrom(input);
  2783. }
  2784. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(
  2785. java.io.InputStream input,
  2786. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2787. throws java.io.IOException {
  2788. return PARSER.parseFrom(input, extensionRegistry);
  2789. }
  2790. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom(java.io.InputStream input)
  2791. throws java.io.IOException {
  2792. return PARSER.parseDelimitedFrom(input);
  2793. }
  2794. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseDelimitedFrom(
  2795. java.io.InputStream input,
  2796. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2797. throws java.io.IOException {
  2798. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  2799. }
  2800. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(
  2801. com.google.protobuf.CodedInputStream input)
  2802. throws java.io.IOException {
  2803. return PARSER.parseFrom(input);
  2804. }
  2805. public static org.bitcoin.paymentchannel.Protos.ClientVersion parseFrom(
  2806. com.google.protobuf.CodedInputStream input,
  2807. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2808. throws java.io.IOException {
  2809. return PARSER.parseFrom(input, extensionRegistry);
  2810. }
  2811. public static Builder newBuilder() { return Builder.create(); }
  2812. public Builder newBuilderForType() { return newBuilder(); }
  2813. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ClientVersion prototype) {
  2814. return newBuilder().mergeFrom(prototype);
  2815. }
  2816. public Builder toBuilder() { return newBuilder(this); }
  2817. @java.lang.Override
  2818. protected Builder newBuilderForType(
  2819. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  2820. Builder builder = new Builder(parent);
  2821. return builder;
  2822. }
  2823. /**
  2824. * Protobuf type {@code paymentchannels.ClientVersion}
  2825. *
  2826. * <pre>
  2827. * Sent by primary to secondary on opening the connection. If anything is received before this is
  2828. * sent, the socket is closed.
  2829. * </pre>
  2830. */
  2831. public static final class Builder extends
  2832. com.google.protobuf.GeneratedMessage.Builder<Builder>
  2833. implements org.bitcoin.paymentchannel.Protos.ClientVersionOrBuilder {
  2834. public static final com.google.protobuf.Descriptors.Descriptor
  2835. getDescriptor() {
  2836. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor;
  2837. }
  2838. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  2839. internalGetFieldAccessorTable() {
  2840. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_fieldAccessorTable
  2841. .ensureFieldAccessorsInitialized(
  2842. org.bitcoin.paymentchannel.Protos.ClientVersion.class, org.bitcoin.paymentchannel.Protos.ClientVersion.Builder.class);
  2843. }
  2844. // Construct using org.bitcoin.paymentchannel.Protos.ClientVersion.newBuilder()
  2845. private Builder() {
  2846. maybeForceBuilderInitialization();
  2847. }
  2848. private Builder(
  2849. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  2850. super(parent);
  2851. maybeForceBuilderInitialization();
  2852. }
  2853. private void maybeForceBuilderInitialization() {
  2854. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  2855. }
  2856. }
  2857. private static Builder create() {
  2858. return new Builder();
  2859. }
  2860. public Builder clear() {
  2861. super.clear();
  2862. major_ = 0;
  2863. bitField0_ = (bitField0_ & ~0x00000001);
  2864. minor_ = 0;
  2865. bitField0_ = (bitField0_ & ~0x00000002);
  2866. previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY;
  2867. bitField0_ = (bitField0_ & ~0x00000004);
  2868. return this;
  2869. }
  2870. public Builder clone() {
  2871. return create().mergeFrom(buildPartial());
  2872. }
  2873. public com.google.protobuf.Descriptors.Descriptor
  2874. getDescriptorForType() {
  2875. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ClientVersion_descriptor;
  2876. }
  2877. public org.bitcoin.paymentchannel.Protos.ClientVersion getDefaultInstanceForType() {
  2878. return org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance();
  2879. }
  2880. public org.bitcoin.paymentchannel.Protos.ClientVersion build() {
  2881. org.bitcoin.paymentchannel.Protos.ClientVersion result = buildPartial();
  2882. if (!result.isInitialized()) {
  2883. throw newUninitializedMessageException(result);
  2884. }
  2885. return result;
  2886. }
  2887. public org.bitcoin.paymentchannel.Protos.ClientVersion buildPartial() {
  2888. org.bitcoin.paymentchannel.Protos.ClientVersion result = new org.bitcoin.paymentchannel.Protos.ClientVersion(this);
  2889. int from_bitField0_ = bitField0_;
  2890. int to_bitField0_ = 0;
  2891. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  2892. to_bitField0_ |= 0x00000001;
  2893. }
  2894. result.major_ = major_;
  2895. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  2896. to_bitField0_ |= 0x00000002;
  2897. }
  2898. result.minor_ = minor_;
  2899. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  2900. to_bitField0_ |= 0x00000004;
  2901. }
  2902. result.previousChannelContractHash_ = previousChannelContractHash_;
  2903. result.bitField0_ = to_bitField0_;
  2904. onBuilt();
  2905. return result;
  2906. }
  2907. public Builder mergeFrom(com.google.protobuf.Message other) {
  2908. if (other instanceof org.bitcoin.paymentchannel.Protos.ClientVersion) {
  2909. return mergeFrom((org.bitcoin.paymentchannel.Protos.ClientVersion)other);
  2910. } else {
  2911. super.mergeFrom(other);
  2912. return this;
  2913. }
  2914. }
  2915. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ClientVersion other) {
  2916. if (other == org.bitcoin.paymentchannel.Protos.ClientVersion.getDefaultInstance()) return this;
  2917. if (other.hasMajor()) {
  2918. setMajor(other.getMajor());
  2919. }
  2920. if (other.hasMinor()) {
  2921. setMinor(other.getMinor());
  2922. }
  2923. if (other.hasPreviousChannelContractHash()) {
  2924. setPreviousChannelContractHash(other.getPreviousChannelContractHash());
  2925. }
  2926. this.mergeUnknownFields(other.getUnknownFields());
  2927. return this;
  2928. }
  2929. public final boolean isInitialized() {
  2930. if (!hasMajor()) {
  2931. return false;
  2932. }
  2933. return true;
  2934. }
  2935. public Builder mergeFrom(
  2936. com.google.protobuf.CodedInputStream input,
  2937. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  2938. throws java.io.IOException {
  2939. org.bitcoin.paymentchannel.Protos.ClientVersion parsedMessage = null;
  2940. try {
  2941. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  2942. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  2943. parsedMessage = (org.bitcoin.paymentchannel.Protos.ClientVersion) e.getUnfinishedMessage();
  2944. throw e;
  2945. } finally {
  2946. if (parsedMessage != null) {
  2947. mergeFrom(parsedMessage);
  2948. }
  2949. }
  2950. return this;
  2951. }
  2952. private int bitField0_;
  2953. // required int32 major = 1;
  2954. private int major_ ;
  2955. /**
  2956. * <code>required int32 major = 1;</code>
  2957. */
  2958. public boolean hasMajor() {
  2959. return ((bitField0_ & 0x00000001) == 0x00000001);
  2960. }
  2961. /**
  2962. * <code>required int32 major = 1;</code>
  2963. */
  2964. public int getMajor() {
  2965. return major_;
  2966. }
  2967. /**
  2968. * <code>required int32 major = 1;</code>
  2969. */
  2970. public Builder setMajor(int value) {
  2971. bitField0_ |= 0x00000001;
  2972. major_ = value;
  2973. onChanged();
  2974. return this;
  2975. }
  2976. /**
  2977. * <code>required int32 major = 1;</code>
  2978. */
  2979. public Builder clearMajor() {
  2980. bitField0_ = (bitField0_ & ~0x00000001);
  2981. major_ = 0;
  2982. onChanged();
  2983. return this;
  2984. }
  2985. // optional int32 minor = 2 [default = 0];
  2986. private int minor_ ;
  2987. /**
  2988. * <code>optional int32 minor = 2 [default = 0];</code>
  2989. */
  2990. public boolean hasMinor() {
  2991. return ((bitField0_ & 0x00000002) == 0x00000002);
  2992. }
  2993. /**
  2994. * <code>optional int32 minor = 2 [default = 0];</code>
  2995. */
  2996. public int getMinor() {
  2997. return minor_;
  2998. }
  2999. /**
  3000. * <code>optional int32 minor = 2 [default = 0];</code>
  3001. */
  3002. public Builder setMinor(int value) {
  3003. bitField0_ |= 0x00000002;
  3004. minor_ = value;
  3005. onChanged();
  3006. return this;
  3007. }
  3008. /**
  3009. * <code>optional int32 minor = 2 [default = 0];</code>
  3010. */
  3011. public Builder clearMinor() {
  3012. bitField0_ = (bitField0_ & ~0x00000002);
  3013. minor_ = 0;
  3014. onChanged();
  3015. return this;
  3016. }
  3017. // optional bytes previous_channel_contract_hash = 3;
  3018. private com.google.protobuf.ByteString previousChannelContractHash_ = com.google.protobuf.ByteString.EMPTY;
  3019. /**
  3020. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  3021. *
  3022. * <pre>
  3023. * The hash of the multisig contract of a previous channel. This indicates that the primary
  3024. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  3025. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  3026. * follows SERVER_VERSION with an Initiate representing a new channel
  3027. * </pre>
  3028. */
  3029. public boolean hasPreviousChannelContractHash() {
  3030. return ((bitField0_ & 0x00000004) == 0x00000004);
  3031. }
  3032. /**
  3033. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  3034. *
  3035. * <pre>
  3036. * The hash of the multisig contract of a previous channel. This indicates that the primary
  3037. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  3038. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  3039. * follows SERVER_VERSION with an Initiate representing a new channel
  3040. * </pre>
  3041. */
  3042. public com.google.protobuf.ByteString getPreviousChannelContractHash() {
  3043. return previousChannelContractHash_;
  3044. }
  3045. /**
  3046. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  3047. *
  3048. * <pre>
  3049. * The hash of the multisig contract of a previous channel. This indicates that the primary
  3050. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  3051. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  3052. * follows SERVER_VERSION with an Initiate representing a new channel
  3053. * </pre>
  3054. */
  3055. public Builder setPreviousChannelContractHash(com.google.protobuf.ByteString value) {
  3056. if (value == null) {
  3057. throw new NullPointerException();
  3058. }
  3059. bitField0_ |= 0x00000004;
  3060. previousChannelContractHash_ = value;
  3061. onChanged();
  3062. return this;
  3063. }
  3064. /**
  3065. * <code>optional bytes previous_channel_contract_hash = 3;</code>
  3066. *
  3067. * <pre>
  3068. * The hash of the multisig contract of a previous channel. This indicates that the primary
  3069. * wishes to reopen the given channel. If the server is willing to reopen it, it simply
  3070. * responds with a SERVER_VERSION and then immediately sends a CHANNEL_OPEN, it otherwise
  3071. * follows SERVER_VERSION with an Initiate representing a new channel
  3072. * </pre>
  3073. */
  3074. public Builder clearPreviousChannelContractHash() {
  3075. bitField0_ = (bitField0_ & ~0x00000004);
  3076. previousChannelContractHash_ = getDefaultInstance().getPreviousChannelContractHash();
  3077. onChanged();
  3078. return this;
  3079. }
  3080. // @@protoc_insertion_point(builder_scope:paymentchannels.ClientVersion)
  3081. }
  3082. static {
  3083. defaultInstance = new ClientVersion(true);
  3084. defaultInstance.initFields();
  3085. }
  3086. // @@protoc_insertion_point(class_scope:paymentchannels.ClientVersion)
  3087. }
  3088. public interface ServerVersionOrBuilder
  3089. extends com.google.protobuf.MessageOrBuilder {
  3090. // required int32 major = 1;
  3091. /**
  3092. * <code>required int32 major = 1;</code>
  3093. */
  3094. boolean hasMajor();
  3095. /**
  3096. * <code>required int32 major = 1;</code>
  3097. */
  3098. int getMajor();
  3099. // optional int32 minor = 2 [default = 0];
  3100. /**
  3101. * <code>optional int32 minor = 2 [default = 0];</code>
  3102. */
  3103. boolean hasMinor();
  3104. /**
  3105. * <code>optional int32 minor = 2 [default = 0];</code>
  3106. */
  3107. int getMinor();
  3108. }
  3109. /**
  3110. * Protobuf type {@code paymentchannels.ServerVersion}
  3111. *
  3112. * <pre>
  3113. * Send by secondary to primary upon receiving the ClientVersion message. If it is willing to
  3114. * speak the given major version, it sends back the same major version and the minor version it
  3115. * speaks. If it is not, it may send back a lower major version representing the highest version
  3116. * it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a
  3117. * lower major version, the secondary should either expect to continue with that version, or
  3118. * should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards
  3119. * incompatible changes to the protocol bump the major version. Extensions bump the minor version
  3120. * </pre>
  3121. */
  3122. public static final class ServerVersion extends
  3123. com.google.protobuf.GeneratedMessage
  3124. implements ServerVersionOrBuilder {
  3125. // Use ServerVersion.newBuilder() to construct.
  3126. private ServerVersion(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  3127. super(builder);
  3128. this.unknownFields = builder.getUnknownFields();
  3129. }
  3130. private ServerVersion(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  3131. private static final ServerVersion defaultInstance;
  3132. public static ServerVersion getDefaultInstance() {
  3133. return defaultInstance;
  3134. }
  3135. public ServerVersion getDefaultInstanceForType() {
  3136. return defaultInstance;
  3137. }
  3138. private final com.google.protobuf.UnknownFieldSet unknownFields;
  3139. @java.lang.Override
  3140. public final com.google.protobuf.UnknownFieldSet
  3141. getUnknownFields() {
  3142. return this.unknownFields;
  3143. }
  3144. private ServerVersion(
  3145. com.google.protobuf.CodedInputStream input,
  3146. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3147. throws com.google.protobuf.InvalidProtocolBufferException {
  3148. initFields();
  3149. int mutable_bitField0_ = 0;
  3150. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  3151. com.google.protobuf.UnknownFieldSet.newBuilder();
  3152. try {
  3153. boolean done = false;
  3154. while (!done) {
  3155. int tag = input.readTag();
  3156. switch (tag) {
  3157. case 0:
  3158. done = true;
  3159. break;
  3160. default: {
  3161. if (!parseUnknownField(input, unknownFields,
  3162. extensionRegistry, tag)) {
  3163. done = true;
  3164. }
  3165. break;
  3166. }
  3167. case 8: {
  3168. bitField0_ |= 0x00000001;
  3169. major_ = input.readInt32();
  3170. break;
  3171. }
  3172. case 16: {
  3173. bitField0_ |= 0x00000002;
  3174. minor_ = input.readInt32();
  3175. break;
  3176. }
  3177. }
  3178. }
  3179. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  3180. throw e.setUnfinishedMessage(this);
  3181. } catch (java.io.IOException e) {
  3182. throw new com.google.protobuf.InvalidProtocolBufferException(
  3183. e.getMessage()).setUnfinishedMessage(this);
  3184. } finally {
  3185. this.unknownFields = unknownFields.build();
  3186. makeExtensionsImmutable();
  3187. }
  3188. }
  3189. public static final com.google.protobuf.Descriptors.Descriptor
  3190. getDescriptor() {
  3191. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor;
  3192. }
  3193. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  3194. internalGetFieldAccessorTable() {
  3195. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable
  3196. .ensureFieldAccessorsInitialized(
  3197. org.bitcoin.paymentchannel.Protos.ServerVersion.class, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class);
  3198. }
  3199. public static com.google.protobuf.Parser<ServerVersion> PARSER =
  3200. new com.google.protobuf.AbstractParser<ServerVersion>() {
  3201. public ServerVersion parsePartialFrom(
  3202. com.google.protobuf.CodedInputStream input,
  3203. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3204. throws com.google.protobuf.InvalidProtocolBufferException {
  3205. return new ServerVersion(input, extensionRegistry);
  3206. }
  3207. };
  3208. @java.lang.Override
  3209. public com.google.protobuf.Parser<ServerVersion> getParserForType() {
  3210. return PARSER;
  3211. }
  3212. private int bitField0_;
  3213. // required int32 major = 1;
  3214. public static final int MAJOR_FIELD_NUMBER = 1;
  3215. private int major_;
  3216. /**
  3217. * <code>required int32 major = 1;</code>
  3218. */
  3219. public boolean hasMajor() {
  3220. return ((bitField0_ & 0x00000001) == 0x00000001);
  3221. }
  3222. /**
  3223. * <code>required int32 major = 1;</code>
  3224. */
  3225. public int getMajor() {
  3226. return major_;
  3227. }
  3228. // optional int32 minor = 2 [default = 0];
  3229. public static final int MINOR_FIELD_NUMBER = 2;
  3230. private int minor_;
  3231. /**
  3232. * <code>optional int32 minor = 2 [default = 0];</code>
  3233. */
  3234. public boolean hasMinor() {
  3235. return ((bitField0_ & 0x00000002) == 0x00000002);
  3236. }
  3237. /**
  3238. * <code>optional int32 minor = 2 [default = 0];</code>
  3239. */
  3240. public int getMinor() {
  3241. return minor_;
  3242. }
  3243. private void initFields() {
  3244. major_ = 0;
  3245. minor_ = 0;
  3246. }
  3247. private byte memoizedIsInitialized = -1;
  3248. public final boolean isInitialized() {
  3249. byte isInitialized = memoizedIsInitialized;
  3250. if (isInitialized != -1) return isInitialized == 1;
  3251. if (!hasMajor()) {
  3252. memoizedIsInitialized = 0;
  3253. return false;
  3254. }
  3255. memoizedIsInitialized = 1;
  3256. return true;
  3257. }
  3258. public void writeTo(com.google.protobuf.CodedOutputStream output)
  3259. throws java.io.IOException {
  3260. getSerializedSize();
  3261. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  3262. output.writeInt32(1, major_);
  3263. }
  3264. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  3265. output.writeInt32(2, minor_);
  3266. }
  3267. getUnknownFields().writeTo(output);
  3268. }
  3269. private int memoizedSerializedSize = -1;
  3270. public int getSerializedSize() {
  3271. int size = memoizedSerializedSize;
  3272. if (size != -1) return size;
  3273. size = 0;
  3274. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  3275. size += com.google.protobuf.CodedOutputStream
  3276. .computeInt32Size(1, major_);
  3277. }
  3278. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  3279. size += com.google.protobuf.CodedOutputStream
  3280. .computeInt32Size(2, minor_);
  3281. }
  3282. size += getUnknownFields().getSerializedSize();
  3283. memoizedSerializedSize = size;
  3284. return size;
  3285. }
  3286. private static final long serialVersionUID = 0L;
  3287. @java.lang.Override
  3288. protected java.lang.Object writeReplace()
  3289. throws java.io.ObjectStreamException {
  3290. return super.writeReplace();
  3291. }
  3292. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(
  3293. com.google.protobuf.ByteString data)
  3294. throws com.google.protobuf.InvalidProtocolBufferException {
  3295. return PARSER.parseFrom(data);
  3296. }
  3297. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(
  3298. com.google.protobuf.ByteString data,
  3299. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3300. throws com.google.protobuf.InvalidProtocolBufferException {
  3301. return PARSER.parseFrom(data, extensionRegistry);
  3302. }
  3303. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(byte[] data)
  3304. throws com.google.protobuf.InvalidProtocolBufferException {
  3305. return PARSER.parseFrom(data);
  3306. }
  3307. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(
  3308. byte[] data,
  3309. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3310. throws com.google.protobuf.InvalidProtocolBufferException {
  3311. return PARSER.parseFrom(data, extensionRegistry);
  3312. }
  3313. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(java.io.InputStream input)
  3314. throws java.io.IOException {
  3315. return PARSER.parseFrom(input);
  3316. }
  3317. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(
  3318. java.io.InputStream input,
  3319. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3320. throws java.io.IOException {
  3321. return PARSER.parseFrom(input, extensionRegistry);
  3322. }
  3323. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseDelimitedFrom(java.io.InputStream input)
  3324. throws java.io.IOException {
  3325. return PARSER.parseDelimitedFrom(input);
  3326. }
  3327. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseDelimitedFrom(
  3328. java.io.InputStream input,
  3329. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3330. throws java.io.IOException {
  3331. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  3332. }
  3333. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(
  3334. com.google.protobuf.CodedInputStream input)
  3335. throws java.io.IOException {
  3336. return PARSER.parseFrom(input);
  3337. }
  3338. public static org.bitcoin.paymentchannel.Protos.ServerVersion parseFrom(
  3339. com.google.protobuf.CodedInputStream input,
  3340. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3341. throws java.io.IOException {
  3342. return PARSER.parseFrom(input, extensionRegistry);
  3343. }
  3344. public static Builder newBuilder() { return Builder.create(); }
  3345. public Builder newBuilderForType() { return newBuilder(); }
  3346. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ServerVersion prototype) {
  3347. return newBuilder().mergeFrom(prototype);
  3348. }
  3349. public Builder toBuilder() { return newBuilder(this); }
  3350. @java.lang.Override
  3351. protected Builder newBuilderForType(
  3352. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  3353. Builder builder = new Builder(parent);
  3354. return builder;
  3355. }
  3356. /**
  3357. * Protobuf type {@code paymentchannels.ServerVersion}
  3358. *
  3359. * <pre>
  3360. * Send by secondary to primary upon receiving the ClientVersion message. If it is willing to
  3361. * speak the given major version, it sends back the same major version and the minor version it
  3362. * speaks. If it is not, it may send back a lower major version representing the highest version
  3363. * it is willing to speak, or sends a NO_ACCEPTABLE_VERSION Error. If the secondary sends back a
  3364. * lower major version, the secondary should either expect to continue with that version, or
  3365. * should immediately close the connection with a NO_ACCEPTABLE_VERSION Error. Backwards
  3366. * incompatible changes to the protocol bump the major version. Extensions bump the minor version
  3367. * </pre>
  3368. */
  3369. public static final class Builder extends
  3370. com.google.protobuf.GeneratedMessage.Builder<Builder>
  3371. implements org.bitcoin.paymentchannel.Protos.ServerVersionOrBuilder {
  3372. public static final com.google.protobuf.Descriptors.Descriptor
  3373. getDescriptor() {
  3374. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor;
  3375. }
  3376. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  3377. internalGetFieldAccessorTable() {
  3378. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_fieldAccessorTable
  3379. .ensureFieldAccessorsInitialized(
  3380. org.bitcoin.paymentchannel.Protos.ServerVersion.class, org.bitcoin.paymentchannel.Protos.ServerVersion.Builder.class);
  3381. }
  3382. // Construct using org.bitcoin.paymentchannel.Protos.ServerVersion.newBuilder()
  3383. private Builder() {
  3384. maybeForceBuilderInitialization();
  3385. }
  3386. private Builder(
  3387. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  3388. super(parent);
  3389. maybeForceBuilderInitialization();
  3390. }
  3391. private void maybeForceBuilderInitialization() {
  3392. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  3393. }
  3394. }
  3395. private static Builder create() {
  3396. return new Builder();
  3397. }
  3398. public Builder clear() {
  3399. super.clear();
  3400. major_ = 0;
  3401. bitField0_ = (bitField0_ & ~0x00000001);
  3402. minor_ = 0;
  3403. bitField0_ = (bitField0_ & ~0x00000002);
  3404. return this;
  3405. }
  3406. public Builder clone() {
  3407. return create().mergeFrom(buildPartial());
  3408. }
  3409. public com.google.protobuf.Descriptors.Descriptor
  3410. getDescriptorForType() {
  3411. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ServerVersion_descriptor;
  3412. }
  3413. public org.bitcoin.paymentchannel.Protos.ServerVersion getDefaultInstanceForType() {
  3414. return org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance();
  3415. }
  3416. public org.bitcoin.paymentchannel.Protos.ServerVersion build() {
  3417. org.bitcoin.paymentchannel.Protos.ServerVersion result = buildPartial();
  3418. if (!result.isInitialized()) {
  3419. throw newUninitializedMessageException(result);
  3420. }
  3421. return result;
  3422. }
  3423. public org.bitcoin.paymentchannel.Protos.ServerVersion buildPartial() {
  3424. org.bitcoin.paymentchannel.Protos.ServerVersion result = new org.bitcoin.paymentchannel.Protos.ServerVersion(this);
  3425. int from_bitField0_ = bitField0_;
  3426. int to_bitField0_ = 0;
  3427. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  3428. to_bitField0_ |= 0x00000001;
  3429. }
  3430. result.major_ = major_;
  3431. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  3432. to_bitField0_ |= 0x00000002;
  3433. }
  3434. result.minor_ = minor_;
  3435. result.bitField0_ = to_bitField0_;
  3436. onBuilt();
  3437. return result;
  3438. }
  3439. public Builder mergeFrom(com.google.protobuf.Message other) {
  3440. if (other instanceof org.bitcoin.paymentchannel.Protos.ServerVersion) {
  3441. return mergeFrom((org.bitcoin.paymentchannel.Protos.ServerVersion)other);
  3442. } else {
  3443. super.mergeFrom(other);
  3444. return this;
  3445. }
  3446. }
  3447. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ServerVersion other) {
  3448. if (other == org.bitcoin.paymentchannel.Protos.ServerVersion.getDefaultInstance()) return this;
  3449. if (other.hasMajor()) {
  3450. setMajor(other.getMajor());
  3451. }
  3452. if (other.hasMinor()) {
  3453. setMinor(other.getMinor());
  3454. }
  3455. this.mergeUnknownFields(other.getUnknownFields());
  3456. return this;
  3457. }
  3458. public final boolean isInitialized() {
  3459. if (!hasMajor()) {
  3460. return false;
  3461. }
  3462. return true;
  3463. }
  3464. public Builder mergeFrom(
  3465. com.google.protobuf.CodedInputStream input,
  3466. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3467. throws java.io.IOException {
  3468. org.bitcoin.paymentchannel.Protos.ServerVersion parsedMessage = null;
  3469. try {
  3470. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  3471. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  3472. parsedMessage = (org.bitcoin.paymentchannel.Protos.ServerVersion) e.getUnfinishedMessage();
  3473. throw e;
  3474. } finally {
  3475. if (parsedMessage != null) {
  3476. mergeFrom(parsedMessage);
  3477. }
  3478. }
  3479. return this;
  3480. }
  3481. private int bitField0_;
  3482. // required int32 major = 1;
  3483. private int major_ ;
  3484. /**
  3485. * <code>required int32 major = 1;</code>
  3486. */
  3487. public boolean hasMajor() {
  3488. return ((bitField0_ & 0x00000001) == 0x00000001);
  3489. }
  3490. /**
  3491. * <code>required int32 major = 1;</code>
  3492. */
  3493. public int getMajor() {
  3494. return major_;
  3495. }
  3496. /**
  3497. * <code>required int32 major = 1;</code>
  3498. */
  3499. public Builder setMajor(int value) {
  3500. bitField0_ |= 0x00000001;
  3501. major_ = value;
  3502. onChanged();
  3503. return this;
  3504. }
  3505. /**
  3506. * <code>required int32 major = 1;</code>
  3507. */
  3508. public Builder clearMajor() {
  3509. bitField0_ = (bitField0_ & ~0x00000001);
  3510. major_ = 0;
  3511. onChanged();
  3512. return this;
  3513. }
  3514. // optional int32 minor = 2 [default = 0];
  3515. private int minor_ ;
  3516. /**
  3517. * <code>optional int32 minor = 2 [default = 0];</code>
  3518. */
  3519. public boolean hasMinor() {
  3520. return ((bitField0_ & 0x00000002) == 0x00000002);
  3521. }
  3522. /**
  3523. * <code>optional int32 minor = 2 [default = 0];</code>
  3524. */
  3525. public int getMinor() {
  3526. return minor_;
  3527. }
  3528. /**
  3529. * <code>optional int32 minor = 2 [default = 0];</code>
  3530. */
  3531. public Builder setMinor(int value) {
  3532. bitField0_ |= 0x00000002;
  3533. minor_ = value;
  3534. onChanged();
  3535. return this;
  3536. }
  3537. /**
  3538. * <code>optional int32 minor = 2 [default = 0];</code>
  3539. */
  3540. public Builder clearMinor() {
  3541. bitField0_ = (bitField0_ & ~0x00000002);
  3542. minor_ = 0;
  3543. onChanged();
  3544. return this;
  3545. }
  3546. // @@protoc_insertion_point(builder_scope:paymentchannels.ServerVersion)
  3547. }
  3548. static {
  3549. defaultInstance = new ServerVersion(true);
  3550. defaultInstance.initFields();
  3551. }
  3552. // @@protoc_insertion_point(class_scope:paymentchannels.ServerVersion)
  3553. }
  3554. public interface InitiateOrBuilder
  3555. extends com.google.protobuf.MessageOrBuilder {
  3556. // required bytes multisig_key = 1;
  3557. /**
  3558. * <code>required bytes multisig_key = 1;</code>
  3559. *
  3560. * <pre>
  3561. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  3562. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  3563. * created entirely by the secondary
  3564. * </pre>
  3565. */
  3566. boolean hasMultisigKey();
  3567. /**
  3568. * <code>required bytes multisig_key = 1;</code>
  3569. *
  3570. * <pre>
  3571. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  3572. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  3573. * created entirely by the secondary
  3574. * </pre>
  3575. */
  3576. com.google.protobuf.ByteString getMultisigKey();
  3577. // required uint64 min_accepted_channel_size = 2;
  3578. /**
  3579. * <code>required uint64 min_accepted_channel_size = 2;</code>
  3580. *
  3581. * <pre>
  3582. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  3583. * size it's willing to accept here. This can be lower to trade off resources against
  3584. * security but shouldn't be so low the transactions get rejected by the network as spam.
  3585. * Zero isn't a sensible value to have here, so we make the field required.
  3586. * </pre>
  3587. */
  3588. boolean hasMinAcceptedChannelSize();
  3589. /**
  3590. * <code>required uint64 min_accepted_channel_size = 2;</code>
  3591. *
  3592. * <pre>
  3593. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  3594. * size it's willing to accept here. This can be lower to trade off resources against
  3595. * security but shouldn't be so low the transactions get rejected by the network as spam.
  3596. * Zero isn't a sensible value to have here, so we make the field required.
  3597. * </pre>
  3598. */
  3599. long getMinAcceptedChannelSize();
  3600. // required uint64 expire_time_secs = 3;
  3601. /**
  3602. * <code>required uint64 expire_time_secs = 3;</code>
  3603. *
  3604. * <pre>
  3605. * Rough UNIX time for when the channel expires. This is determined by the block header
  3606. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  3607. * Channels could also be specified in terms of block heights but then how do you know the
  3608. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  3609. * attack vectors. We can assume primary has an independent clock, however. If primary
  3610. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  3611. * channel.
  3612. * </pre>
  3613. */
  3614. boolean hasExpireTimeSecs();
  3615. /**
  3616. * <code>required uint64 expire_time_secs = 3;</code>
  3617. *
  3618. * <pre>
  3619. * Rough UNIX time for when the channel expires. This is determined by the block header
  3620. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  3621. * Channels could also be specified in terms of block heights but then how do you know the
  3622. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  3623. * attack vectors. We can assume primary has an independent clock, however. If primary
  3624. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  3625. * channel.
  3626. * </pre>
  3627. */
  3628. long getExpireTimeSecs();
  3629. }
  3630. /**
  3631. * Protobuf type {@code paymentchannels.Initiate}
  3632. *
  3633. * <pre>
  3634. * Sent from secondary to primary once version nego is done.
  3635. * </pre>
  3636. */
  3637. public static final class Initiate extends
  3638. com.google.protobuf.GeneratedMessage
  3639. implements InitiateOrBuilder {
  3640. // Use Initiate.newBuilder() to construct.
  3641. private Initiate(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  3642. super(builder);
  3643. this.unknownFields = builder.getUnknownFields();
  3644. }
  3645. private Initiate(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  3646. private static final Initiate defaultInstance;
  3647. public static Initiate getDefaultInstance() {
  3648. return defaultInstance;
  3649. }
  3650. public Initiate getDefaultInstanceForType() {
  3651. return defaultInstance;
  3652. }
  3653. private final com.google.protobuf.UnknownFieldSet unknownFields;
  3654. @java.lang.Override
  3655. public final com.google.protobuf.UnknownFieldSet
  3656. getUnknownFields() {
  3657. return this.unknownFields;
  3658. }
  3659. private Initiate(
  3660. com.google.protobuf.CodedInputStream input,
  3661. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3662. throws com.google.protobuf.InvalidProtocolBufferException {
  3663. initFields();
  3664. int mutable_bitField0_ = 0;
  3665. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  3666. com.google.protobuf.UnknownFieldSet.newBuilder();
  3667. try {
  3668. boolean done = false;
  3669. while (!done) {
  3670. int tag = input.readTag();
  3671. switch (tag) {
  3672. case 0:
  3673. done = true;
  3674. break;
  3675. default: {
  3676. if (!parseUnknownField(input, unknownFields,
  3677. extensionRegistry, tag)) {
  3678. done = true;
  3679. }
  3680. break;
  3681. }
  3682. case 10: {
  3683. bitField0_ |= 0x00000001;
  3684. multisigKey_ = input.readBytes();
  3685. break;
  3686. }
  3687. case 16: {
  3688. bitField0_ |= 0x00000002;
  3689. minAcceptedChannelSize_ = input.readUInt64();
  3690. break;
  3691. }
  3692. case 24: {
  3693. bitField0_ |= 0x00000004;
  3694. expireTimeSecs_ = input.readUInt64();
  3695. break;
  3696. }
  3697. }
  3698. }
  3699. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  3700. throw e.setUnfinishedMessage(this);
  3701. } catch (java.io.IOException e) {
  3702. throw new com.google.protobuf.InvalidProtocolBufferException(
  3703. e.getMessage()).setUnfinishedMessage(this);
  3704. } finally {
  3705. this.unknownFields = unknownFields.build();
  3706. makeExtensionsImmutable();
  3707. }
  3708. }
  3709. public static final com.google.protobuf.Descriptors.Descriptor
  3710. getDescriptor() {
  3711. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor;
  3712. }
  3713. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  3714. internalGetFieldAccessorTable() {
  3715. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable
  3716. .ensureFieldAccessorsInitialized(
  3717. org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class);
  3718. }
  3719. public static com.google.protobuf.Parser<Initiate> PARSER =
  3720. new com.google.protobuf.AbstractParser<Initiate>() {
  3721. public Initiate parsePartialFrom(
  3722. com.google.protobuf.CodedInputStream input,
  3723. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3724. throws com.google.protobuf.InvalidProtocolBufferException {
  3725. return new Initiate(input, extensionRegistry);
  3726. }
  3727. };
  3728. @java.lang.Override
  3729. public com.google.protobuf.Parser<Initiate> getParserForType() {
  3730. return PARSER;
  3731. }
  3732. private int bitField0_;
  3733. // required bytes multisig_key = 1;
  3734. public static final int MULTISIG_KEY_FIELD_NUMBER = 1;
  3735. private com.google.protobuf.ByteString multisigKey_;
  3736. /**
  3737. * <code>required bytes multisig_key = 1;</code>
  3738. *
  3739. * <pre>
  3740. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  3741. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  3742. * created entirely by the secondary
  3743. * </pre>
  3744. */
  3745. public boolean hasMultisigKey() {
  3746. return ((bitField0_ & 0x00000001) == 0x00000001);
  3747. }
  3748. /**
  3749. * <code>required bytes multisig_key = 1;</code>
  3750. *
  3751. * <pre>
  3752. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  3753. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  3754. * created entirely by the secondary
  3755. * </pre>
  3756. */
  3757. public com.google.protobuf.ByteString getMultisigKey() {
  3758. return multisigKey_;
  3759. }
  3760. // required uint64 min_accepted_channel_size = 2;
  3761. public static final int MIN_ACCEPTED_CHANNEL_SIZE_FIELD_NUMBER = 2;
  3762. private long minAcceptedChannelSize_;
  3763. /**
  3764. * <code>required uint64 min_accepted_channel_size = 2;</code>
  3765. *
  3766. * <pre>
  3767. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  3768. * size it's willing to accept here. This can be lower to trade off resources against
  3769. * security but shouldn't be so low the transactions get rejected by the network as spam.
  3770. * Zero isn't a sensible value to have here, so we make the field required.
  3771. * </pre>
  3772. */
  3773. public boolean hasMinAcceptedChannelSize() {
  3774. return ((bitField0_ & 0x00000002) == 0x00000002);
  3775. }
  3776. /**
  3777. * <code>required uint64 min_accepted_channel_size = 2;</code>
  3778. *
  3779. * <pre>
  3780. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  3781. * size it's willing to accept here. This can be lower to trade off resources against
  3782. * security but shouldn't be so low the transactions get rejected by the network as spam.
  3783. * Zero isn't a sensible value to have here, so we make the field required.
  3784. * </pre>
  3785. */
  3786. public long getMinAcceptedChannelSize() {
  3787. return minAcceptedChannelSize_;
  3788. }
  3789. // required uint64 expire_time_secs = 3;
  3790. public static final int EXPIRE_TIME_SECS_FIELD_NUMBER = 3;
  3791. private long expireTimeSecs_;
  3792. /**
  3793. * <code>required uint64 expire_time_secs = 3;</code>
  3794. *
  3795. * <pre>
  3796. * Rough UNIX time for when the channel expires. This is determined by the block header
  3797. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  3798. * Channels could also be specified in terms of block heights but then how do you know the
  3799. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  3800. * attack vectors. We can assume primary has an independent clock, however. If primary
  3801. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  3802. * channel.
  3803. * </pre>
  3804. */
  3805. public boolean hasExpireTimeSecs() {
  3806. return ((bitField0_ & 0x00000004) == 0x00000004);
  3807. }
  3808. /**
  3809. * <code>required uint64 expire_time_secs = 3;</code>
  3810. *
  3811. * <pre>
  3812. * Rough UNIX time for when the channel expires. This is determined by the block header
  3813. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  3814. * Channels could also be specified in terms of block heights but then how do you know the
  3815. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  3816. * attack vectors. We can assume primary has an independent clock, however. If primary
  3817. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  3818. * channel.
  3819. * </pre>
  3820. */
  3821. public long getExpireTimeSecs() {
  3822. return expireTimeSecs_;
  3823. }
  3824. private void initFields() {
  3825. multisigKey_ = com.google.protobuf.ByteString.EMPTY;
  3826. minAcceptedChannelSize_ = 0L;
  3827. expireTimeSecs_ = 0L;
  3828. }
  3829. private byte memoizedIsInitialized = -1;
  3830. public final boolean isInitialized() {
  3831. byte isInitialized = memoizedIsInitialized;
  3832. if (isInitialized != -1) return isInitialized == 1;
  3833. if (!hasMultisigKey()) {
  3834. memoizedIsInitialized = 0;
  3835. return false;
  3836. }
  3837. if (!hasMinAcceptedChannelSize()) {
  3838. memoizedIsInitialized = 0;
  3839. return false;
  3840. }
  3841. if (!hasExpireTimeSecs()) {
  3842. memoizedIsInitialized = 0;
  3843. return false;
  3844. }
  3845. memoizedIsInitialized = 1;
  3846. return true;
  3847. }
  3848. public void writeTo(com.google.protobuf.CodedOutputStream output)
  3849. throws java.io.IOException {
  3850. getSerializedSize();
  3851. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  3852. output.writeBytes(1, multisigKey_);
  3853. }
  3854. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  3855. output.writeUInt64(2, minAcceptedChannelSize_);
  3856. }
  3857. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  3858. output.writeUInt64(3, expireTimeSecs_);
  3859. }
  3860. getUnknownFields().writeTo(output);
  3861. }
  3862. private int memoizedSerializedSize = -1;
  3863. public int getSerializedSize() {
  3864. int size = memoizedSerializedSize;
  3865. if (size != -1) return size;
  3866. size = 0;
  3867. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  3868. size += com.google.protobuf.CodedOutputStream
  3869. .computeBytesSize(1, multisigKey_);
  3870. }
  3871. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  3872. size += com.google.protobuf.CodedOutputStream
  3873. .computeUInt64Size(2, minAcceptedChannelSize_);
  3874. }
  3875. if (((bitField0_ & 0x00000004) == 0x00000004)) {
  3876. size += com.google.protobuf.CodedOutputStream
  3877. .computeUInt64Size(3, expireTimeSecs_);
  3878. }
  3879. size += getUnknownFields().getSerializedSize();
  3880. memoizedSerializedSize = size;
  3881. return size;
  3882. }
  3883. private static final long serialVersionUID = 0L;
  3884. @java.lang.Override
  3885. protected java.lang.Object writeReplace()
  3886. throws java.io.ObjectStreamException {
  3887. return super.writeReplace();
  3888. }
  3889. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
  3890. com.google.protobuf.ByteString data)
  3891. throws com.google.protobuf.InvalidProtocolBufferException {
  3892. return PARSER.parseFrom(data);
  3893. }
  3894. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
  3895. com.google.protobuf.ByteString data,
  3896. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3897. throws com.google.protobuf.InvalidProtocolBufferException {
  3898. return PARSER.parseFrom(data, extensionRegistry);
  3899. }
  3900. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(byte[] data)
  3901. throws com.google.protobuf.InvalidProtocolBufferException {
  3902. return PARSER.parseFrom(data);
  3903. }
  3904. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
  3905. byte[] data,
  3906. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3907. throws com.google.protobuf.InvalidProtocolBufferException {
  3908. return PARSER.parseFrom(data, extensionRegistry);
  3909. }
  3910. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(java.io.InputStream input)
  3911. throws java.io.IOException {
  3912. return PARSER.parseFrom(input);
  3913. }
  3914. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
  3915. java.io.InputStream input,
  3916. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3917. throws java.io.IOException {
  3918. return PARSER.parseFrom(input, extensionRegistry);
  3919. }
  3920. public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(java.io.InputStream input)
  3921. throws java.io.IOException {
  3922. return PARSER.parseDelimitedFrom(input);
  3923. }
  3924. public static org.bitcoin.paymentchannel.Protos.Initiate parseDelimitedFrom(
  3925. java.io.InputStream input,
  3926. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3927. throws java.io.IOException {
  3928. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  3929. }
  3930. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
  3931. com.google.protobuf.CodedInputStream input)
  3932. throws java.io.IOException {
  3933. return PARSER.parseFrom(input);
  3934. }
  3935. public static org.bitcoin.paymentchannel.Protos.Initiate parseFrom(
  3936. com.google.protobuf.CodedInputStream input,
  3937. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  3938. throws java.io.IOException {
  3939. return PARSER.parseFrom(input, extensionRegistry);
  3940. }
  3941. public static Builder newBuilder() { return Builder.create(); }
  3942. public Builder newBuilderForType() { return newBuilder(); }
  3943. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Initiate prototype) {
  3944. return newBuilder().mergeFrom(prototype);
  3945. }
  3946. public Builder toBuilder() { return newBuilder(this); }
  3947. @java.lang.Override
  3948. protected Builder newBuilderForType(
  3949. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  3950. Builder builder = new Builder(parent);
  3951. return builder;
  3952. }
  3953. /**
  3954. * Protobuf type {@code paymentchannels.Initiate}
  3955. *
  3956. * <pre>
  3957. * Sent from secondary to primary once version nego is done.
  3958. * </pre>
  3959. */
  3960. public static final class Builder extends
  3961. com.google.protobuf.GeneratedMessage.Builder<Builder>
  3962. implements org.bitcoin.paymentchannel.Protos.InitiateOrBuilder {
  3963. public static final com.google.protobuf.Descriptors.Descriptor
  3964. getDescriptor() {
  3965. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor;
  3966. }
  3967. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  3968. internalGetFieldAccessorTable() {
  3969. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_fieldAccessorTable
  3970. .ensureFieldAccessorsInitialized(
  3971. org.bitcoin.paymentchannel.Protos.Initiate.class, org.bitcoin.paymentchannel.Protos.Initiate.Builder.class);
  3972. }
  3973. // Construct using org.bitcoin.paymentchannel.Protos.Initiate.newBuilder()
  3974. private Builder() {
  3975. maybeForceBuilderInitialization();
  3976. }
  3977. private Builder(
  3978. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  3979. super(parent);
  3980. maybeForceBuilderInitialization();
  3981. }
  3982. private void maybeForceBuilderInitialization() {
  3983. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  3984. }
  3985. }
  3986. private static Builder create() {
  3987. return new Builder();
  3988. }
  3989. public Builder clear() {
  3990. super.clear();
  3991. multisigKey_ = com.google.protobuf.ByteString.EMPTY;
  3992. bitField0_ = (bitField0_ & ~0x00000001);
  3993. minAcceptedChannelSize_ = 0L;
  3994. bitField0_ = (bitField0_ & ~0x00000002);
  3995. expireTimeSecs_ = 0L;
  3996. bitField0_ = (bitField0_ & ~0x00000004);
  3997. return this;
  3998. }
  3999. public Builder clone() {
  4000. return create().mergeFrom(buildPartial());
  4001. }
  4002. public com.google.protobuf.Descriptors.Descriptor
  4003. getDescriptorForType() {
  4004. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Initiate_descriptor;
  4005. }
  4006. public org.bitcoin.paymentchannel.Protos.Initiate getDefaultInstanceForType() {
  4007. return org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance();
  4008. }
  4009. public org.bitcoin.paymentchannel.Protos.Initiate build() {
  4010. org.bitcoin.paymentchannel.Protos.Initiate result = buildPartial();
  4011. if (!result.isInitialized()) {
  4012. throw newUninitializedMessageException(result);
  4013. }
  4014. return result;
  4015. }
  4016. public org.bitcoin.paymentchannel.Protos.Initiate buildPartial() {
  4017. org.bitcoin.paymentchannel.Protos.Initiate result = new org.bitcoin.paymentchannel.Protos.Initiate(this);
  4018. int from_bitField0_ = bitField0_;
  4019. int to_bitField0_ = 0;
  4020. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  4021. to_bitField0_ |= 0x00000001;
  4022. }
  4023. result.multisigKey_ = multisigKey_;
  4024. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  4025. to_bitField0_ |= 0x00000002;
  4026. }
  4027. result.minAcceptedChannelSize_ = minAcceptedChannelSize_;
  4028. if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
  4029. to_bitField0_ |= 0x00000004;
  4030. }
  4031. result.expireTimeSecs_ = expireTimeSecs_;
  4032. result.bitField0_ = to_bitField0_;
  4033. onBuilt();
  4034. return result;
  4035. }
  4036. public Builder mergeFrom(com.google.protobuf.Message other) {
  4037. if (other instanceof org.bitcoin.paymentchannel.Protos.Initiate) {
  4038. return mergeFrom((org.bitcoin.paymentchannel.Protos.Initiate)other);
  4039. } else {
  4040. super.mergeFrom(other);
  4041. return this;
  4042. }
  4043. }
  4044. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Initiate other) {
  4045. if (other == org.bitcoin.paymentchannel.Protos.Initiate.getDefaultInstance()) return this;
  4046. if (other.hasMultisigKey()) {
  4047. setMultisigKey(other.getMultisigKey());
  4048. }
  4049. if (other.hasMinAcceptedChannelSize()) {
  4050. setMinAcceptedChannelSize(other.getMinAcceptedChannelSize());
  4051. }
  4052. if (other.hasExpireTimeSecs()) {
  4053. setExpireTimeSecs(other.getExpireTimeSecs());
  4054. }
  4055. this.mergeUnknownFields(other.getUnknownFields());
  4056. return this;
  4057. }
  4058. public final boolean isInitialized() {
  4059. if (!hasMultisigKey()) {
  4060. return false;
  4061. }
  4062. if (!hasMinAcceptedChannelSize()) {
  4063. return false;
  4064. }
  4065. if (!hasExpireTimeSecs()) {
  4066. return false;
  4067. }
  4068. return true;
  4069. }
  4070. public Builder mergeFrom(
  4071. com.google.protobuf.CodedInputStream input,
  4072. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4073. throws java.io.IOException {
  4074. org.bitcoin.paymentchannel.Protos.Initiate parsedMessage = null;
  4075. try {
  4076. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  4077. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  4078. parsedMessage = (org.bitcoin.paymentchannel.Protos.Initiate) e.getUnfinishedMessage();
  4079. throw e;
  4080. } finally {
  4081. if (parsedMessage != null) {
  4082. mergeFrom(parsedMessage);
  4083. }
  4084. }
  4085. return this;
  4086. }
  4087. private int bitField0_;
  4088. // required bytes multisig_key = 1;
  4089. private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY;
  4090. /**
  4091. * <code>required bytes multisig_key = 1;</code>
  4092. *
  4093. * <pre>
  4094. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4095. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  4096. * created entirely by the secondary
  4097. * </pre>
  4098. */
  4099. public boolean hasMultisigKey() {
  4100. return ((bitField0_ & 0x00000001) == 0x00000001);
  4101. }
  4102. /**
  4103. * <code>required bytes multisig_key = 1;</code>
  4104. *
  4105. * <pre>
  4106. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4107. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  4108. * created entirely by the secondary
  4109. * </pre>
  4110. */
  4111. public com.google.protobuf.ByteString getMultisigKey() {
  4112. return multisigKey_;
  4113. }
  4114. /**
  4115. * <code>required bytes multisig_key = 1;</code>
  4116. *
  4117. * <pre>
  4118. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4119. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  4120. * created entirely by the secondary
  4121. * </pre>
  4122. */
  4123. public Builder setMultisigKey(com.google.protobuf.ByteString value) {
  4124. if (value == null) {
  4125. throw new NullPointerException();
  4126. }
  4127. bitField0_ |= 0x00000001;
  4128. multisigKey_ = value;
  4129. onChanged();
  4130. return this;
  4131. }
  4132. /**
  4133. * <code>required bytes multisig_key = 1;</code>
  4134. *
  4135. * <pre>
  4136. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4137. * are accepted. It is used only in the creation of the multisig contract, as outputs are
  4138. * created entirely by the secondary
  4139. * </pre>
  4140. */
  4141. public Builder clearMultisigKey() {
  4142. bitField0_ = (bitField0_ & ~0x00000001);
  4143. multisigKey_ = getDefaultInstance().getMultisigKey();
  4144. onChanged();
  4145. return this;
  4146. }
  4147. // required uint64 min_accepted_channel_size = 2;
  4148. private long minAcceptedChannelSize_ ;
  4149. /**
  4150. * <code>required uint64 min_accepted_channel_size = 2;</code>
  4151. *
  4152. * <pre>
  4153. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  4154. * size it's willing to accept here. This can be lower to trade off resources against
  4155. * security but shouldn't be so low the transactions get rejected by the network as spam.
  4156. * Zero isn't a sensible value to have here, so we make the field required.
  4157. * </pre>
  4158. */
  4159. public boolean hasMinAcceptedChannelSize() {
  4160. return ((bitField0_ & 0x00000002) == 0x00000002);
  4161. }
  4162. /**
  4163. * <code>required uint64 min_accepted_channel_size = 2;</code>
  4164. *
  4165. * <pre>
  4166. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  4167. * size it's willing to accept here. This can be lower to trade off resources against
  4168. * security but shouldn't be so low the transactions get rejected by the network as spam.
  4169. * Zero isn't a sensible value to have here, so we make the field required.
  4170. * </pre>
  4171. */
  4172. public long getMinAcceptedChannelSize() {
  4173. return minAcceptedChannelSize_;
  4174. }
  4175. /**
  4176. * <code>required uint64 min_accepted_channel_size = 2;</code>
  4177. *
  4178. * <pre>
  4179. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  4180. * size it's willing to accept here. This can be lower to trade off resources against
  4181. * security but shouldn't be so low the transactions get rejected by the network as spam.
  4182. * Zero isn't a sensible value to have here, so we make the field required.
  4183. * </pre>
  4184. */
  4185. public Builder setMinAcceptedChannelSize(long value) {
  4186. bitField0_ |= 0x00000002;
  4187. minAcceptedChannelSize_ = value;
  4188. onChanged();
  4189. return this;
  4190. }
  4191. /**
  4192. * <code>required uint64 min_accepted_channel_size = 2;</code>
  4193. *
  4194. * <pre>
  4195. * Once a channel is exhausted a new one must be set up. So secondary indicates the minimum
  4196. * size it's willing to accept here. This can be lower to trade off resources against
  4197. * security but shouldn't be so low the transactions get rejected by the network as spam.
  4198. * Zero isn't a sensible value to have here, so we make the field required.
  4199. * </pre>
  4200. */
  4201. public Builder clearMinAcceptedChannelSize() {
  4202. bitField0_ = (bitField0_ & ~0x00000002);
  4203. minAcceptedChannelSize_ = 0L;
  4204. onChanged();
  4205. return this;
  4206. }
  4207. // required uint64 expire_time_secs = 3;
  4208. private long expireTimeSecs_ ;
  4209. /**
  4210. * <code>required uint64 expire_time_secs = 3;</code>
  4211. *
  4212. * <pre>
  4213. * Rough UNIX time for when the channel expires. This is determined by the block header
  4214. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  4215. * Channels could also be specified in terms of block heights but then how do you know the
  4216. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  4217. * attack vectors. We can assume primary has an independent clock, however. If primary
  4218. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  4219. * channel.
  4220. * </pre>
  4221. */
  4222. public boolean hasExpireTimeSecs() {
  4223. return ((bitField0_ & 0x00000004) == 0x00000004);
  4224. }
  4225. /**
  4226. * <code>required uint64 expire_time_secs = 3;</code>
  4227. *
  4228. * <pre>
  4229. * Rough UNIX time for when the channel expires. This is determined by the block header
  4230. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  4231. * Channels could also be specified in terms of block heights but then how do you know the
  4232. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  4233. * attack vectors. We can assume primary has an independent clock, however. If primary
  4234. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  4235. * channel.
  4236. * </pre>
  4237. */
  4238. public long getExpireTimeSecs() {
  4239. return expireTimeSecs_;
  4240. }
  4241. /**
  4242. * <code>required uint64 expire_time_secs = 3;</code>
  4243. *
  4244. * <pre>
  4245. * Rough UNIX time for when the channel expires. This is determined by the block header
  4246. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  4247. * Channels could also be specified in terms of block heights but then how do you know the
  4248. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  4249. * attack vectors. We can assume primary has an independent clock, however. If primary
  4250. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  4251. * channel.
  4252. * </pre>
  4253. */
  4254. public Builder setExpireTimeSecs(long value) {
  4255. bitField0_ |= 0x00000004;
  4256. expireTimeSecs_ = value;
  4257. onChanged();
  4258. return this;
  4259. }
  4260. /**
  4261. * <code>required uint64 expire_time_secs = 3;</code>
  4262. *
  4263. * <pre>
  4264. * Rough UNIX time for when the channel expires. This is determined by the block header
  4265. * timestamps which can be very inaccurate when miners use the obsolete RollNTime hack.
  4266. * Channels could also be specified in terms of block heights but then how do you know the
  4267. * current chain height if you don't have internet access? Trust secondary? Probably opens up
  4268. * attack vectors. We can assume primary has an independent clock, however. If primary
  4269. * considers this value too far off (eg more than a day), it may send an ERROR and close the
  4270. * channel.
  4271. * </pre>
  4272. */
  4273. public Builder clearExpireTimeSecs() {
  4274. bitField0_ = (bitField0_ & ~0x00000004);
  4275. expireTimeSecs_ = 0L;
  4276. onChanged();
  4277. return this;
  4278. }
  4279. // @@protoc_insertion_point(builder_scope:paymentchannels.Initiate)
  4280. }
  4281. static {
  4282. defaultInstance = new Initiate(true);
  4283. defaultInstance.initFields();
  4284. }
  4285. // @@protoc_insertion_point(class_scope:paymentchannels.Initiate)
  4286. }
  4287. public interface ProvideRefundOrBuilder
  4288. extends com.google.protobuf.MessageOrBuilder {
  4289. // required bytes multisig_key = 1;
  4290. /**
  4291. * <code>required bytes multisig_key = 1;</code>
  4292. *
  4293. * <pre>
  4294. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4295. * are accepted. It is only used in the creation of the multisig contract.
  4296. * </pre>
  4297. */
  4298. boolean hasMultisigKey();
  4299. /**
  4300. * <code>required bytes multisig_key = 1;</code>
  4301. *
  4302. * <pre>
  4303. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4304. * are accepted. It is only used in the creation of the multisig contract.
  4305. * </pre>
  4306. */
  4307. com.google.protobuf.ByteString getMultisigKey();
  4308. // required bytes tx = 2;
  4309. /**
  4310. * <code>required bytes tx = 2;</code>
  4311. *
  4312. * <pre>
  4313. * The serialized bytes of the return transaction in Satoshi format.
  4314. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4315. * details of exactly what that output must look like). This output must have a sequence
  4316. * number of 0.
  4317. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4318. * Initiate message).
  4319. * * It must have exactly one output which goes back to the primary. This output's
  4320. * scriptPubKey will be reused to create payment transactions.
  4321. * </pre>
  4322. */
  4323. boolean hasTx();
  4324. /**
  4325. * <code>required bytes tx = 2;</code>
  4326. *
  4327. * <pre>
  4328. * The serialized bytes of the return transaction in Satoshi format.
  4329. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4330. * details of exactly what that output must look like). This output must have a sequence
  4331. * number of 0.
  4332. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4333. * Initiate message).
  4334. * * It must have exactly one output which goes back to the primary. This output's
  4335. * scriptPubKey will be reused to create payment transactions.
  4336. * </pre>
  4337. */
  4338. com.google.protobuf.ByteString getTx();
  4339. }
  4340. /**
  4341. * Protobuf type {@code paymentchannels.ProvideRefund}
  4342. *
  4343. * <pre>
  4344. * Sent from primary to secondary after Initiate to begin the refund transaction signing.
  4345. * </pre>
  4346. */
  4347. public static final class ProvideRefund extends
  4348. com.google.protobuf.GeneratedMessage
  4349. implements ProvideRefundOrBuilder {
  4350. // Use ProvideRefund.newBuilder() to construct.
  4351. private ProvideRefund(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  4352. super(builder);
  4353. this.unknownFields = builder.getUnknownFields();
  4354. }
  4355. private ProvideRefund(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  4356. private static final ProvideRefund defaultInstance;
  4357. public static ProvideRefund getDefaultInstance() {
  4358. return defaultInstance;
  4359. }
  4360. public ProvideRefund getDefaultInstanceForType() {
  4361. return defaultInstance;
  4362. }
  4363. private final com.google.protobuf.UnknownFieldSet unknownFields;
  4364. @java.lang.Override
  4365. public final com.google.protobuf.UnknownFieldSet
  4366. getUnknownFields() {
  4367. return this.unknownFields;
  4368. }
  4369. private ProvideRefund(
  4370. com.google.protobuf.CodedInputStream input,
  4371. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4372. throws com.google.protobuf.InvalidProtocolBufferException {
  4373. initFields();
  4374. int mutable_bitField0_ = 0;
  4375. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  4376. com.google.protobuf.UnknownFieldSet.newBuilder();
  4377. try {
  4378. boolean done = false;
  4379. while (!done) {
  4380. int tag = input.readTag();
  4381. switch (tag) {
  4382. case 0:
  4383. done = true;
  4384. break;
  4385. default: {
  4386. if (!parseUnknownField(input, unknownFields,
  4387. extensionRegistry, tag)) {
  4388. done = true;
  4389. }
  4390. break;
  4391. }
  4392. case 10: {
  4393. bitField0_ |= 0x00000001;
  4394. multisigKey_ = input.readBytes();
  4395. break;
  4396. }
  4397. case 18: {
  4398. bitField0_ |= 0x00000002;
  4399. tx_ = input.readBytes();
  4400. break;
  4401. }
  4402. }
  4403. }
  4404. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  4405. throw e.setUnfinishedMessage(this);
  4406. } catch (java.io.IOException e) {
  4407. throw new com.google.protobuf.InvalidProtocolBufferException(
  4408. e.getMessage()).setUnfinishedMessage(this);
  4409. } finally {
  4410. this.unknownFields = unknownFields.build();
  4411. makeExtensionsImmutable();
  4412. }
  4413. }
  4414. public static final com.google.protobuf.Descriptors.Descriptor
  4415. getDescriptor() {
  4416. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor;
  4417. }
  4418. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  4419. internalGetFieldAccessorTable() {
  4420. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable
  4421. .ensureFieldAccessorsInitialized(
  4422. org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class);
  4423. }
  4424. public static com.google.protobuf.Parser<ProvideRefund> PARSER =
  4425. new com.google.protobuf.AbstractParser<ProvideRefund>() {
  4426. public ProvideRefund parsePartialFrom(
  4427. com.google.protobuf.CodedInputStream input,
  4428. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4429. throws com.google.protobuf.InvalidProtocolBufferException {
  4430. return new ProvideRefund(input, extensionRegistry);
  4431. }
  4432. };
  4433. @java.lang.Override
  4434. public com.google.protobuf.Parser<ProvideRefund> getParserForType() {
  4435. return PARSER;
  4436. }
  4437. private int bitField0_;
  4438. // required bytes multisig_key = 1;
  4439. public static final int MULTISIG_KEY_FIELD_NUMBER = 1;
  4440. private com.google.protobuf.ByteString multisigKey_;
  4441. /**
  4442. * <code>required bytes multisig_key = 1;</code>
  4443. *
  4444. * <pre>
  4445. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4446. * are accepted. It is only used in the creation of the multisig contract.
  4447. * </pre>
  4448. */
  4449. public boolean hasMultisigKey() {
  4450. return ((bitField0_ & 0x00000001) == 0x00000001);
  4451. }
  4452. /**
  4453. * <code>required bytes multisig_key = 1;</code>
  4454. *
  4455. * <pre>
  4456. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4457. * are accepted. It is only used in the creation of the multisig contract.
  4458. * </pre>
  4459. */
  4460. public com.google.protobuf.ByteString getMultisigKey() {
  4461. return multisigKey_;
  4462. }
  4463. // required bytes tx = 2;
  4464. public static final int TX_FIELD_NUMBER = 2;
  4465. private com.google.protobuf.ByteString tx_;
  4466. /**
  4467. * <code>required bytes tx = 2;</code>
  4468. *
  4469. * <pre>
  4470. * The serialized bytes of the return transaction in Satoshi format.
  4471. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4472. * details of exactly what that output must look like). This output must have a sequence
  4473. * number of 0.
  4474. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4475. * Initiate message).
  4476. * * It must have exactly one output which goes back to the primary. This output's
  4477. * scriptPubKey will be reused to create payment transactions.
  4478. * </pre>
  4479. */
  4480. public boolean hasTx() {
  4481. return ((bitField0_ & 0x00000002) == 0x00000002);
  4482. }
  4483. /**
  4484. * <code>required bytes tx = 2;</code>
  4485. *
  4486. * <pre>
  4487. * The serialized bytes of the return transaction in Satoshi format.
  4488. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4489. * details of exactly what that output must look like). This output must have a sequence
  4490. * number of 0.
  4491. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4492. * Initiate message).
  4493. * * It must have exactly one output which goes back to the primary. This output's
  4494. * scriptPubKey will be reused to create payment transactions.
  4495. * </pre>
  4496. */
  4497. public com.google.protobuf.ByteString getTx() {
  4498. return tx_;
  4499. }
  4500. private void initFields() {
  4501. multisigKey_ = com.google.protobuf.ByteString.EMPTY;
  4502. tx_ = com.google.protobuf.ByteString.EMPTY;
  4503. }
  4504. private byte memoizedIsInitialized = -1;
  4505. public final boolean isInitialized() {
  4506. byte isInitialized = memoizedIsInitialized;
  4507. if (isInitialized != -1) return isInitialized == 1;
  4508. if (!hasMultisigKey()) {
  4509. memoizedIsInitialized = 0;
  4510. return false;
  4511. }
  4512. if (!hasTx()) {
  4513. memoizedIsInitialized = 0;
  4514. return false;
  4515. }
  4516. memoizedIsInitialized = 1;
  4517. return true;
  4518. }
  4519. public void writeTo(com.google.protobuf.CodedOutputStream output)
  4520. throws java.io.IOException {
  4521. getSerializedSize();
  4522. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  4523. output.writeBytes(1, multisigKey_);
  4524. }
  4525. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  4526. output.writeBytes(2, tx_);
  4527. }
  4528. getUnknownFields().writeTo(output);
  4529. }
  4530. private int memoizedSerializedSize = -1;
  4531. public int getSerializedSize() {
  4532. int size = memoizedSerializedSize;
  4533. if (size != -1) return size;
  4534. size = 0;
  4535. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  4536. size += com.google.protobuf.CodedOutputStream
  4537. .computeBytesSize(1, multisigKey_);
  4538. }
  4539. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  4540. size += com.google.protobuf.CodedOutputStream
  4541. .computeBytesSize(2, tx_);
  4542. }
  4543. size += getUnknownFields().getSerializedSize();
  4544. memoizedSerializedSize = size;
  4545. return size;
  4546. }
  4547. private static final long serialVersionUID = 0L;
  4548. @java.lang.Override
  4549. protected java.lang.Object writeReplace()
  4550. throws java.io.ObjectStreamException {
  4551. return super.writeReplace();
  4552. }
  4553. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
  4554. com.google.protobuf.ByteString data)
  4555. throws com.google.protobuf.InvalidProtocolBufferException {
  4556. return PARSER.parseFrom(data);
  4557. }
  4558. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
  4559. com.google.protobuf.ByteString data,
  4560. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4561. throws com.google.protobuf.InvalidProtocolBufferException {
  4562. return PARSER.parseFrom(data, extensionRegistry);
  4563. }
  4564. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(byte[] data)
  4565. throws com.google.protobuf.InvalidProtocolBufferException {
  4566. return PARSER.parseFrom(data);
  4567. }
  4568. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
  4569. byte[] data,
  4570. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4571. throws com.google.protobuf.InvalidProtocolBufferException {
  4572. return PARSER.parseFrom(data, extensionRegistry);
  4573. }
  4574. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(java.io.InputStream input)
  4575. throws java.io.IOException {
  4576. return PARSER.parseFrom(input);
  4577. }
  4578. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
  4579. java.io.InputStream input,
  4580. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4581. throws java.io.IOException {
  4582. return PARSER.parseFrom(input, extensionRegistry);
  4583. }
  4584. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom(java.io.InputStream input)
  4585. throws java.io.IOException {
  4586. return PARSER.parseDelimitedFrom(input);
  4587. }
  4588. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseDelimitedFrom(
  4589. java.io.InputStream input,
  4590. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4591. throws java.io.IOException {
  4592. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  4593. }
  4594. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
  4595. com.google.protobuf.CodedInputStream input)
  4596. throws java.io.IOException {
  4597. return PARSER.parseFrom(input);
  4598. }
  4599. public static org.bitcoin.paymentchannel.Protos.ProvideRefund parseFrom(
  4600. com.google.protobuf.CodedInputStream input,
  4601. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4602. throws java.io.IOException {
  4603. return PARSER.parseFrom(input, extensionRegistry);
  4604. }
  4605. public static Builder newBuilder() { return Builder.create(); }
  4606. public Builder newBuilderForType() { return newBuilder(); }
  4607. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideRefund prototype) {
  4608. return newBuilder().mergeFrom(prototype);
  4609. }
  4610. public Builder toBuilder() { return newBuilder(this); }
  4611. @java.lang.Override
  4612. protected Builder newBuilderForType(
  4613. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  4614. Builder builder = new Builder(parent);
  4615. return builder;
  4616. }
  4617. /**
  4618. * Protobuf type {@code paymentchannels.ProvideRefund}
  4619. *
  4620. * <pre>
  4621. * Sent from primary to secondary after Initiate to begin the refund transaction signing.
  4622. * </pre>
  4623. */
  4624. public static final class Builder extends
  4625. com.google.protobuf.GeneratedMessage.Builder<Builder>
  4626. implements org.bitcoin.paymentchannel.Protos.ProvideRefundOrBuilder {
  4627. public static final com.google.protobuf.Descriptors.Descriptor
  4628. getDescriptor() {
  4629. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor;
  4630. }
  4631. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  4632. internalGetFieldAccessorTable() {
  4633. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_fieldAccessorTable
  4634. .ensureFieldAccessorsInitialized(
  4635. org.bitcoin.paymentchannel.Protos.ProvideRefund.class, org.bitcoin.paymentchannel.Protos.ProvideRefund.Builder.class);
  4636. }
  4637. // Construct using org.bitcoin.paymentchannel.Protos.ProvideRefund.newBuilder()
  4638. private Builder() {
  4639. maybeForceBuilderInitialization();
  4640. }
  4641. private Builder(
  4642. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  4643. super(parent);
  4644. maybeForceBuilderInitialization();
  4645. }
  4646. private void maybeForceBuilderInitialization() {
  4647. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  4648. }
  4649. }
  4650. private static Builder create() {
  4651. return new Builder();
  4652. }
  4653. public Builder clear() {
  4654. super.clear();
  4655. multisigKey_ = com.google.protobuf.ByteString.EMPTY;
  4656. bitField0_ = (bitField0_ & ~0x00000001);
  4657. tx_ = com.google.protobuf.ByteString.EMPTY;
  4658. bitField0_ = (bitField0_ & ~0x00000002);
  4659. return this;
  4660. }
  4661. public Builder clone() {
  4662. return create().mergeFrom(buildPartial());
  4663. }
  4664. public com.google.protobuf.Descriptors.Descriptor
  4665. getDescriptorForType() {
  4666. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideRefund_descriptor;
  4667. }
  4668. public org.bitcoin.paymentchannel.Protos.ProvideRefund getDefaultInstanceForType() {
  4669. return org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance();
  4670. }
  4671. public org.bitcoin.paymentchannel.Protos.ProvideRefund build() {
  4672. org.bitcoin.paymentchannel.Protos.ProvideRefund result = buildPartial();
  4673. if (!result.isInitialized()) {
  4674. throw newUninitializedMessageException(result);
  4675. }
  4676. return result;
  4677. }
  4678. public org.bitcoin.paymentchannel.Protos.ProvideRefund buildPartial() {
  4679. org.bitcoin.paymentchannel.Protos.ProvideRefund result = new org.bitcoin.paymentchannel.Protos.ProvideRefund(this);
  4680. int from_bitField0_ = bitField0_;
  4681. int to_bitField0_ = 0;
  4682. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  4683. to_bitField0_ |= 0x00000001;
  4684. }
  4685. result.multisigKey_ = multisigKey_;
  4686. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  4687. to_bitField0_ |= 0x00000002;
  4688. }
  4689. result.tx_ = tx_;
  4690. result.bitField0_ = to_bitField0_;
  4691. onBuilt();
  4692. return result;
  4693. }
  4694. public Builder mergeFrom(com.google.protobuf.Message other) {
  4695. if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideRefund) {
  4696. return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideRefund)other);
  4697. } else {
  4698. super.mergeFrom(other);
  4699. return this;
  4700. }
  4701. }
  4702. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideRefund other) {
  4703. if (other == org.bitcoin.paymentchannel.Protos.ProvideRefund.getDefaultInstance()) return this;
  4704. if (other.hasMultisigKey()) {
  4705. setMultisigKey(other.getMultisigKey());
  4706. }
  4707. if (other.hasTx()) {
  4708. setTx(other.getTx());
  4709. }
  4710. this.mergeUnknownFields(other.getUnknownFields());
  4711. return this;
  4712. }
  4713. public final boolean isInitialized() {
  4714. if (!hasMultisigKey()) {
  4715. return false;
  4716. }
  4717. if (!hasTx()) {
  4718. return false;
  4719. }
  4720. return true;
  4721. }
  4722. public Builder mergeFrom(
  4723. com.google.protobuf.CodedInputStream input,
  4724. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4725. throws java.io.IOException {
  4726. org.bitcoin.paymentchannel.Protos.ProvideRefund parsedMessage = null;
  4727. try {
  4728. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  4729. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  4730. parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideRefund) e.getUnfinishedMessage();
  4731. throw e;
  4732. } finally {
  4733. if (parsedMessage != null) {
  4734. mergeFrom(parsedMessage);
  4735. }
  4736. }
  4737. return this;
  4738. }
  4739. private int bitField0_;
  4740. // required bytes multisig_key = 1;
  4741. private com.google.protobuf.ByteString multisigKey_ = com.google.protobuf.ByteString.EMPTY;
  4742. /**
  4743. * <code>required bytes multisig_key = 1;</code>
  4744. *
  4745. * <pre>
  4746. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4747. * are accepted. It is only used in the creation of the multisig contract.
  4748. * </pre>
  4749. */
  4750. public boolean hasMultisigKey() {
  4751. return ((bitField0_ & 0x00000001) == 0x00000001);
  4752. }
  4753. /**
  4754. * <code>required bytes multisig_key = 1;</code>
  4755. *
  4756. * <pre>
  4757. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4758. * are accepted. It is only used in the creation of the multisig contract.
  4759. * </pre>
  4760. */
  4761. public com.google.protobuf.ByteString getMultisigKey() {
  4762. return multisigKey_;
  4763. }
  4764. /**
  4765. * <code>required bytes multisig_key = 1;</code>
  4766. *
  4767. * <pre>
  4768. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4769. * are accepted. It is only used in the creation of the multisig contract.
  4770. * </pre>
  4771. */
  4772. public Builder setMultisigKey(com.google.protobuf.ByteString value) {
  4773. if (value == null) {
  4774. throw new NullPointerException();
  4775. }
  4776. bitField0_ |= 0x00000001;
  4777. multisigKey_ = value;
  4778. onChanged();
  4779. return this;
  4780. }
  4781. /**
  4782. * <code>required bytes multisig_key = 1;</code>
  4783. *
  4784. * <pre>
  4785. * This must be a raw pubkey in regular ECDSA form. Both compressed and non-compressed forms
  4786. * are accepted. It is only used in the creation of the multisig contract.
  4787. * </pre>
  4788. */
  4789. public Builder clearMultisigKey() {
  4790. bitField0_ = (bitField0_ & ~0x00000001);
  4791. multisigKey_ = getDefaultInstance().getMultisigKey();
  4792. onChanged();
  4793. return this;
  4794. }
  4795. // required bytes tx = 2;
  4796. private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY;
  4797. /**
  4798. * <code>required bytes tx = 2;</code>
  4799. *
  4800. * <pre>
  4801. * The serialized bytes of the return transaction in Satoshi format.
  4802. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4803. * details of exactly what that output must look like). This output must have a sequence
  4804. * number of 0.
  4805. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4806. * Initiate message).
  4807. * * It must have exactly one output which goes back to the primary. This output's
  4808. * scriptPubKey will be reused to create payment transactions.
  4809. * </pre>
  4810. */
  4811. public boolean hasTx() {
  4812. return ((bitField0_ & 0x00000002) == 0x00000002);
  4813. }
  4814. /**
  4815. * <code>required bytes tx = 2;</code>
  4816. *
  4817. * <pre>
  4818. * The serialized bytes of the return transaction in Satoshi format.
  4819. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4820. * details of exactly what that output must look like). This output must have a sequence
  4821. * number of 0.
  4822. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4823. * Initiate message).
  4824. * * It must have exactly one output which goes back to the primary. This output's
  4825. * scriptPubKey will be reused to create payment transactions.
  4826. * </pre>
  4827. */
  4828. public com.google.protobuf.ByteString getTx() {
  4829. return tx_;
  4830. }
  4831. /**
  4832. * <code>required bytes tx = 2;</code>
  4833. *
  4834. * <pre>
  4835. * The serialized bytes of the return transaction in Satoshi format.
  4836. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4837. * details of exactly what that output must look like). This output must have a sequence
  4838. * number of 0.
  4839. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4840. * Initiate message).
  4841. * * It must have exactly one output which goes back to the primary. This output's
  4842. * scriptPubKey will be reused to create payment transactions.
  4843. * </pre>
  4844. */
  4845. public Builder setTx(com.google.protobuf.ByteString value) {
  4846. if (value == null) {
  4847. throw new NullPointerException();
  4848. }
  4849. bitField0_ |= 0x00000002;
  4850. tx_ = value;
  4851. onChanged();
  4852. return this;
  4853. }
  4854. /**
  4855. * <code>required bytes tx = 2;</code>
  4856. *
  4857. * <pre>
  4858. * The serialized bytes of the return transaction in Satoshi format.
  4859. * * It must have exactly one input which spends the multisig output (see ProvideContract for
  4860. * details of exactly what that output must look like). This output must have a sequence
  4861. * number of 0.
  4862. * * It must have the lock time set to a time after the min_time_window_secs (from the
  4863. * Initiate message).
  4864. * * It must have exactly one output which goes back to the primary. This output's
  4865. * scriptPubKey will be reused to create payment transactions.
  4866. * </pre>
  4867. */
  4868. public Builder clearTx() {
  4869. bitField0_ = (bitField0_ & ~0x00000002);
  4870. tx_ = getDefaultInstance().getTx();
  4871. onChanged();
  4872. return this;
  4873. }
  4874. // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideRefund)
  4875. }
  4876. static {
  4877. defaultInstance = new ProvideRefund(true);
  4878. defaultInstance.initFields();
  4879. }
  4880. // @@protoc_insertion_point(class_scope:paymentchannels.ProvideRefund)
  4881. }
  4882. public interface ReturnRefundOrBuilder
  4883. extends com.google.protobuf.MessageOrBuilder {
  4884. // required bytes signature = 1;
  4885. /**
  4886. * <code>required bytes signature = 1;</code>
  4887. */
  4888. boolean hasSignature();
  4889. /**
  4890. * <code>required bytes signature = 1;</code>
  4891. */
  4892. com.google.protobuf.ByteString getSignature();
  4893. }
  4894. /**
  4895. * Protobuf type {@code paymentchannels.ReturnRefund}
  4896. *
  4897. * <pre>
  4898. * Sent from secondary to primary after it has done initial verification of the refund
  4899. * transaction. Contains the primary's signature which is required to spend the multisig contract
  4900. * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
  4901. * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
  4902. * input's sequence and transaction's nLockTime remain set.
  4903. * </pre>
  4904. */
  4905. public static final class ReturnRefund extends
  4906. com.google.protobuf.GeneratedMessage
  4907. implements ReturnRefundOrBuilder {
  4908. // Use ReturnRefund.newBuilder() to construct.
  4909. private ReturnRefund(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  4910. super(builder);
  4911. this.unknownFields = builder.getUnknownFields();
  4912. }
  4913. private ReturnRefund(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  4914. private static final ReturnRefund defaultInstance;
  4915. public static ReturnRefund getDefaultInstance() {
  4916. return defaultInstance;
  4917. }
  4918. public ReturnRefund getDefaultInstanceForType() {
  4919. return defaultInstance;
  4920. }
  4921. private final com.google.protobuf.UnknownFieldSet unknownFields;
  4922. @java.lang.Override
  4923. public final com.google.protobuf.UnknownFieldSet
  4924. getUnknownFields() {
  4925. return this.unknownFields;
  4926. }
  4927. private ReturnRefund(
  4928. com.google.protobuf.CodedInputStream input,
  4929. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4930. throws com.google.protobuf.InvalidProtocolBufferException {
  4931. initFields();
  4932. int mutable_bitField0_ = 0;
  4933. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  4934. com.google.protobuf.UnknownFieldSet.newBuilder();
  4935. try {
  4936. boolean done = false;
  4937. while (!done) {
  4938. int tag = input.readTag();
  4939. switch (tag) {
  4940. case 0:
  4941. done = true;
  4942. break;
  4943. default: {
  4944. if (!parseUnknownField(input, unknownFields,
  4945. extensionRegistry, tag)) {
  4946. done = true;
  4947. }
  4948. break;
  4949. }
  4950. case 10: {
  4951. bitField0_ |= 0x00000001;
  4952. signature_ = input.readBytes();
  4953. break;
  4954. }
  4955. }
  4956. }
  4957. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  4958. throw e.setUnfinishedMessage(this);
  4959. } catch (java.io.IOException e) {
  4960. throw new com.google.protobuf.InvalidProtocolBufferException(
  4961. e.getMessage()).setUnfinishedMessage(this);
  4962. } finally {
  4963. this.unknownFields = unknownFields.build();
  4964. makeExtensionsImmutable();
  4965. }
  4966. }
  4967. public static final com.google.protobuf.Descriptors.Descriptor
  4968. getDescriptor() {
  4969. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor;
  4970. }
  4971. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  4972. internalGetFieldAccessorTable() {
  4973. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable
  4974. .ensureFieldAccessorsInitialized(
  4975. org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class);
  4976. }
  4977. public static com.google.protobuf.Parser<ReturnRefund> PARSER =
  4978. new com.google.protobuf.AbstractParser<ReturnRefund>() {
  4979. public ReturnRefund parsePartialFrom(
  4980. com.google.protobuf.CodedInputStream input,
  4981. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  4982. throws com.google.protobuf.InvalidProtocolBufferException {
  4983. return new ReturnRefund(input, extensionRegistry);
  4984. }
  4985. };
  4986. @java.lang.Override
  4987. public com.google.protobuf.Parser<ReturnRefund> getParserForType() {
  4988. return PARSER;
  4989. }
  4990. private int bitField0_;
  4991. // required bytes signature = 1;
  4992. public static final int SIGNATURE_FIELD_NUMBER = 1;
  4993. private com.google.protobuf.ByteString signature_;
  4994. /**
  4995. * <code>required bytes signature = 1;</code>
  4996. */
  4997. public boolean hasSignature() {
  4998. return ((bitField0_ & 0x00000001) == 0x00000001);
  4999. }
  5000. /**
  5001. * <code>required bytes signature = 1;</code>
  5002. */
  5003. public com.google.protobuf.ByteString getSignature() {
  5004. return signature_;
  5005. }
  5006. private void initFields() {
  5007. signature_ = com.google.protobuf.ByteString.EMPTY;
  5008. }
  5009. private byte memoizedIsInitialized = -1;
  5010. public final boolean isInitialized() {
  5011. byte isInitialized = memoizedIsInitialized;
  5012. if (isInitialized != -1) return isInitialized == 1;
  5013. if (!hasSignature()) {
  5014. memoizedIsInitialized = 0;
  5015. return false;
  5016. }
  5017. memoizedIsInitialized = 1;
  5018. return true;
  5019. }
  5020. public void writeTo(com.google.protobuf.CodedOutputStream output)
  5021. throws java.io.IOException {
  5022. getSerializedSize();
  5023. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  5024. output.writeBytes(1, signature_);
  5025. }
  5026. getUnknownFields().writeTo(output);
  5027. }
  5028. private int memoizedSerializedSize = -1;
  5029. public int getSerializedSize() {
  5030. int size = memoizedSerializedSize;
  5031. if (size != -1) return size;
  5032. size = 0;
  5033. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  5034. size += com.google.protobuf.CodedOutputStream
  5035. .computeBytesSize(1, signature_);
  5036. }
  5037. size += getUnknownFields().getSerializedSize();
  5038. memoizedSerializedSize = size;
  5039. return size;
  5040. }
  5041. private static final long serialVersionUID = 0L;
  5042. @java.lang.Override
  5043. protected java.lang.Object writeReplace()
  5044. throws java.io.ObjectStreamException {
  5045. return super.writeReplace();
  5046. }
  5047. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
  5048. com.google.protobuf.ByteString data)
  5049. throws com.google.protobuf.InvalidProtocolBufferException {
  5050. return PARSER.parseFrom(data);
  5051. }
  5052. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
  5053. com.google.protobuf.ByteString data,
  5054. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5055. throws com.google.protobuf.InvalidProtocolBufferException {
  5056. return PARSER.parseFrom(data, extensionRegistry);
  5057. }
  5058. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(byte[] data)
  5059. throws com.google.protobuf.InvalidProtocolBufferException {
  5060. return PARSER.parseFrom(data);
  5061. }
  5062. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
  5063. byte[] data,
  5064. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5065. throws com.google.protobuf.InvalidProtocolBufferException {
  5066. return PARSER.parseFrom(data, extensionRegistry);
  5067. }
  5068. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(java.io.InputStream input)
  5069. throws java.io.IOException {
  5070. return PARSER.parseFrom(input);
  5071. }
  5072. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
  5073. java.io.InputStream input,
  5074. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5075. throws java.io.IOException {
  5076. return PARSER.parseFrom(input, extensionRegistry);
  5077. }
  5078. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom(java.io.InputStream input)
  5079. throws java.io.IOException {
  5080. return PARSER.parseDelimitedFrom(input);
  5081. }
  5082. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseDelimitedFrom(
  5083. java.io.InputStream input,
  5084. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5085. throws java.io.IOException {
  5086. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  5087. }
  5088. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
  5089. com.google.protobuf.CodedInputStream input)
  5090. throws java.io.IOException {
  5091. return PARSER.parseFrom(input);
  5092. }
  5093. public static org.bitcoin.paymentchannel.Protos.ReturnRefund parseFrom(
  5094. com.google.protobuf.CodedInputStream input,
  5095. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5096. throws java.io.IOException {
  5097. return PARSER.parseFrom(input, extensionRegistry);
  5098. }
  5099. public static Builder newBuilder() { return Builder.create(); }
  5100. public Builder newBuilderForType() { return newBuilder(); }
  5101. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ReturnRefund prototype) {
  5102. return newBuilder().mergeFrom(prototype);
  5103. }
  5104. public Builder toBuilder() { return newBuilder(this); }
  5105. @java.lang.Override
  5106. protected Builder newBuilderForType(
  5107. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  5108. Builder builder = new Builder(parent);
  5109. return builder;
  5110. }
  5111. /**
  5112. * Protobuf type {@code paymentchannels.ReturnRefund}
  5113. *
  5114. * <pre>
  5115. * Sent from secondary to primary after it has done initial verification of the refund
  5116. * transaction. Contains the primary's signature which is required to spend the multisig contract
  5117. * to the refund transaction. Must be signed using SIGHASH_NONE|SIGHASH_ANYONECANPAY (and include
  5118. * the postfix type byte) to allow the client to add any outputs/inputs it wants as long as the
  5119. * input's sequence and transaction's nLockTime remain set.
  5120. * </pre>
  5121. */
  5122. public static final class Builder extends
  5123. com.google.protobuf.GeneratedMessage.Builder<Builder>
  5124. implements org.bitcoin.paymentchannel.Protos.ReturnRefundOrBuilder {
  5125. public static final com.google.protobuf.Descriptors.Descriptor
  5126. getDescriptor() {
  5127. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor;
  5128. }
  5129. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  5130. internalGetFieldAccessorTable() {
  5131. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_fieldAccessorTable
  5132. .ensureFieldAccessorsInitialized(
  5133. org.bitcoin.paymentchannel.Protos.ReturnRefund.class, org.bitcoin.paymentchannel.Protos.ReturnRefund.Builder.class);
  5134. }
  5135. // Construct using org.bitcoin.paymentchannel.Protos.ReturnRefund.newBuilder()
  5136. private Builder() {
  5137. maybeForceBuilderInitialization();
  5138. }
  5139. private Builder(
  5140. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  5141. super(parent);
  5142. maybeForceBuilderInitialization();
  5143. }
  5144. private void maybeForceBuilderInitialization() {
  5145. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  5146. }
  5147. }
  5148. private static Builder create() {
  5149. return new Builder();
  5150. }
  5151. public Builder clear() {
  5152. super.clear();
  5153. signature_ = com.google.protobuf.ByteString.EMPTY;
  5154. bitField0_ = (bitField0_ & ~0x00000001);
  5155. return this;
  5156. }
  5157. public Builder clone() {
  5158. return create().mergeFrom(buildPartial());
  5159. }
  5160. public com.google.protobuf.Descriptors.Descriptor
  5161. getDescriptorForType() {
  5162. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ReturnRefund_descriptor;
  5163. }
  5164. public org.bitcoin.paymentchannel.Protos.ReturnRefund getDefaultInstanceForType() {
  5165. return org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance();
  5166. }
  5167. public org.bitcoin.paymentchannel.Protos.ReturnRefund build() {
  5168. org.bitcoin.paymentchannel.Protos.ReturnRefund result = buildPartial();
  5169. if (!result.isInitialized()) {
  5170. throw newUninitializedMessageException(result);
  5171. }
  5172. return result;
  5173. }
  5174. public org.bitcoin.paymentchannel.Protos.ReturnRefund buildPartial() {
  5175. org.bitcoin.paymentchannel.Protos.ReturnRefund result = new org.bitcoin.paymentchannel.Protos.ReturnRefund(this);
  5176. int from_bitField0_ = bitField0_;
  5177. int to_bitField0_ = 0;
  5178. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  5179. to_bitField0_ |= 0x00000001;
  5180. }
  5181. result.signature_ = signature_;
  5182. result.bitField0_ = to_bitField0_;
  5183. onBuilt();
  5184. return result;
  5185. }
  5186. public Builder mergeFrom(com.google.protobuf.Message other) {
  5187. if (other instanceof org.bitcoin.paymentchannel.Protos.ReturnRefund) {
  5188. return mergeFrom((org.bitcoin.paymentchannel.Protos.ReturnRefund)other);
  5189. } else {
  5190. super.mergeFrom(other);
  5191. return this;
  5192. }
  5193. }
  5194. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ReturnRefund other) {
  5195. if (other == org.bitcoin.paymentchannel.Protos.ReturnRefund.getDefaultInstance()) return this;
  5196. if (other.hasSignature()) {
  5197. setSignature(other.getSignature());
  5198. }
  5199. this.mergeUnknownFields(other.getUnknownFields());
  5200. return this;
  5201. }
  5202. public final boolean isInitialized() {
  5203. if (!hasSignature()) {
  5204. return false;
  5205. }
  5206. return true;
  5207. }
  5208. public Builder mergeFrom(
  5209. com.google.protobuf.CodedInputStream input,
  5210. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5211. throws java.io.IOException {
  5212. org.bitcoin.paymentchannel.Protos.ReturnRefund parsedMessage = null;
  5213. try {
  5214. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  5215. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  5216. parsedMessage = (org.bitcoin.paymentchannel.Protos.ReturnRefund) e.getUnfinishedMessage();
  5217. throw e;
  5218. } finally {
  5219. if (parsedMessage != null) {
  5220. mergeFrom(parsedMessage);
  5221. }
  5222. }
  5223. return this;
  5224. }
  5225. private int bitField0_;
  5226. // required bytes signature = 1;
  5227. private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY;
  5228. /**
  5229. * <code>required bytes signature = 1;</code>
  5230. */
  5231. public boolean hasSignature() {
  5232. return ((bitField0_ & 0x00000001) == 0x00000001);
  5233. }
  5234. /**
  5235. * <code>required bytes signature = 1;</code>
  5236. */
  5237. public com.google.protobuf.ByteString getSignature() {
  5238. return signature_;
  5239. }
  5240. /**
  5241. * <code>required bytes signature = 1;</code>
  5242. */
  5243. public Builder setSignature(com.google.protobuf.ByteString value) {
  5244. if (value == null) {
  5245. throw new NullPointerException();
  5246. }
  5247. bitField0_ |= 0x00000001;
  5248. signature_ = value;
  5249. onChanged();
  5250. return this;
  5251. }
  5252. /**
  5253. * <code>required bytes signature = 1;</code>
  5254. */
  5255. public Builder clearSignature() {
  5256. bitField0_ = (bitField0_ & ~0x00000001);
  5257. signature_ = getDefaultInstance().getSignature();
  5258. onChanged();
  5259. return this;
  5260. }
  5261. // @@protoc_insertion_point(builder_scope:paymentchannels.ReturnRefund)
  5262. }
  5263. static {
  5264. defaultInstance = new ReturnRefund(true);
  5265. defaultInstance.initFields();
  5266. }
  5267. // @@protoc_insertion_point(class_scope:paymentchannels.ReturnRefund)
  5268. }
  5269. public interface ProvideContractOrBuilder
  5270. extends com.google.protobuf.MessageOrBuilder {
  5271. // required bytes tx = 1;
  5272. /**
  5273. * <code>required bytes tx = 1;</code>
  5274. *
  5275. * <pre>
  5276. * The serialized bytes of the transaction in Satoshi format.
  5277. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5278. * necessary fees) TODO: tell the client how much fee it needs
  5279. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5280. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5281. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5282. * </pre>
  5283. */
  5284. boolean hasTx();
  5285. /**
  5286. * <code>required bytes tx = 1;</code>
  5287. *
  5288. * <pre>
  5289. * The serialized bytes of the transaction in Satoshi format.
  5290. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5291. * necessary fees) TODO: tell the client how much fee it needs
  5292. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5293. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5294. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5295. * </pre>
  5296. */
  5297. com.google.protobuf.ByteString getTx();
  5298. }
  5299. /**
  5300. * Protobuf type {@code paymentchannels.ProvideContract}
  5301. *
  5302. * <pre>
  5303. * Sent from the primary to the secondary to complete initialization.
  5304. * </pre>
  5305. */
  5306. public static final class ProvideContract extends
  5307. com.google.protobuf.GeneratedMessage
  5308. implements ProvideContractOrBuilder {
  5309. // Use ProvideContract.newBuilder() to construct.
  5310. private ProvideContract(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  5311. super(builder);
  5312. this.unknownFields = builder.getUnknownFields();
  5313. }
  5314. private ProvideContract(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  5315. private static final ProvideContract defaultInstance;
  5316. public static ProvideContract getDefaultInstance() {
  5317. return defaultInstance;
  5318. }
  5319. public ProvideContract getDefaultInstanceForType() {
  5320. return defaultInstance;
  5321. }
  5322. private final com.google.protobuf.UnknownFieldSet unknownFields;
  5323. @java.lang.Override
  5324. public final com.google.protobuf.UnknownFieldSet
  5325. getUnknownFields() {
  5326. return this.unknownFields;
  5327. }
  5328. private ProvideContract(
  5329. com.google.protobuf.CodedInputStream input,
  5330. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5331. throws com.google.protobuf.InvalidProtocolBufferException {
  5332. initFields();
  5333. int mutable_bitField0_ = 0;
  5334. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  5335. com.google.protobuf.UnknownFieldSet.newBuilder();
  5336. try {
  5337. boolean done = false;
  5338. while (!done) {
  5339. int tag = input.readTag();
  5340. switch (tag) {
  5341. case 0:
  5342. done = true;
  5343. break;
  5344. default: {
  5345. if (!parseUnknownField(input, unknownFields,
  5346. extensionRegistry, tag)) {
  5347. done = true;
  5348. }
  5349. break;
  5350. }
  5351. case 10: {
  5352. bitField0_ |= 0x00000001;
  5353. tx_ = input.readBytes();
  5354. break;
  5355. }
  5356. }
  5357. }
  5358. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  5359. throw e.setUnfinishedMessage(this);
  5360. } catch (java.io.IOException e) {
  5361. throw new com.google.protobuf.InvalidProtocolBufferException(
  5362. e.getMessage()).setUnfinishedMessage(this);
  5363. } finally {
  5364. this.unknownFields = unknownFields.build();
  5365. makeExtensionsImmutable();
  5366. }
  5367. }
  5368. public static final com.google.protobuf.Descriptors.Descriptor
  5369. getDescriptor() {
  5370. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor;
  5371. }
  5372. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  5373. internalGetFieldAccessorTable() {
  5374. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable
  5375. .ensureFieldAccessorsInitialized(
  5376. org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class);
  5377. }
  5378. public static com.google.protobuf.Parser<ProvideContract> PARSER =
  5379. new com.google.protobuf.AbstractParser<ProvideContract>() {
  5380. public ProvideContract parsePartialFrom(
  5381. com.google.protobuf.CodedInputStream input,
  5382. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5383. throws com.google.protobuf.InvalidProtocolBufferException {
  5384. return new ProvideContract(input, extensionRegistry);
  5385. }
  5386. };
  5387. @java.lang.Override
  5388. public com.google.protobuf.Parser<ProvideContract> getParserForType() {
  5389. return PARSER;
  5390. }
  5391. private int bitField0_;
  5392. // required bytes tx = 1;
  5393. public static final int TX_FIELD_NUMBER = 1;
  5394. private com.google.protobuf.ByteString tx_;
  5395. /**
  5396. * <code>required bytes tx = 1;</code>
  5397. *
  5398. * <pre>
  5399. * The serialized bytes of the transaction in Satoshi format.
  5400. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5401. * necessary fees) TODO: tell the client how much fee it needs
  5402. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5403. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5404. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5405. * </pre>
  5406. */
  5407. public boolean hasTx() {
  5408. return ((bitField0_ & 0x00000001) == 0x00000001);
  5409. }
  5410. /**
  5411. * <code>required bytes tx = 1;</code>
  5412. *
  5413. * <pre>
  5414. * The serialized bytes of the transaction in Satoshi format.
  5415. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5416. * necessary fees) TODO: tell the client how much fee it needs
  5417. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5418. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5419. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5420. * </pre>
  5421. */
  5422. public com.google.protobuf.ByteString getTx() {
  5423. return tx_;
  5424. }
  5425. private void initFields() {
  5426. tx_ = com.google.protobuf.ByteString.EMPTY;
  5427. }
  5428. private byte memoizedIsInitialized = -1;
  5429. public final boolean isInitialized() {
  5430. byte isInitialized = memoizedIsInitialized;
  5431. if (isInitialized != -1) return isInitialized == 1;
  5432. if (!hasTx()) {
  5433. memoizedIsInitialized = 0;
  5434. return false;
  5435. }
  5436. memoizedIsInitialized = 1;
  5437. return true;
  5438. }
  5439. public void writeTo(com.google.protobuf.CodedOutputStream output)
  5440. throws java.io.IOException {
  5441. getSerializedSize();
  5442. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  5443. output.writeBytes(1, tx_);
  5444. }
  5445. getUnknownFields().writeTo(output);
  5446. }
  5447. private int memoizedSerializedSize = -1;
  5448. public int getSerializedSize() {
  5449. int size = memoizedSerializedSize;
  5450. if (size != -1) return size;
  5451. size = 0;
  5452. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  5453. size += com.google.protobuf.CodedOutputStream
  5454. .computeBytesSize(1, tx_);
  5455. }
  5456. size += getUnknownFields().getSerializedSize();
  5457. memoizedSerializedSize = size;
  5458. return size;
  5459. }
  5460. private static final long serialVersionUID = 0L;
  5461. @java.lang.Override
  5462. protected java.lang.Object writeReplace()
  5463. throws java.io.ObjectStreamException {
  5464. return super.writeReplace();
  5465. }
  5466. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
  5467. com.google.protobuf.ByteString data)
  5468. throws com.google.protobuf.InvalidProtocolBufferException {
  5469. return PARSER.parseFrom(data);
  5470. }
  5471. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
  5472. com.google.protobuf.ByteString data,
  5473. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5474. throws com.google.protobuf.InvalidProtocolBufferException {
  5475. return PARSER.parseFrom(data, extensionRegistry);
  5476. }
  5477. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(byte[] data)
  5478. throws com.google.protobuf.InvalidProtocolBufferException {
  5479. return PARSER.parseFrom(data);
  5480. }
  5481. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
  5482. byte[] data,
  5483. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5484. throws com.google.protobuf.InvalidProtocolBufferException {
  5485. return PARSER.parseFrom(data, extensionRegistry);
  5486. }
  5487. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(java.io.InputStream input)
  5488. throws java.io.IOException {
  5489. return PARSER.parseFrom(input);
  5490. }
  5491. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
  5492. java.io.InputStream input,
  5493. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5494. throws java.io.IOException {
  5495. return PARSER.parseFrom(input, extensionRegistry);
  5496. }
  5497. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom(java.io.InputStream input)
  5498. throws java.io.IOException {
  5499. return PARSER.parseDelimitedFrom(input);
  5500. }
  5501. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseDelimitedFrom(
  5502. java.io.InputStream input,
  5503. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5504. throws java.io.IOException {
  5505. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  5506. }
  5507. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
  5508. com.google.protobuf.CodedInputStream input)
  5509. throws java.io.IOException {
  5510. return PARSER.parseFrom(input);
  5511. }
  5512. public static org.bitcoin.paymentchannel.Protos.ProvideContract parseFrom(
  5513. com.google.protobuf.CodedInputStream input,
  5514. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5515. throws java.io.IOException {
  5516. return PARSER.parseFrom(input, extensionRegistry);
  5517. }
  5518. public static Builder newBuilder() { return Builder.create(); }
  5519. public Builder newBuilderForType() { return newBuilder(); }
  5520. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.ProvideContract prototype) {
  5521. return newBuilder().mergeFrom(prototype);
  5522. }
  5523. public Builder toBuilder() { return newBuilder(this); }
  5524. @java.lang.Override
  5525. protected Builder newBuilderForType(
  5526. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  5527. Builder builder = new Builder(parent);
  5528. return builder;
  5529. }
  5530. /**
  5531. * Protobuf type {@code paymentchannels.ProvideContract}
  5532. *
  5533. * <pre>
  5534. * Sent from the primary to the secondary to complete initialization.
  5535. * </pre>
  5536. */
  5537. public static final class Builder extends
  5538. com.google.protobuf.GeneratedMessage.Builder<Builder>
  5539. implements org.bitcoin.paymentchannel.Protos.ProvideContractOrBuilder {
  5540. public static final com.google.protobuf.Descriptors.Descriptor
  5541. getDescriptor() {
  5542. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor;
  5543. }
  5544. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  5545. internalGetFieldAccessorTable() {
  5546. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_fieldAccessorTable
  5547. .ensureFieldAccessorsInitialized(
  5548. org.bitcoin.paymentchannel.Protos.ProvideContract.class, org.bitcoin.paymentchannel.Protos.ProvideContract.Builder.class);
  5549. }
  5550. // Construct using org.bitcoin.paymentchannel.Protos.ProvideContract.newBuilder()
  5551. private Builder() {
  5552. maybeForceBuilderInitialization();
  5553. }
  5554. private Builder(
  5555. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  5556. super(parent);
  5557. maybeForceBuilderInitialization();
  5558. }
  5559. private void maybeForceBuilderInitialization() {
  5560. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  5561. }
  5562. }
  5563. private static Builder create() {
  5564. return new Builder();
  5565. }
  5566. public Builder clear() {
  5567. super.clear();
  5568. tx_ = com.google.protobuf.ByteString.EMPTY;
  5569. bitField0_ = (bitField0_ & ~0x00000001);
  5570. return this;
  5571. }
  5572. public Builder clone() {
  5573. return create().mergeFrom(buildPartial());
  5574. }
  5575. public com.google.protobuf.Descriptors.Descriptor
  5576. getDescriptorForType() {
  5577. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_ProvideContract_descriptor;
  5578. }
  5579. public org.bitcoin.paymentchannel.Protos.ProvideContract getDefaultInstanceForType() {
  5580. return org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance();
  5581. }
  5582. public org.bitcoin.paymentchannel.Protos.ProvideContract build() {
  5583. org.bitcoin.paymentchannel.Protos.ProvideContract result = buildPartial();
  5584. if (!result.isInitialized()) {
  5585. throw newUninitializedMessageException(result);
  5586. }
  5587. return result;
  5588. }
  5589. public org.bitcoin.paymentchannel.Protos.ProvideContract buildPartial() {
  5590. org.bitcoin.paymentchannel.Protos.ProvideContract result = new org.bitcoin.paymentchannel.Protos.ProvideContract(this);
  5591. int from_bitField0_ = bitField0_;
  5592. int to_bitField0_ = 0;
  5593. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  5594. to_bitField0_ |= 0x00000001;
  5595. }
  5596. result.tx_ = tx_;
  5597. result.bitField0_ = to_bitField0_;
  5598. onBuilt();
  5599. return result;
  5600. }
  5601. public Builder mergeFrom(com.google.protobuf.Message other) {
  5602. if (other instanceof org.bitcoin.paymentchannel.Protos.ProvideContract) {
  5603. return mergeFrom((org.bitcoin.paymentchannel.Protos.ProvideContract)other);
  5604. } else {
  5605. super.mergeFrom(other);
  5606. return this;
  5607. }
  5608. }
  5609. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.ProvideContract other) {
  5610. if (other == org.bitcoin.paymentchannel.Protos.ProvideContract.getDefaultInstance()) return this;
  5611. if (other.hasTx()) {
  5612. setTx(other.getTx());
  5613. }
  5614. this.mergeUnknownFields(other.getUnknownFields());
  5615. return this;
  5616. }
  5617. public final boolean isInitialized() {
  5618. if (!hasTx()) {
  5619. return false;
  5620. }
  5621. return true;
  5622. }
  5623. public Builder mergeFrom(
  5624. com.google.protobuf.CodedInputStream input,
  5625. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5626. throws java.io.IOException {
  5627. org.bitcoin.paymentchannel.Protos.ProvideContract parsedMessage = null;
  5628. try {
  5629. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  5630. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  5631. parsedMessage = (org.bitcoin.paymentchannel.Protos.ProvideContract) e.getUnfinishedMessage();
  5632. throw e;
  5633. } finally {
  5634. if (parsedMessage != null) {
  5635. mergeFrom(parsedMessage);
  5636. }
  5637. }
  5638. return this;
  5639. }
  5640. private int bitField0_;
  5641. // required bytes tx = 1;
  5642. private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY;
  5643. /**
  5644. * <code>required bytes tx = 1;</code>
  5645. *
  5646. * <pre>
  5647. * The serialized bytes of the transaction in Satoshi format.
  5648. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5649. * necessary fees) TODO: tell the client how much fee it needs
  5650. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5651. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5652. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5653. * </pre>
  5654. */
  5655. public boolean hasTx() {
  5656. return ((bitField0_ & 0x00000001) == 0x00000001);
  5657. }
  5658. /**
  5659. * <code>required bytes tx = 1;</code>
  5660. *
  5661. * <pre>
  5662. * The serialized bytes of the transaction in Satoshi format.
  5663. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5664. * necessary fees) TODO: tell the client how much fee it needs
  5665. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5666. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5667. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5668. * </pre>
  5669. */
  5670. public com.google.protobuf.ByteString getTx() {
  5671. return tx_;
  5672. }
  5673. /**
  5674. * <code>required bytes tx = 1;</code>
  5675. *
  5676. * <pre>
  5677. * The serialized bytes of the transaction in Satoshi format.
  5678. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5679. * necessary fees) TODO: tell the client how much fee it needs
  5680. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5681. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5682. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5683. * </pre>
  5684. */
  5685. public Builder setTx(com.google.protobuf.ByteString value) {
  5686. if (value == null) {
  5687. throw new NullPointerException();
  5688. }
  5689. bitField0_ |= 0x00000001;
  5690. tx_ = value;
  5691. onChanged();
  5692. return this;
  5693. }
  5694. /**
  5695. * <code>required bytes tx = 1;</code>
  5696. *
  5697. * <pre>
  5698. * The serialized bytes of the transaction in Satoshi format.
  5699. * * It must be signed and completely valid and ready for broadcast (ie it includes the
  5700. * necessary fees) TODO: tell the client how much fee it needs
  5701. * * Its first output must be a 2-of-2 multisig output with the first pubkey being the
  5702. * primary's and the second being the secondary's (ie the script must be exactly "OP_2
  5703. * ProvideRefund.multisig_key Initiate.multisig_key OP_2 OP_CHECKMULTISIG")
  5704. * </pre>
  5705. */
  5706. public Builder clearTx() {
  5707. bitField0_ = (bitField0_ & ~0x00000001);
  5708. tx_ = getDefaultInstance().getTx();
  5709. onChanged();
  5710. return this;
  5711. }
  5712. // @@protoc_insertion_point(builder_scope:paymentchannels.ProvideContract)
  5713. }
  5714. static {
  5715. defaultInstance = new ProvideContract(true);
  5716. defaultInstance.initFields();
  5717. }
  5718. // @@protoc_insertion_point(class_scope:paymentchannels.ProvideContract)
  5719. }
  5720. public interface UpdatePaymentOrBuilder
  5721. extends com.google.protobuf.MessageOrBuilder {
  5722. // required uint64 client_change_value = 1;
  5723. /**
  5724. * <code>required uint64 client_change_value = 1;</code>
  5725. *
  5726. * <pre>
  5727. * The value which is sent back to the primary. The rest of the multisig output is left for
  5728. * the secondary to do with as they wish.
  5729. * </pre>
  5730. */
  5731. boolean hasClientChangeValue();
  5732. /**
  5733. * <code>required uint64 client_change_value = 1;</code>
  5734. *
  5735. * <pre>
  5736. * The value which is sent back to the primary. The rest of the multisig output is left for
  5737. * the secondary to do with as they wish.
  5738. * </pre>
  5739. */
  5740. long getClientChangeValue();
  5741. // required bytes signature = 2;
  5742. /**
  5743. * <code>required bytes signature = 2;</code>
  5744. *
  5745. * <pre>
  5746. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  5747. * spends the primary's part of the multisig contract's output. This signature only covers
  5748. * the primary's refund output and thus the secondary is free to do what they wish with their
  5749. * part of the multisig output.
  5750. * </pre>
  5751. */
  5752. boolean hasSignature();
  5753. /**
  5754. * <code>required bytes signature = 2;</code>
  5755. *
  5756. * <pre>
  5757. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  5758. * spends the primary's part of the multisig contract's output. This signature only covers
  5759. * the primary's refund output and thus the secondary is free to do what they wish with their
  5760. * part of the multisig output.
  5761. * </pre>
  5762. */
  5763. com.google.protobuf.ByteString getSignature();
  5764. }
  5765. /**
  5766. * Protobuf type {@code paymentchannels.UpdatePayment}
  5767. *
  5768. * <pre>
  5769. * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
  5770. * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
  5771. * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
  5772. * * Adding an input which spends the multisig contract
  5773. * * Setting this input's scriptSig to the given signature and a new signature created by the
  5774. * primary (the primary should ensure the signature provided correctly spends the multisig
  5775. * contract)
  5776. * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
  5777. * the refund transaction
  5778. * * Setting this output's value to client_change_value (which must be lower than the most recent
  5779. * client_change_value and lower than the multisig contract's output value)
  5780. * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
  5781. * * Adding any number of additional inputs as desired (eg to add more fee)
  5782. * </pre>
  5783. */
  5784. public static final class UpdatePayment extends
  5785. com.google.protobuf.GeneratedMessage
  5786. implements UpdatePaymentOrBuilder {
  5787. // Use UpdatePayment.newBuilder() to construct.
  5788. private UpdatePayment(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  5789. super(builder);
  5790. this.unknownFields = builder.getUnknownFields();
  5791. }
  5792. private UpdatePayment(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  5793. private static final UpdatePayment defaultInstance;
  5794. public static UpdatePayment getDefaultInstance() {
  5795. return defaultInstance;
  5796. }
  5797. public UpdatePayment getDefaultInstanceForType() {
  5798. return defaultInstance;
  5799. }
  5800. private final com.google.protobuf.UnknownFieldSet unknownFields;
  5801. @java.lang.Override
  5802. public final com.google.protobuf.UnknownFieldSet
  5803. getUnknownFields() {
  5804. return this.unknownFields;
  5805. }
  5806. private UpdatePayment(
  5807. com.google.protobuf.CodedInputStream input,
  5808. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5809. throws com.google.protobuf.InvalidProtocolBufferException {
  5810. initFields();
  5811. int mutable_bitField0_ = 0;
  5812. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  5813. com.google.protobuf.UnknownFieldSet.newBuilder();
  5814. try {
  5815. boolean done = false;
  5816. while (!done) {
  5817. int tag = input.readTag();
  5818. switch (tag) {
  5819. case 0:
  5820. done = true;
  5821. break;
  5822. default: {
  5823. if (!parseUnknownField(input, unknownFields,
  5824. extensionRegistry, tag)) {
  5825. done = true;
  5826. }
  5827. break;
  5828. }
  5829. case 8: {
  5830. bitField0_ |= 0x00000001;
  5831. clientChangeValue_ = input.readUInt64();
  5832. break;
  5833. }
  5834. case 18: {
  5835. bitField0_ |= 0x00000002;
  5836. signature_ = input.readBytes();
  5837. break;
  5838. }
  5839. }
  5840. }
  5841. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  5842. throw e.setUnfinishedMessage(this);
  5843. } catch (java.io.IOException e) {
  5844. throw new com.google.protobuf.InvalidProtocolBufferException(
  5845. e.getMessage()).setUnfinishedMessage(this);
  5846. } finally {
  5847. this.unknownFields = unknownFields.build();
  5848. makeExtensionsImmutable();
  5849. }
  5850. }
  5851. public static final com.google.protobuf.Descriptors.Descriptor
  5852. getDescriptor() {
  5853. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor;
  5854. }
  5855. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  5856. internalGetFieldAccessorTable() {
  5857. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable
  5858. .ensureFieldAccessorsInitialized(
  5859. org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class);
  5860. }
  5861. public static com.google.protobuf.Parser<UpdatePayment> PARSER =
  5862. new com.google.protobuf.AbstractParser<UpdatePayment>() {
  5863. public UpdatePayment parsePartialFrom(
  5864. com.google.protobuf.CodedInputStream input,
  5865. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5866. throws com.google.protobuf.InvalidProtocolBufferException {
  5867. return new UpdatePayment(input, extensionRegistry);
  5868. }
  5869. };
  5870. @java.lang.Override
  5871. public com.google.protobuf.Parser<UpdatePayment> getParserForType() {
  5872. return PARSER;
  5873. }
  5874. private int bitField0_;
  5875. // required uint64 client_change_value = 1;
  5876. public static final int CLIENT_CHANGE_VALUE_FIELD_NUMBER = 1;
  5877. private long clientChangeValue_;
  5878. /**
  5879. * <code>required uint64 client_change_value = 1;</code>
  5880. *
  5881. * <pre>
  5882. * The value which is sent back to the primary. The rest of the multisig output is left for
  5883. * the secondary to do with as they wish.
  5884. * </pre>
  5885. */
  5886. public boolean hasClientChangeValue() {
  5887. return ((bitField0_ & 0x00000001) == 0x00000001);
  5888. }
  5889. /**
  5890. * <code>required uint64 client_change_value = 1;</code>
  5891. *
  5892. * <pre>
  5893. * The value which is sent back to the primary. The rest of the multisig output is left for
  5894. * the secondary to do with as they wish.
  5895. * </pre>
  5896. */
  5897. public long getClientChangeValue() {
  5898. return clientChangeValue_;
  5899. }
  5900. // required bytes signature = 2;
  5901. public static final int SIGNATURE_FIELD_NUMBER = 2;
  5902. private com.google.protobuf.ByteString signature_;
  5903. /**
  5904. * <code>required bytes signature = 2;</code>
  5905. *
  5906. * <pre>
  5907. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  5908. * spends the primary's part of the multisig contract's output. This signature only covers
  5909. * the primary's refund output and thus the secondary is free to do what they wish with their
  5910. * part of the multisig output.
  5911. * </pre>
  5912. */
  5913. public boolean hasSignature() {
  5914. return ((bitField0_ & 0x00000002) == 0x00000002);
  5915. }
  5916. /**
  5917. * <code>required bytes signature = 2;</code>
  5918. *
  5919. * <pre>
  5920. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  5921. * spends the primary's part of the multisig contract's output. This signature only covers
  5922. * the primary's refund output and thus the secondary is free to do what they wish with their
  5923. * part of the multisig output.
  5924. * </pre>
  5925. */
  5926. public com.google.protobuf.ByteString getSignature() {
  5927. return signature_;
  5928. }
  5929. private void initFields() {
  5930. clientChangeValue_ = 0L;
  5931. signature_ = com.google.protobuf.ByteString.EMPTY;
  5932. }
  5933. private byte memoizedIsInitialized = -1;
  5934. public final boolean isInitialized() {
  5935. byte isInitialized = memoizedIsInitialized;
  5936. if (isInitialized != -1) return isInitialized == 1;
  5937. if (!hasClientChangeValue()) {
  5938. memoizedIsInitialized = 0;
  5939. return false;
  5940. }
  5941. if (!hasSignature()) {
  5942. memoizedIsInitialized = 0;
  5943. return false;
  5944. }
  5945. memoizedIsInitialized = 1;
  5946. return true;
  5947. }
  5948. public void writeTo(com.google.protobuf.CodedOutputStream output)
  5949. throws java.io.IOException {
  5950. getSerializedSize();
  5951. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  5952. output.writeUInt64(1, clientChangeValue_);
  5953. }
  5954. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  5955. output.writeBytes(2, signature_);
  5956. }
  5957. getUnknownFields().writeTo(output);
  5958. }
  5959. private int memoizedSerializedSize = -1;
  5960. public int getSerializedSize() {
  5961. int size = memoizedSerializedSize;
  5962. if (size != -1) return size;
  5963. size = 0;
  5964. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  5965. size += com.google.protobuf.CodedOutputStream
  5966. .computeUInt64Size(1, clientChangeValue_);
  5967. }
  5968. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  5969. size += com.google.protobuf.CodedOutputStream
  5970. .computeBytesSize(2, signature_);
  5971. }
  5972. size += getUnknownFields().getSerializedSize();
  5973. memoizedSerializedSize = size;
  5974. return size;
  5975. }
  5976. private static final long serialVersionUID = 0L;
  5977. @java.lang.Override
  5978. protected java.lang.Object writeReplace()
  5979. throws java.io.ObjectStreamException {
  5980. return super.writeReplace();
  5981. }
  5982. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
  5983. com.google.protobuf.ByteString data)
  5984. throws com.google.protobuf.InvalidProtocolBufferException {
  5985. return PARSER.parseFrom(data);
  5986. }
  5987. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
  5988. com.google.protobuf.ByteString data,
  5989. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  5990. throws com.google.protobuf.InvalidProtocolBufferException {
  5991. return PARSER.parseFrom(data, extensionRegistry);
  5992. }
  5993. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(byte[] data)
  5994. throws com.google.protobuf.InvalidProtocolBufferException {
  5995. return PARSER.parseFrom(data);
  5996. }
  5997. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
  5998. byte[] data,
  5999. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6000. throws com.google.protobuf.InvalidProtocolBufferException {
  6001. return PARSER.parseFrom(data, extensionRegistry);
  6002. }
  6003. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(java.io.InputStream input)
  6004. throws java.io.IOException {
  6005. return PARSER.parseFrom(input);
  6006. }
  6007. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
  6008. java.io.InputStream input,
  6009. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6010. throws java.io.IOException {
  6011. return PARSER.parseFrom(input, extensionRegistry);
  6012. }
  6013. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom(java.io.InputStream input)
  6014. throws java.io.IOException {
  6015. return PARSER.parseDelimitedFrom(input);
  6016. }
  6017. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseDelimitedFrom(
  6018. java.io.InputStream input,
  6019. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6020. throws java.io.IOException {
  6021. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  6022. }
  6023. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
  6024. com.google.protobuf.CodedInputStream input)
  6025. throws java.io.IOException {
  6026. return PARSER.parseFrom(input);
  6027. }
  6028. public static org.bitcoin.paymentchannel.Protos.UpdatePayment parseFrom(
  6029. com.google.protobuf.CodedInputStream input,
  6030. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6031. throws java.io.IOException {
  6032. return PARSER.parseFrom(input, extensionRegistry);
  6033. }
  6034. public static Builder newBuilder() { return Builder.create(); }
  6035. public Builder newBuilderForType() { return newBuilder(); }
  6036. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.UpdatePayment prototype) {
  6037. return newBuilder().mergeFrom(prototype);
  6038. }
  6039. public Builder toBuilder() { return newBuilder(this); }
  6040. @java.lang.Override
  6041. protected Builder newBuilderForType(
  6042. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  6043. Builder builder = new Builder(parent);
  6044. return builder;
  6045. }
  6046. /**
  6047. * Protobuf type {@code paymentchannels.UpdatePayment}
  6048. *
  6049. * <pre>
  6050. * This message can only be used by the primary after it has received a CHANNEL_OPEN message. It
  6051. * creates a new payment transaction. Note that we don't resubmit the entire TX, this is to avoid
  6052. * (re)parsing bugs and overhead. The payment transaction is created by the primary by:
  6053. * * Adding an input which spends the multisig contract
  6054. * * Setting this input's scriptSig to the given signature and a new signature created by the
  6055. * primary (the primary should ensure the signature provided correctly spends the multisig
  6056. * contract)
  6057. * * Adding an output who's scriptPubKey is the same as the refund output (the only output) in
  6058. * the refund transaction
  6059. * * Setting this output's value to client_change_value (which must be lower than the most recent
  6060. * client_change_value and lower than the multisig contract's output value)
  6061. * * Adding any number of additional outputs as desired (leaving sufficient fee, if necessary)
  6062. * * Adding any number of additional inputs as desired (eg to add more fee)
  6063. * </pre>
  6064. */
  6065. public static final class Builder extends
  6066. com.google.protobuf.GeneratedMessage.Builder<Builder>
  6067. implements org.bitcoin.paymentchannel.Protos.UpdatePaymentOrBuilder {
  6068. public static final com.google.protobuf.Descriptors.Descriptor
  6069. getDescriptor() {
  6070. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor;
  6071. }
  6072. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  6073. internalGetFieldAccessorTable() {
  6074. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_fieldAccessorTable
  6075. .ensureFieldAccessorsInitialized(
  6076. org.bitcoin.paymentchannel.Protos.UpdatePayment.class, org.bitcoin.paymentchannel.Protos.UpdatePayment.Builder.class);
  6077. }
  6078. // Construct using org.bitcoin.paymentchannel.Protos.UpdatePayment.newBuilder()
  6079. private Builder() {
  6080. maybeForceBuilderInitialization();
  6081. }
  6082. private Builder(
  6083. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  6084. super(parent);
  6085. maybeForceBuilderInitialization();
  6086. }
  6087. private void maybeForceBuilderInitialization() {
  6088. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  6089. }
  6090. }
  6091. private static Builder create() {
  6092. return new Builder();
  6093. }
  6094. public Builder clear() {
  6095. super.clear();
  6096. clientChangeValue_ = 0L;
  6097. bitField0_ = (bitField0_ & ~0x00000001);
  6098. signature_ = com.google.protobuf.ByteString.EMPTY;
  6099. bitField0_ = (bitField0_ & ~0x00000002);
  6100. return this;
  6101. }
  6102. public Builder clone() {
  6103. return create().mergeFrom(buildPartial());
  6104. }
  6105. public com.google.protobuf.Descriptors.Descriptor
  6106. getDescriptorForType() {
  6107. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_UpdatePayment_descriptor;
  6108. }
  6109. public org.bitcoin.paymentchannel.Protos.UpdatePayment getDefaultInstanceForType() {
  6110. return org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance();
  6111. }
  6112. public org.bitcoin.paymentchannel.Protos.UpdatePayment build() {
  6113. org.bitcoin.paymentchannel.Protos.UpdatePayment result = buildPartial();
  6114. if (!result.isInitialized()) {
  6115. throw newUninitializedMessageException(result);
  6116. }
  6117. return result;
  6118. }
  6119. public org.bitcoin.paymentchannel.Protos.UpdatePayment buildPartial() {
  6120. org.bitcoin.paymentchannel.Protos.UpdatePayment result = new org.bitcoin.paymentchannel.Protos.UpdatePayment(this);
  6121. int from_bitField0_ = bitField0_;
  6122. int to_bitField0_ = 0;
  6123. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  6124. to_bitField0_ |= 0x00000001;
  6125. }
  6126. result.clientChangeValue_ = clientChangeValue_;
  6127. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  6128. to_bitField0_ |= 0x00000002;
  6129. }
  6130. result.signature_ = signature_;
  6131. result.bitField0_ = to_bitField0_;
  6132. onBuilt();
  6133. return result;
  6134. }
  6135. public Builder mergeFrom(com.google.protobuf.Message other) {
  6136. if (other instanceof org.bitcoin.paymentchannel.Protos.UpdatePayment) {
  6137. return mergeFrom((org.bitcoin.paymentchannel.Protos.UpdatePayment)other);
  6138. } else {
  6139. super.mergeFrom(other);
  6140. return this;
  6141. }
  6142. }
  6143. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.UpdatePayment other) {
  6144. if (other == org.bitcoin.paymentchannel.Protos.UpdatePayment.getDefaultInstance()) return this;
  6145. if (other.hasClientChangeValue()) {
  6146. setClientChangeValue(other.getClientChangeValue());
  6147. }
  6148. if (other.hasSignature()) {
  6149. setSignature(other.getSignature());
  6150. }
  6151. this.mergeUnknownFields(other.getUnknownFields());
  6152. return this;
  6153. }
  6154. public final boolean isInitialized() {
  6155. if (!hasClientChangeValue()) {
  6156. return false;
  6157. }
  6158. if (!hasSignature()) {
  6159. return false;
  6160. }
  6161. return true;
  6162. }
  6163. public Builder mergeFrom(
  6164. com.google.protobuf.CodedInputStream input,
  6165. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6166. throws java.io.IOException {
  6167. org.bitcoin.paymentchannel.Protos.UpdatePayment parsedMessage = null;
  6168. try {
  6169. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  6170. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  6171. parsedMessage = (org.bitcoin.paymentchannel.Protos.UpdatePayment) e.getUnfinishedMessage();
  6172. throw e;
  6173. } finally {
  6174. if (parsedMessage != null) {
  6175. mergeFrom(parsedMessage);
  6176. }
  6177. }
  6178. return this;
  6179. }
  6180. private int bitField0_;
  6181. // required uint64 client_change_value = 1;
  6182. private long clientChangeValue_ ;
  6183. /**
  6184. * <code>required uint64 client_change_value = 1;</code>
  6185. *
  6186. * <pre>
  6187. * The value which is sent back to the primary. The rest of the multisig output is left for
  6188. * the secondary to do with as they wish.
  6189. * </pre>
  6190. */
  6191. public boolean hasClientChangeValue() {
  6192. return ((bitField0_ & 0x00000001) == 0x00000001);
  6193. }
  6194. /**
  6195. * <code>required uint64 client_change_value = 1;</code>
  6196. *
  6197. * <pre>
  6198. * The value which is sent back to the primary. The rest of the multisig output is left for
  6199. * the secondary to do with as they wish.
  6200. * </pre>
  6201. */
  6202. public long getClientChangeValue() {
  6203. return clientChangeValue_;
  6204. }
  6205. /**
  6206. * <code>required uint64 client_change_value = 1;</code>
  6207. *
  6208. * <pre>
  6209. * The value which is sent back to the primary. The rest of the multisig output is left for
  6210. * the secondary to do with as they wish.
  6211. * </pre>
  6212. */
  6213. public Builder setClientChangeValue(long value) {
  6214. bitField0_ |= 0x00000001;
  6215. clientChangeValue_ = value;
  6216. onChanged();
  6217. return this;
  6218. }
  6219. /**
  6220. * <code>required uint64 client_change_value = 1;</code>
  6221. *
  6222. * <pre>
  6223. * The value which is sent back to the primary. The rest of the multisig output is left for
  6224. * the secondary to do with as they wish.
  6225. * </pre>
  6226. */
  6227. public Builder clearClientChangeValue() {
  6228. bitField0_ = (bitField0_ & ~0x00000001);
  6229. clientChangeValue_ = 0L;
  6230. onChanged();
  6231. return this;
  6232. }
  6233. // required bytes signature = 2;
  6234. private com.google.protobuf.ByteString signature_ = com.google.protobuf.ByteString.EMPTY;
  6235. /**
  6236. * <code>required bytes signature = 2;</code>
  6237. *
  6238. * <pre>
  6239. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  6240. * spends the primary's part of the multisig contract's output. This signature only covers
  6241. * the primary's refund output and thus the secondary is free to do what they wish with their
  6242. * part of the multisig output.
  6243. * </pre>
  6244. */
  6245. public boolean hasSignature() {
  6246. return ((bitField0_ & 0x00000002) == 0x00000002);
  6247. }
  6248. /**
  6249. * <code>required bytes signature = 2;</code>
  6250. *
  6251. * <pre>
  6252. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  6253. * spends the primary's part of the multisig contract's output. This signature only covers
  6254. * the primary's refund output and thus the secondary is free to do what they wish with their
  6255. * part of the multisig output.
  6256. * </pre>
  6257. */
  6258. public com.google.protobuf.ByteString getSignature() {
  6259. return signature_;
  6260. }
  6261. /**
  6262. * <code>required bytes signature = 2;</code>
  6263. *
  6264. * <pre>
  6265. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  6266. * spends the primary's part of the multisig contract's output. This signature only covers
  6267. * the primary's refund output and thus the secondary is free to do what they wish with their
  6268. * part of the multisig output.
  6269. * </pre>
  6270. */
  6271. public Builder setSignature(com.google.protobuf.ByteString value) {
  6272. if (value == null) {
  6273. throw new NullPointerException();
  6274. }
  6275. bitField0_ |= 0x00000002;
  6276. signature_ = value;
  6277. onChanged();
  6278. return this;
  6279. }
  6280. /**
  6281. * <code>required bytes signature = 2;</code>
  6282. *
  6283. * <pre>
  6284. * A SIGHASH_SINGLE|SIGHASH_ANYONECANPAY signature (including the postfix type byte) which
  6285. * spends the primary's part of the multisig contract's output. This signature only covers
  6286. * the primary's refund output and thus the secondary is free to do what they wish with their
  6287. * part of the multisig output.
  6288. * </pre>
  6289. */
  6290. public Builder clearSignature() {
  6291. bitField0_ = (bitField0_ & ~0x00000002);
  6292. signature_ = getDefaultInstance().getSignature();
  6293. onChanged();
  6294. return this;
  6295. }
  6296. // @@protoc_insertion_point(builder_scope:paymentchannels.UpdatePayment)
  6297. }
  6298. static {
  6299. defaultInstance = new UpdatePayment(true);
  6300. defaultInstance.initFields();
  6301. }
  6302. // @@protoc_insertion_point(class_scope:paymentchannels.UpdatePayment)
  6303. }
  6304. public interface CloseOrBuilder
  6305. extends com.google.protobuf.MessageOrBuilder {
  6306. // required bytes tx = 3;
  6307. /**
  6308. * <code>required bytes tx = 3;</code>
  6309. *
  6310. * <pre>
  6311. * A copy of the fully signed final contract that closes the channel. The client can verify
  6312. * the transaction is correct and then commit it to their wallet.
  6313. * </pre>
  6314. */
  6315. boolean hasTx();
  6316. /**
  6317. * <code>required bytes tx = 3;</code>
  6318. *
  6319. * <pre>
  6320. * A copy of the fully signed final contract that closes the channel. The client can verify
  6321. * the transaction is correct and then commit it to their wallet.
  6322. * </pre>
  6323. */
  6324. com.google.protobuf.ByteString getTx();
  6325. }
  6326. /**
  6327. * Protobuf type {@code paymentchannels.Close}
  6328. */
  6329. public static final class Close extends
  6330. com.google.protobuf.GeneratedMessage
  6331. implements CloseOrBuilder {
  6332. // Use Close.newBuilder() to construct.
  6333. private Close(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  6334. super(builder);
  6335. this.unknownFields = builder.getUnknownFields();
  6336. }
  6337. private Close(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  6338. private static final Close defaultInstance;
  6339. public static Close getDefaultInstance() {
  6340. return defaultInstance;
  6341. }
  6342. public Close getDefaultInstanceForType() {
  6343. return defaultInstance;
  6344. }
  6345. private final com.google.protobuf.UnknownFieldSet unknownFields;
  6346. @java.lang.Override
  6347. public final com.google.protobuf.UnknownFieldSet
  6348. getUnknownFields() {
  6349. return this.unknownFields;
  6350. }
  6351. private Close(
  6352. com.google.protobuf.CodedInputStream input,
  6353. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6354. throws com.google.protobuf.InvalidProtocolBufferException {
  6355. initFields();
  6356. int mutable_bitField0_ = 0;
  6357. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  6358. com.google.protobuf.UnknownFieldSet.newBuilder();
  6359. try {
  6360. boolean done = false;
  6361. while (!done) {
  6362. int tag = input.readTag();
  6363. switch (tag) {
  6364. case 0:
  6365. done = true;
  6366. break;
  6367. default: {
  6368. if (!parseUnknownField(input, unknownFields,
  6369. extensionRegistry, tag)) {
  6370. done = true;
  6371. }
  6372. break;
  6373. }
  6374. case 26: {
  6375. bitField0_ |= 0x00000001;
  6376. tx_ = input.readBytes();
  6377. break;
  6378. }
  6379. }
  6380. }
  6381. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  6382. throw e.setUnfinishedMessage(this);
  6383. } catch (java.io.IOException e) {
  6384. throw new com.google.protobuf.InvalidProtocolBufferException(
  6385. e.getMessage()).setUnfinishedMessage(this);
  6386. } finally {
  6387. this.unknownFields = unknownFields.build();
  6388. makeExtensionsImmutable();
  6389. }
  6390. }
  6391. public static final com.google.protobuf.Descriptors.Descriptor
  6392. getDescriptor() {
  6393. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Close_descriptor;
  6394. }
  6395. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  6396. internalGetFieldAccessorTable() {
  6397. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Close_fieldAccessorTable
  6398. .ensureFieldAccessorsInitialized(
  6399. org.bitcoin.paymentchannel.Protos.Close.class, org.bitcoin.paymentchannel.Protos.Close.Builder.class);
  6400. }
  6401. public static com.google.protobuf.Parser<Close> PARSER =
  6402. new com.google.protobuf.AbstractParser<Close>() {
  6403. public Close parsePartialFrom(
  6404. com.google.protobuf.CodedInputStream input,
  6405. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6406. throws com.google.protobuf.InvalidProtocolBufferException {
  6407. return new Close(input, extensionRegistry);
  6408. }
  6409. };
  6410. @java.lang.Override
  6411. public com.google.protobuf.Parser<Close> getParserForType() {
  6412. return PARSER;
  6413. }
  6414. private int bitField0_;
  6415. // required bytes tx = 3;
  6416. public static final int TX_FIELD_NUMBER = 3;
  6417. private com.google.protobuf.ByteString tx_;
  6418. /**
  6419. * <code>required bytes tx = 3;</code>
  6420. *
  6421. * <pre>
  6422. * A copy of the fully signed final contract that closes the channel. The client can verify
  6423. * the transaction is correct and then commit it to their wallet.
  6424. * </pre>
  6425. */
  6426. public boolean hasTx() {
  6427. return ((bitField0_ & 0x00000001) == 0x00000001);
  6428. }
  6429. /**
  6430. * <code>required bytes tx = 3;</code>
  6431. *
  6432. * <pre>
  6433. * A copy of the fully signed final contract that closes the channel. The client can verify
  6434. * the transaction is correct and then commit it to their wallet.
  6435. * </pre>
  6436. */
  6437. public com.google.protobuf.ByteString getTx() {
  6438. return tx_;
  6439. }
  6440. private void initFields() {
  6441. tx_ = com.google.protobuf.ByteString.EMPTY;
  6442. }
  6443. private byte memoizedIsInitialized = -1;
  6444. public final boolean isInitialized() {
  6445. byte isInitialized = memoizedIsInitialized;
  6446. if (isInitialized != -1) return isInitialized == 1;
  6447. if (!hasTx()) {
  6448. memoizedIsInitialized = 0;
  6449. return false;
  6450. }
  6451. memoizedIsInitialized = 1;
  6452. return true;
  6453. }
  6454. public void writeTo(com.google.protobuf.CodedOutputStream output)
  6455. throws java.io.IOException {
  6456. getSerializedSize();
  6457. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  6458. output.writeBytes(3, tx_);
  6459. }
  6460. getUnknownFields().writeTo(output);
  6461. }
  6462. private int memoizedSerializedSize = -1;
  6463. public int getSerializedSize() {
  6464. int size = memoizedSerializedSize;
  6465. if (size != -1) return size;
  6466. size = 0;
  6467. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  6468. size += com.google.protobuf.CodedOutputStream
  6469. .computeBytesSize(3, tx_);
  6470. }
  6471. size += getUnknownFields().getSerializedSize();
  6472. memoizedSerializedSize = size;
  6473. return size;
  6474. }
  6475. private static final long serialVersionUID = 0L;
  6476. @java.lang.Override
  6477. protected java.lang.Object writeReplace()
  6478. throws java.io.ObjectStreamException {
  6479. return super.writeReplace();
  6480. }
  6481. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(
  6482. com.google.protobuf.ByteString data)
  6483. throws com.google.protobuf.InvalidProtocolBufferException {
  6484. return PARSER.parseFrom(data);
  6485. }
  6486. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(
  6487. com.google.protobuf.ByteString data,
  6488. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6489. throws com.google.protobuf.InvalidProtocolBufferException {
  6490. return PARSER.parseFrom(data, extensionRegistry);
  6491. }
  6492. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(byte[] data)
  6493. throws com.google.protobuf.InvalidProtocolBufferException {
  6494. return PARSER.parseFrom(data);
  6495. }
  6496. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(
  6497. byte[] data,
  6498. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6499. throws com.google.protobuf.InvalidProtocolBufferException {
  6500. return PARSER.parseFrom(data, extensionRegistry);
  6501. }
  6502. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(java.io.InputStream input)
  6503. throws java.io.IOException {
  6504. return PARSER.parseFrom(input);
  6505. }
  6506. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(
  6507. java.io.InputStream input,
  6508. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6509. throws java.io.IOException {
  6510. return PARSER.parseFrom(input, extensionRegistry);
  6511. }
  6512. public static org.bitcoin.paymentchannel.Protos.Close parseDelimitedFrom(java.io.InputStream input)
  6513. throws java.io.IOException {
  6514. return PARSER.parseDelimitedFrom(input);
  6515. }
  6516. public static org.bitcoin.paymentchannel.Protos.Close parseDelimitedFrom(
  6517. java.io.InputStream input,
  6518. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6519. throws java.io.IOException {
  6520. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  6521. }
  6522. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(
  6523. com.google.protobuf.CodedInputStream input)
  6524. throws java.io.IOException {
  6525. return PARSER.parseFrom(input);
  6526. }
  6527. public static org.bitcoin.paymentchannel.Protos.Close parseFrom(
  6528. com.google.protobuf.CodedInputStream input,
  6529. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6530. throws java.io.IOException {
  6531. return PARSER.parseFrom(input, extensionRegistry);
  6532. }
  6533. public static Builder newBuilder() { return Builder.create(); }
  6534. public Builder newBuilderForType() { return newBuilder(); }
  6535. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Close prototype) {
  6536. return newBuilder().mergeFrom(prototype);
  6537. }
  6538. public Builder toBuilder() { return newBuilder(this); }
  6539. @java.lang.Override
  6540. protected Builder newBuilderForType(
  6541. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  6542. Builder builder = new Builder(parent);
  6543. return builder;
  6544. }
  6545. /**
  6546. * Protobuf type {@code paymentchannels.Close}
  6547. */
  6548. public static final class Builder extends
  6549. com.google.protobuf.GeneratedMessage.Builder<Builder>
  6550. implements org.bitcoin.paymentchannel.Protos.CloseOrBuilder {
  6551. public static final com.google.protobuf.Descriptors.Descriptor
  6552. getDescriptor() {
  6553. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Close_descriptor;
  6554. }
  6555. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  6556. internalGetFieldAccessorTable() {
  6557. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Close_fieldAccessorTable
  6558. .ensureFieldAccessorsInitialized(
  6559. org.bitcoin.paymentchannel.Protos.Close.class, org.bitcoin.paymentchannel.Protos.Close.Builder.class);
  6560. }
  6561. // Construct using org.bitcoin.paymentchannel.Protos.Close.newBuilder()
  6562. private Builder() {
  6563. maybeForceBuilderInitialization();
  6564. }
  6565. private Builder(
  6566. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  6567. super(parent);
  6568. maybeForceBuilderInitialization();
  6569. }
  6570. private void maybeForceBuilderInitialization() {
  6571. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  6572. }
  6573. }
  6574. private static Builder create() {
  6575. return new Builder();
  6576. }
  6577. public Builder clear() {
  6578. super.clear();
  6579. tx_ = com.google.protobuf.ByteString.EMPTY;
  6580. bitField0_ = (bitField0_ & ~0x00000001);
  6581. return this;
  6582. }
  6583. public Builder clone() {
  6584. return create().mergeFrom(buildPartial());
  6585. }
  6586. public com.google.protobuf.Descriptors.Descriptor
  6587. getDescriptorForType() {
  6588. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Close_descriptor;
  6589. }
  6590. public org.bitcoin.paymentchannel.Protos.Close getDefaultInstanceForType() {
  6591. return org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance();
  6592. }
  6593. public org.bitcoin.paymentchannel.Protos.Close build() {
  6594. org.bitcoin.paymentchannel.Protos.Close result = buildPartial();
  6595. if (!result.isInitialized()) {
  6596. throw newUninitializedMessageException(result);
  6597. }
  6598. return result;
  6599. }
  6600. public org.bitcoin.paymentchannel.Protos.Close buildPartial() {
  6601. org.bitcoin.paymentchannel.Protos.Close result = new org.bitcoin.paymentchannel.Protos.Close(this);
  6602. int from_bitField0_ = bitField0_;
  6603. int to_bitField0_ = 0;
  6604. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  6605. to_bitField0_ |= 0x00000001;
  6606. }
  6607. result.tx_ = tx_;
  6608. result.bitField0_ = to_bitField0_;
  6609. onBuilt();
  6610. return result;
  6611. }
  6612. public Builder mergeFrom(com.google.protobuf.Message other) {
  6613. if (other instanceof org.bitcoin.paymentchannel.Protos.Close) {
  6614. return mergeFrom((org.bitcoin.paymentchannel.Protos.Close)other);
  6615. } else {
  6616. super.mergeFrom(other);
  6617. return this;
  6618. }
  6619. }
  6620. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Close other) {
  6621. if (other == org.bitcoin.paymentchannel.Protos.Close.getDefaultInstance()) return this;
  6622. if (other.hasTx()) {
  6623. setTx(other.getTx());
  6624. }
  6625. this.mergeUnknownFields(other.getUnknownFields());
  6626. return this;
  6627. }
  6628. public final boolean isInitialized() {
  6629. if (!hasTx()) {
  6630. return false;
  6631. }
  6632. return true;
  6633. }
  6634. public Builder mergeFrom(
  6635. com.google.protobuf.CodedInputStream input,
  6636. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6637. throws java.io.IOException {
  6638. org.bitcoin.paymentchannel.Protos.Close parsedMessage = null;
  6639. try {
  6640. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  6641. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  6642. parsedMessage = (org.bitcoin.paymentchannel.Protos.Close) e.getUnfinishedMessage();
  6643. throw e;
  6644. } finally {
  6645. if (parsedMessage != null) {
  6646. mergeFrom(parsedMessage);
  6647. }
  6648. }
  6649. return this;
  6650. }
  6651. private int bitField0_;
  6652. // required bytes tx = 3;
  6653. private com.google.protobuf.ByteString tx_ = com.google.protobuf.ByteString.EMPTY;
  6654. /**
  6655. * <code>required bytes tx = 3;</code>
  6656. *
  6657. * <pre>
  6658. * A copy of the fully signed final contract that closes the channel. The client can verify
  6659. * the transaction is correct and then commit it to their wallet.
  6660. * </pre>
  6661. */
  6662. public boolean hasTx() {
  6663. return ((bitField0_ & 0x00000001) == 0x00000001);
  6664. }
  6665. /**
  6666. * <code>required bytes tx = 3;</code>
  6667. *
  6668. * <pre>
  6669. * A copy of the fully signed final contract that closes the channel. The client can verify
  6670. * the transaction is correct and then commit it to their wallet.
  6671. * </pre>
  6672. */
  6673. public com.google.protobuf.ByteString getTx() {
  6674. return tx_;
  6675. }
  6676. /**
  6677. * <code>required bytes tx = 3;</code>
  6678. *
  6679. * <pre>
  6680. * A copy of the fully signed final contract that closes the channel. The client can verify
  6681. * the transaction is correct and then commit it to their wallet.
  6682. * </pre>
  6683. */
  6684. public Builder setTx(com.google.protobuf.ByteString value) {
  6685. if (value == null) {
  6686. throw new NullPointerException();
  6687. }
  6688. bitField0_ |= 0x00000001;
  6689. tx_ = value;
  6690. onChanged();
  6691. return this;
  6692. }
  6693. /**
  6694. * <code>required bytes tx = 3;</code>
  6695. *
  6696. * <pre>
  6697. * A copy of the fully signed final contract that closes the channel. The client can verify
  6698. * the transaction is correct and then commit it to their wallet.
  6699. * </pre>
  6700. */
  6701. public Builder clearTx() {
  6702. bitField0_ = (bitField0_ & ~0x00000001);
  6703. tx_ = getDefaultInstance().getTx();
  6704. onChanged();
  6705. return this;
  6706. }
  6707. // @@protoc_insertion_point(builder_scope:paymentchannels.Close)
  6708. }
  6709. static {
  6710. defaultInstance = new Close(true);
  6711. defaultInstance.initFields();
  6712. }
  6713. // @@protoc_insertion_point(class_scope:paymentchannels.Close)
  6714. }
  6715. public interface ErrorOrBuilder
  6716. extends com.google.protobuf.MessageOrBuilder {
  6717. // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
  6718. /**
  6719. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  6720. */
  6721. boolean hasCode();
  6722. /**
  6723. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  6724. */
  6725. org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode();
  6726. // optional string explanation = 2;
  6727. /**
  6728. * <code>optional string explanation = 2;</code>
  6729. *
  6730. * <pre>
  6731. * NOT SAFE FOR HTML WITHOUT ESCAPING
  6732. * </pre>
  6733. */
  6734. boolean hasExplanation();
  6735. /**
  6736. * <code>optional string explanation = 2;</code>
  6737. *
  6738. * <pre>
  6739. * NOT SAFE FOR HTML WITHOUT ESCAPING
  6740. * </pre>
  6741. */
  6742. java.lang.String getExplanation();
  6743. /**
  6744. * <code>optional string explanation = 2;</code>
  6745. *
  6746. * <pre>
  6747. * NOT SAFE FOR HTML WITHOUT ESCAPING
  6748. * </pre>
  6749. */
  6750. com.google.protobuf.ByteString
  6751. getExplanationBytes();
  6752. }
  6753. /**
  6754. * Protobuf type {@code paymentchannels.Error}
  6755. *
  6756. * <pre>
  6757. * An Error can be sent by either party at any time
  6758. * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
  6759. * closing the socket (unless they just received an ERROR or a CLOSE)
  6760. * </pre>
  6761. */
  6762. public static final class Error extends
  6763. com.google.protobuf.GeneratedMessage
  6764. implements ErrorOrBuilder {
  6765. // Use Error.newBuilder() to construct.
  6766. private Error(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
  6767. super(builder);
  6768. this.unknownFields = builder.getUnknownFields();
  6769. }
  6770. private Error(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }
  6771. private static final Error defaultInstance;
  6772. public static Error getDefaultInstance() {
  6773. return defaultInstance;
  6774. }
  6775. public Error getDefaultInstanceForType() {
  6776. return defaultInstance;
  6777. }
  6778. private final com.google.protobuf.UnknownFieldSet unknownFields;
  6779. @java.lang.Override
  6780. public final com.google.protobuf.UnknownFieldSet
  6781. getUnknownFields() {
  6782. return this.unknownFields;
  6783. }
  6784. private Error(
  6785. com.google.protobuf.CodedInputStream input,
  6786. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6787. throws com.google.protobuf.InvalidProtocolBufferException {
  6788. initFields();
  6789. int mutable_bitField0_ = 0;
  6790. com.google.protobuf.UnknownFieldSet.Builder unknownFields =
  6791. com.google.protobuf.UnknownFieldSet.newBuilder();
  6792. try {
  6793. boolean done = false;
  6794. while (!done) {
  6795. int tag = input.readTag();
  6796. switch (tag) {
  6797. case 0:
  6798. done = true;
  6799. break;
  6800. default: {
  6801. if (!parseUnknownField(input, unknownFields,
  6802. extensionRegistry, tag)) {
  6803. done = true;
  6804. }
  6805. break;
  6806. }
  6807. case 8: {
  6808. int rawValue = input.readEnum();
  6809. org.bitcoin.paymentchannel.Protos.Error.ErrorCode value = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.valueOf(rawValue);
  6810. if (value == null) {
  6811. unknownFields.mergeVarintField(1, rawValue);
  6812. } else {
  6813. bitField0_ |= 0x00000001;
  6814. code_ = value;
  6815. }
  6816. break;
  6817. }
  6818. case 18: {
  6819. bitField0_ |= 0x00000002;
  6820. explanation_ = input.readBytes();
  6821. break;
  6822. }
  6823. }
  6824. }
  6825. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  6826. throw e.setUnfinishedMessage(this);
  6827. } catch (java.io.IOException e) {
  6828. throw new com.google.protobuf.InvalidProtocolBufferException(
  6829. e.getMessage()).setUnfinishedMessage(this);
  6830. } finally {
  6831. this.unknownFields = unknownFields.build();
  6832. makeExtensionsImmutable();
  6833. }
  6834. }
  6835. public static final com.google.protobuf.Descriptors.Descriptor
  6836. getDescriptor() {
  6837. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor;
  6838. }
  6839. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  6840. internalGetFieldAccessorTable() {
  6841. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable
  6842. .ensureFieldAccessorsInitialized(
  6843. org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class);
  6844. }
  6845. public static com.google.protobuf.Parser<Error> PARSER =
  6846. new com.google.protobuf.AbstractParser<Error>() {
  6847. public Error parsePartialFrom(
  6848. com.google.protobuf.CodedInputStream input,
  6849. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  6850. throws com.google.protobuf.InvalidProtocolBufferException {
  6851. return new Error(input, extensionRegistry);
  6852. }
  6853. };
  6854. @java.lang.Override
  6855. public com.google.protobuf.Parser<Error> getParserForType() {
  6856. return PARSER;
  6857. }
  6858. /**
  6859. * Protobuf enum {@code paymentchannels.Error.ErrorCode}
  6860. */
  6861. public enum ErrorCode
  6862. implements com.google.protobuf.ProtocolMessageEnum {
  6863. /**
  6864. * <code>TIMEOUT = 1;</code>
  6865. *
  6866. * <pre>
  6867. * Protocol timeout occurred (one party hung).
  6868. * </pre>
  6869. */
  6870. TIMEOUT(0, 1),
  6871. /**
  6872. * <code>SYNTAX_ERROR = 2;</code>
  6873. *
  6874. * <pre>
  6875. * Generic error indicating some message was not properly
  6876. * </pre>
  6877. */
  6878. SYNTAX_ERROR(1, 2),
  6879. /**
  6880. * <code>NO_ACCEPTABLE_VERSION = 3;</code>
  6881. *
  6882. * <pre>
  6883. * formatted or was out of order.
  6884. * </pre>
  6885. */
  6886. NO_ACCEPTABLE_VERSION(2, 3),
  6887. /**
  6888. * <code>BAD_TRANSACTION = 4;</code>
  6889. *
  6890. * <pre>
  6891. * A provided transaction was not in the proper structure
  6892. * </pre>
  6893. */
  6894. BAD_TRANSACTION(3, 4),
  6895. /**
  6896. * <code>TIME_WINDOW_TOO_LARGE = 5;</code>
  6897. *
  6898. * <pre>
  6899. * (wrong inputs/outputs, sequence, lock time, signature,
  6900. * etc)
  6901. * </pre>
  6902. */
  6903. TIME_WINDOW_TOO_LARGE(4, 5),
  6904. /**
  6905. * <code>CHANNEL_VALUE_TOO_LARGE = 6;</code>
  6906. *
  6907. * <pre>
  6908. * for the primary
  6909. * </pre>
  6910. */
  6911. CHANNEL_VALUE_TOO_LARGE(5, 6),
  6912. /**
  6913. * <code>OTHER = 7;</code>
  6914. */
  6915. OTHER(6, 7),
  6916. ;
  6917. /**
  6918. * <code>TIMEOUT = 1;</code>
  6919. *
  6920. * <pre>
  6921. * Protocol timeout occurred (one party hung).
  6922. * </pre>
  6923. */
  6924. public static final int TIMEOUT_VALUE = 1;
  6925. /**
  6926. * <code>SYNTAX_ERROR = 2;</code>
  6927. *
  6928. * <pre>
  6929. * Generic error indicating some message was not properly
  6930. * </pre>
  6931. */
  6932. public static final int SYNTAX_ERROR_VALUE = 2;
  6933. /**
  6934. * <code>NO_ACCEPTABLE_VERSION = 3;</code>
  6935. *
  6936. * <pre>
  6937. * formatted or was out of order.
  6938. * </pre>
  6939. */
  6940. public static final int NO_ACCEPTABLE_VERSION_VALUE = 3;
  6941. /**
  6942. * <code>BAD_TRANSACTION = 4;</code>
  6943. *
  6944. * <pre>
  6945. * A provided transaction was not in the proper structure
  6946. * </pre>
  6947. */
  6948. public static final int BAD_TRANSACTION_VALUE = 4;
  6949. /**
  6950. * <code>TIME_WINDOW_TOO_LARGE = 5;</code>
  6951. *
  6952. * <pre>
  6953. * (wrong inputs/outputs, sequence, lock time, signature,
  6954. * etc)
  6955. * </pre>
  6956. */
  6957. public static final int TIME_WINDOW_TOO_LARGE_VALUE = 5;
  6958. /**
  6959. * <code>CHANNEL_VALUE_TOO_LARGE = 6;</code>
  6960. *
  6961. * <pre>
  6962. * for the primary
  6963. * </pre>
  6964. */
  6965. public static final int CHANNEL_VALUE_TOO_LARGE_VALUE = 6;
  6966. /**
  6967. * <code>OTHER = 7;</code>
  6968. */
  6969. public static final int OTHER_VALUE = 7;
  6970. public final int getNumber() { return value; }
  6971. public static ErrorCode valueOf(int value) {
  6972. switch (value) {
  6973. case 1: return TIMEOUT;
  6974. case 2: return SYNTAX_ERROR;
  6975. case 3: return NO_ACCEPTABLE_VERSION;
  6976. case 4: return BAD_TRANSACTION;
  6977. case 5: return TIME_WINDOW_TOO_LARGE;
  6978. case 6: return CHANNEL_VALUE_TOO_LARGE;
  6979. case 7: return OTHER;
  6980. default: return null;
  6981. }
  6982. }
  6983. public static com.google.protobuf.Internal.EnumLiteMap<ErrorCode>
  6984. internalGetValueMap() {
  6985. return internalValueMap;
  6986. }
  6987. private static com.google.protobuf.Internal.EnumLiteMap<ErrorCode>
  6988. internalValueMap =
  6989. new com.google.protobuf.Internal.EnumLiteMap<ErrorCode>() {
  6990. public ErrorCode findValueByNumber(int number) {
  6991. return ErrorCode.valueOf(number);
  6992. }
  6993. };
  6994. public final com.google.protobuf.Descriptors.EnumValueDescriptor
  6995. getValueDescriptor() {
  6996. return getDescriptor().getValues().get(index);
  6997. }
  6998. public final com.google.protobuf.Descriptors.EnumDescriptor
  6999. getDescriptorForType() {
  7000. return getDescriptor();
  7001. }
  7002. public static final com.google.protobuf.Descriptors.EnumDescriptor
  7003. getDescriptor() {
  7004. return org.bitcoin.paymentchannel.Protos.Error.getDescriptor().getEnumTypes().get(0);
  7005. }
  7006. private static final ErrorCode[] VALUES = values();
  7007. public static ErrorCode valueOf(
  7008. com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
  7009. if (desc.getType() != getDescriptor()) {
  7010. throw new java.lang.IllegalArgumentException(
  7011. "EnumValueDescriptor is not for this type.");
  7012. }
  7013. return VALUES[desc.getIndex()];
  7014. }
  7015. private final int index;
  7016. private final int value;
  7017. private ErrorCode(int index, int value) {
  7018. this.index = index;
  7019. this.value = value;
  7020. }
  7021. // @@protoc_insertion_point(enum_scope:paymentchannels.Error.ErrorCode)
  7022. }
  7023. private int bitField0_;
  7024. // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
  7025. public static final int CODE_FIELD_NUMBER = 1;
  7026. private org.bitcoin.paymentchannel.Protos.Error.ErrorCode code_;
  7027. /**
  7028. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  7029. */
  7030. public boolean hasCode() {
  7031. return ((bitField0_ & 0x00000001) == 0x00000001);
  7032. }
  7033. /**
  7034. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  7035. */
  7036. public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() {
  7037. return code_;
  7038. }
  7039. // optional string explanation = 2;
  7040. public static final int EXPLANATION_FIELD_NUMBER = 2;
  7041. private java.lang.Object explanation_;
  7042. /**
  7043. * <code>optional string explanation = 2;</code>
  7044. *
  7045. * <pre>
  7046. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7047. * </pre>
  7048. */
  7049. public boolean hasExplanation() {
  7050. return ((bitField0_ & 0x00000002) == 0x00000002);
  7051. }
  7052. /**
  7053. * <code>optional string explanation = 2;</code>
  7054. *
  7055. * <pre>
  7056. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7057. * </pre>
  7058. */
  7059. public java.lang.String getExplanation() {
  7060. java.lang.Object ref = explanation_;
  7061. if (ref instanceof java.lang.String) {
  7062. return (java.lang.String) ref;
  7063. } else {
  7064. com.google.protobuf.ByteString bs =
  7065. (com.google.protobuf.ByteString) ref;
  7066. java.lang.String s = bs.toStringUtf8();
  7067. if (bs.isValidUtf8()) {
  7068. explanation_ = s;
  7069. }
  7070. return s;
  7071. }
  7072. }
  7073. /**
  7074. * <code>optional string explanation = 2;</code>
  7075. *
  7076. * <pre>
  7077. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7078. * </pre>
  7079. */
  7080. public com.google.protobuf.ByteString
  7081. getExplanationBytes() {
  7082. java.lang.Object ref = explanation_;
  7083. if (ref instanceof java.lang.String) {
  7084. com.google.protobuf.ByteString b =
  7085. com.google.protobuf.ByteString.copyFromUtf8(
  7086. (java.lang.String) ref);
  7087. explanation_ = b;
  7088. return b;
  7089. } else {
  7090. return (com.google.protobuf.ByteString) ref;
  7091. }
  7092. }
  7093. private void initFields() {
  7094. code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER;
  7095. explanation_ = "";
  7096. }
  7097. private byte memoizedIsInitialized = -1;
  7098. public final boolean isInitialized() {
  7099. byte isInitialized = memoizedIsInitialized;
  7100. if (isInitialized != -1) return isInitialized == 1;
  7101. memoizedIsInitialized = 1;
  7102. return true;
  7103. }
  7104. public void writeTo(com.google.protobuf.CodedOutputStream output)
  7105. throws java.io.IOException {
  7106. getSerializedSize();
  7107. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  7108. output.writeEnum(1, code_.getNumber());
  7109. }
  7110. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  7111. output.writeBytes(2, getExplanationBytes());
  7112. }
  7113. getUnknownFields().writeTo(output);
  7114. }
  7115. private int memoizedSerializedSize = -1;
  7116. public int getSerializedSize() {
  7117. int size = memoizedSerializedSize;
  7118. if (size != -1) return size;
  7119. size = 0;
  7120. if (((bitField0_ & 0x00000001) == 0x00000001)) {
  7121. size += com.google.protobuf.CodedOutputStream
  7122. .computeEnumSize(1, code_.getNumber());
  7123. }
  7124. if (((bitField0_ & 0x00000002) == 0x00000002)) {
  7125. size += com.google.protobuf.CodedOutputStream
  7126. .computeBytesSize(2, getExplanationBytes());
  7127. }
  7128. size += getUnknownFields().getSerializedSize();
  7129. memoizedSerializedSize = size;
  7130. return size;
  7131. }
  7132. private static final long serialVersionUID = 0L;
  7133. @java.lang.Override
  7134. protected java.lang.Object writeReplace()
  7135. throws java.io.ObjectStreamException {
  7136. return super.writeReplace();
  7137. }
  7138. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
  7139. com.google.protobuf.ByteString data)
  7140. throws com.google.protobuf.InvalidProtocolBufferException {
  7141. return PARSER.parseFrom(data);
  7142. }
  7143. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
  7144. com.google.protobuf.ByteString data,
  7145. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7146. throws com.google.protobuf.InvalidProtocolBufferException {
  7147. return PARSER.parseFrom(data, extensionRegistry);
  7148. }
  7149. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(byte[] data)
  7150. throws com.google.protobuf.InvalidProtocolBufferException {
  7151. return PARSER.parseFrom(data);
  7152. }
  7153. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
  7154. byte[] data,
  7155. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7156. throws com.google.protobuf.InvalidProtocolBufferException {
  7157. return PARSER.parseFrom(data, extensionRegistry);
  7158. }
  7159. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(java.io.InputStream input)
  7160. throws java.io.IOException {
  7161. return PARSER.parseFrom(input);
  7162. }
  7163. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
  7164. java.io.InputStream input,
  7165. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7166. throws java.io.IOException {
  7167. return PARSER.parseFrom(input, extensionRegistry);
  7168. }
  7169. public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(java.io.InputStream input)
  7170. throws java.io.IOException {
  7171. return PARSER.parseDelimitedFrom(input);
  7172. }
  7173. public static org.bitcoin.paymentchannel.Protos.Error parseDelimitedFrom(
  7174. java.io.InputStream input,
  7175. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7176. throws java.io.IOException {
  7177. return PARSER.parseDelimitedFrom(input, extensionRegistry);
  7178. }
  7179. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
  7180. com.google.protobuf.CodedInputStream input)
  7181. throws java.io.IOException {
  7182. return PARSER.parseFrom(input);
  7183. }
  7184. public static org.bitcoin.paymentchannel.Protos.Error parseFrom(
  7185. com.google.protobuf.CodedInputStream input,
  7186. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7187. throws java.io.IOException {
  7188. return PARSER.parseFrom(input, extensionRegistry);
  7189. }
  7190. public static Builder newBuilder() { return Builder.create(); }
  7191. public Builder newBuilderForType() { return newBuilder(); }
  7192. public static Builder newBuilder(org.bitcoin.paymentchannel.Protos.Error prototype) {
  7193. return newBuilder().mergeFrom(prototype);
  7194. }
  7195. public Builder toBuilder() { return newBuilder(this); }
  7196. @java.lang.Override
  7197. protected Builder newBuilderForType(
  7198. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  7199. Builder builder = new Builder(parent);
  7200. return builder;
  7201. }
  7202. /**
  7203. * Protobuf type {@code paymentchannels.Error}
  7204. *
  7205. * <pre>
  7206. * An Error can be sent by either party at any time
  7207. * Both parties should make an effort to send either an ERROR or a CLOSE immediately before
  7208. * closing the socket (unless they just received an ERROR or a CLOSE)
  7209. * </pre>
  7210. */
  7211. public static final class Builder extends
  7212. com.google.protobuf.GeneratedMessage.Builder<Builder>
  7213. implements org.bitcoin.paymentchannel.Protos.ErrorOrBuilder {
  7214. public static final com.google.protobuf.Descriptors.Descriptor
  7215. getDescriptor() {
  7216. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor;
  7217. }
  7218. protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7219. internalGetFieldAccessorTable() {
  7220. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_fieldAccessorTable
  7221. .ensureFieldAccessorsInitialized(
  7222. org.bitcoin.paymentchannel.Protos.Error.class, org.bitcoin.paymentchannel.Protos.Error.Builder.class);
  7223. }
  7224. // Construct using org.bitcoin.paymentchannel.Protos.Error.newBuilder()
  7225. private Builder() {
  7226. maybeForceBuilderInitialization();
  7227. }
  7228. private Builder(
  7229. com.google.protobuf.GeneratedMessage.BuilderParent parent) {
  7230. super(parent);
  7231. maybeForceBuilderInitialization();
  7232. }
  7233. private void maybeForceBuilderInitialization() {
  7234. if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
  7235. }
  7236. }
  7237. private static Builder create() {
  7238. return new Builder();
  7239. }
  7240. public Builder clear() {
  7241. super.clear();
  7242. code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER;
  7243. bitField0_ = (bitField0_ & ~0x00000001);
  7244. explanation_ = "";
  7245. bitField0_ = (bitField0_ & ~0x00000002);
  7246. return this;
  7247. }
  7248. public Builder clone() {
  7249. return create().mergeFrom(buildPartial());
  7250. }
  7251. public com.google.protobuf.Descriptors.Descriptor
  7252. getDescriptorForType() {
  7253. return org.bitcoin.paymentchannel.Protos.internal_static_paymentchannels_Error_descriptor;
  7254. }
  7255. public org.bitcoin.paymentchannel.Protos.Error getDefaultInstanceForType() {
  7256. return org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance();
  7257. }
  7258. public org.bitcoin.paymentchannel.Protos.Error build() {
  7259. org.bitcoin.paymentchannel.Protos.Error result = buildPartial();
  7260. if (!result.isInitialized()) {
  7261. throw newUninitializedMessageException(result);
  7262. }
  7263. return result;
  7264. }
  7265. public org.bitcoin.paymentchannel.Protos.Error buildPartial() {
  7266. org.bitcoin.paymentchannel.Protos.Error result = new org.bitcoin.paymentchannel.Protos.Error(this);
  7267. int from_bitField0_ = bitField0_;
  7268. int to_bitField0_ = 0;
  7269. if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
  7270. to_bitField0_ |= 0x00000001;
  7271. }
  7272. result.code_ = code_;
  7273. if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
  7274. to_bitField0_ |= 0x00000002;
  7275. }
  7276. result.explanation_ = explanation_;
  7277. result.bitField0_ = to_bitField0_;
  7278. onBuilt();
  7279. return result;
  7280. }
  7281. public Builder mergeFrom(com.google.protobuf.Message other) {
  7282. if (other instanceof org.bitcoin.paymentchannel.Protos.Error) {
  7283. return mergeFrom((org.bitcoin.paymentchannel.Protos.Error)other);
  7284. } else {
  7285. super.mergeFrom(other);
  7286. return this;
  7287. }
  7288. }
  7289. public Builder mergeFrom(org.bitcoin.paymentchannel.Protos.Error other) {
  7290. if (other == org.bitcoin.paymentchannel.Protos.Error.getDefaultInstance()) return this;
  7291. if (other.hasCode()) {
  7292. setCode(other.getCode());
  7293. }
  7294. if (other.hasExplanation()) {
  7295. bitField0_ |= 0x00000002;
  7296. explanation_ = other.explanation_;
  7297. onChanged();
  7298. }
  7299. this.mergeUnknownFields(other.getUnknownFields());
  7300. return this;
  7301. }
  7302. public final boolean isInitialized() {
  7303. return true;
  7304. }
  7305. public Builder mergeFrom(
  7306. com.google.protobuf.CodedInputStream input,
  7307. com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  7308. throws java.io.IOException {
  7309. org.bitcoin.paymentchannel.Protos.Error parsedMessage = null;
  7310. try {
  7311. parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
  7312. } catch (com.google.protobuf.InvalidProtocolBufferException e) {
  7313. parsedMessage = (org.bitcoin.paymentchannel.Protos.Error) e.getUnfinishedMessage();
  7314. throw e;
  7315. } finally {
  7316. if (parsedMessage != null) {
  7317. mergeFrom(parsedMessage);
  7318. }
  7319. }
  7320. return this;
  7321. }
  7322. private int bitField0_;
  7323. // optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];
  7324. private org.bitcoin.paymentchannel.Protos.Error.ErrorCode code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER;
  7325. /**
  7326. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  7327. */
  7328. public boolean hasCode() {
  7329. return ((bitField0_ & 0x00000001) == 0x00000001);
  7330. }
  7331. /**
  7332. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  7333. */
  7334. public org.bitcoin.paymentchannel.Protos.Error.ErrorCode getCode() {
  7335. return code_;
  7336. }
  7337. /**
  7338. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  7339. */
  7340. public Builder setCode(org.bitcoin.paymentchannel.Protos.Error.ErrorCode value) {
  7341. if (value == null) {
  7342. throw new NullPointerException();
  7343. }
  7344. bitField0_ |= 0x00000001;
  7345. code_ = value;
  7346. onChanged();
  7347. return this;
  7348. }
  7349. /**
  7350. * <code>optional .paymentchannels.Error.ErrorCode code = 1 [default = OTHER];</code>
  7351. */
  7352. public Builder clearCode() {
  7353. bitField0_ = (bitField0_ & ~0x00000001);
  7354. code_ = org.bitcoin.paymentchannel.Protos.Error.ErrorCode.OTHER;
  7355. onChanged();
  7356. return this;
  7357. }
  7358. // optional string explanation = 2;
  7359. private java.lang.Object explanation_ = "";
  7360. /**
  7361. * <code>optional string explanation = 2;</code>
  7362. *
  7363. * <pre>
  7364. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7365. * </pre>
  7366. */
  7367. public boolean hasExplanation() {
  7368. return ((bitField0_ & 0x00000002) == 0x00000002);
  7369. }
  7370. /**
  7371. * <code>optional string explanation = 2;</code>
  7372. *
  7373. * <pre>
  7374. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7375. * </pre>
  7376. */
  7377. public java.lang.String getExplanation() {
  7378. java.lang.Object ref = explanation_;
  7379. if (!(ref instanceof java.lang.String)) {
  7380. java.lang.String s = ((com.google.protobuf.ByteString) ref)
  7381. .toStringUtf8();
  7382. explanation_ = s;
  7383. return s;
  7384. } else {
  7385. return (java.lang.String) ref;
  7386. }
  7387. }
  7388. /**
  7389. * <code>optional string explanation = 2;</code>
  7390. *
  7391. * <pre>
  7392. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7393. * </pre>
  7394. */
  7395. public com.google.protobuf.ByteString
  7396. getExplanationBytes() {
  7397. java.lang.Object ref = explanation_;
  7398. if (ref instanceof String) {
  7399. com.google.protobuf.ByteString b =
  7400. com.google.protobuf.ByteString.copyFromUtf8(
  7401. (java.lang.String) ref);
  7402. explanation_ = b;
  7403. return b;
  7404. } else {
  7405. return (com.google.protobuf.ByteString) ref;
  7406. }
  7407. }
  7408. /**
  7409. * <code>optional string explanation = 2;</code>
  7410. *
  7411. * <pre>
  7412. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7413. * </pre>
  7414. */
  7415. public Builder setExplanation(
  7416. java.lang.String value) {
  7417. if (value == null) {
  7418. throw new NullPointerException();
  7419. }
  7420. bitField0_ |= 0x00000002;
  7421. explanation_ = value;
  7422. onChanged();
  7423. return this;
  7424. }
  7425. /**
  7426. * <code>optional string explanation = 2;</code>
  7427. *
  7428. * <pre>
  7429. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7430. * </pre>
  7431. */
  7432. public Builder clearExplanation() {
  7433. bitField0_ = (bitField0_ & ~0x00000002);
  7434. explanation_ = getDefaultInstance().getExplanation();
  7435. onChanged();
  7436. return this;
  7437. }
  7438. /**
  7439. * <code>optional string explanation = 2;</code>
  7440. *
  7441. * <pre>
  7442. * NOT SAFE FOR HTML WITHOUT ESCAPING
  7443. * </pre>
  7444. */
  7445. public Builder setExplanationBytes(
  7446. com.google.protobuf.ByteString value) {
  7447. if (value == null) {
  7448. throw new NullPointerException();
  7449. }
  7450. bitField0_ |= 0x00000002;
  7451. explanation_ = value;
  7452. onChanged();
  7453. return this;
  7454. }
  7455. // @@protoc_insertion_point(builder_scope:paymentchannels.Error)
  7456. }
  7457. static {
  7458. defaultInstance = new Error(true);
  7459. defaultInstance.initFields();
  7460. }
  7461. // @@protoc_insertion_point(class_scope:paymentchannels.Error)
  7462. }
  7463. private static com.google.protobuf.Descriptors.Descriptor
  7464. internal_static_paymentchannels_TwoWayChannelMessage_descriptor;
  7465. private static
  7466. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7467. internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable;
  7468. private static com.google.protobuf.Descriptors.Descriptor
  7469. internal_static_paymentchannels_ClientVersion_descriptor;
  7470. private static
  7471. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7472. internal_static_paymentchannels_ClientVersion_fieldAccessorTable;
  7473. private static com.google.protobuf.Descriptors.Descriptor
  7474. internal_static_paymentchannels_ServerVersion_descriptor;
  7475. private static
  7476. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7477. internal_static_paymentchannels_ServerVersion_fieldAccessorTable;
  7478. private static com.google.protobuf.Descriptors.Descriptor
  7479. internal_static_paymentchannels_Initiate_descriptor;
  7480. private static
  7481. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7482. internal_static_paymentchannels_Initiate_fieldAccessorTable;
  7483. private static com.google.protobuf.Descriptors.Descriptor
  7484. internal_static_paymentchannels_ProvideRefund_descriptor;
  7485. private static
  7486. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7487. internal_static_paymentchannels_ProvideRefund_fieldAccessorTable;
  7488. private static com.google.protobuf.Descriptors.Descriptor
  7489. internal_static_paymentchannels_ReturnRefund_descriptor;
  7490. private static
  7491. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7492. internal_static_paymentchannels_ReturnRefund_fieldAccessorTable;
  7493. private static com.google.protobuf.Descriptors.Descriptor
  7494. internal_static_paymentchannels_ProvideContract_descriptor;
  7495. private static
  7496. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7497. internal_static_paymentchannels_ProvideContract_fieldAccessorTable;
  7498. private static com.google.protobuf.Descriptors.Descriptor
  7499. internal_static_paymentchannels_UpdatePayment_descriptor;
  7500. private static
  7501. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7502. internal_static_paymentchannels_UpdatePayment_fieldAccessorTable;
  7503. private static com.google.protobuf.Descriptors.Descriptor
  7504. internal_static_paymentchannels_Close_descriptor;
  7505. private static
  7506. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7507. internal_static_paymentchannels_Close_fieldAccessorTable;
  7508. private static com.google.protobuf.Descriptors.Descriptor
  7509. internal_static_paymentchannels_Error_descriptor;
  7510. private static
  7511. com.google.protobuf.GeneratedMessage.FieldAccessorTable
  7512. internal_static_paymentchannels_Error_fieldAccessorTable;
  7513. public static com.google.protobuf.Descriptors.FileDescriptor
  7514. getDescriptor() {
  7515. return descriptor;
  7516. }
  7517. private static com.google.protobuf.Descriptors.FileDescriptor
  7518. descriptor;
  7519. static {
  7520. java.lang.String[] descriptorData = {
  7521. "\n\024paymentchannel.proto\022\017paymentchannels\"" +
  7522. "\343\005\n\024TwoWayChannelMessage\022?\n\004type\030\001 \002(\01621" +
  7523. ".paymentchannels.TwoWayChannelMessage.Me" +
  7524. "ssageType\0226\n\016client_version\030\002 \001(\0132\036.paym" +
  7525. "entchannels.ClientVersion\0226\n\016server_vers" +
  7526. "ion\030\003 \001(\0132\036.paymentchannels.ServerVersio" +
  7527. "n\022+\n\010initiate\030\004 \001(\0132\031.paymentchannels.In" +
  7528. "itiate\0226\n\016provide_refund\030\005 \001(\0132\036.payment" +
  7529. "channels.ProvideRefund\0224\n\rreturn_refund\030" +
  7530. "\006 \001(\0132\035.paymentchannels.ReturnRefund\022:\n\020",
  7531. "provide_contract\030\007 \001(\0132 .paymentchannels" +
  7532. ".ProvideContract\0226\n\016update_payment\030\010 \001(\013" +
  7533. "2\036.paymentchannels.UpdatePayment\022%\n\005clos" +
  7534. "e\030\t \001(\0132\026.paymentchannels.Close\022%\n\005error" +
  7535. "\030\n \001(\0132\026.paymentchannels.Error\"\274\001\n\013Messa" +
  7536. "geType\022\022\n\016CLIENT_VERSION\020\001\022\022\n\016SERVER_VER" +
  7537. "SION\020\002\022\014\n\010INITIATE\020\003\022\022\n\016PROVIDE_REFUND\020\004" +
  7538. "\022\021\n\rRETURN_REFUND\020\005\022\024\n\020PROVIDE_CONTRACT\020" +
  7539. "\006\022\020\n\014CHANNEL_OPEN\020\007\022\022\n\016UPDATE_PAYMENT\020\010\022" +
  7540. "\t\n\005CLOSE\020\t\022\t\n\005ERROR\020\n\"X\n\rClientVersion\022\r",
  7541. "\n\005major\030\001 \002(\005\022\020\n\005minor\030\002 \001(\005:\0010\022&\n\036previ" +
  7542. "ous_channel_contract_hash\030\003 \001(\014\"0\n\rServe" +
  7543. "rVersion\022\r\n\005major\030\001 \002(\005\022\020\n\005minor\030\002 \001(\005:\001" +
  7544. "0\"]\n\010Initiate\022\024\n\014multisig_key\030\001 \002(\014\022!\n\031m" +
  7545. "in_accepted_channel_size\030\002 \002(\004\022\030\n\020expire" +
  7546. "_time_secs\030\003 \002(\004\"1\n\rProvideRefund\022\024\n\014mul" +
  7547. "tisig_key\030\001 \002(\014\022\n\n\002tx\030\002 \002(\014\"!\n\014ReturnRef" +
  7548. "und\022\021\n\tsignature\030\001 \002(\014\"\035\n\017ProvideContrac" +
  7549. "t\022\n\n\002tx\030\001 \002(\014\"?\n\rUpdatePayment\022\033\n\023client" +
  7550. "_change_value\030\001 \002(\004\022\021\n\tsignature\030\002 \002(\014\"\023",
  7551. "\n\005Close\022\n\n\002tx\030\003 \002(\014\"\363\001\n\005Error\0225\n\004code\030\001 " +
  7552. "\001(\0162 .paymentchannels.Error.ErrorCode:\005O" +
  7553. "THER\022\023\n\013explanation\030\002 \001(\t\"\235\001\n\tErrorCode\022" +
  7554. "\013\n\007TIMEOUT\020\001\022\020\n\014SYNTAX_ERROR\020\002\022\031\n\025NO_ACC" +
  7555. "EPTABLE_VERSION\020\003\022\023\n\017BAD_TRANSACTION\020\004\022\031" +
  7556. "\n\025TIME_WINDOW_TOO_LARGE\020\005\022\033\n\027CHANNEL_VAL" +
  7557. "UE_TOO_LARGE\020\006\022\t\n\005OTHER\020\007B$\n\032org.bitcoin" +
  7558. ".paymentchannelB\006Protos"
  7559. };
  7560. com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
  7561. new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
  7562. public com.google.protobuf.ExtensionRegistry assignDescriptors(
  7563. com.google.protobuf.Descriptors.FileDescriptor root) {
  7564. descriptor = root;
  7565. internal_static_paymentchannels_TwoWayChannelMessage_descriptor =
  7566. getDescriptor().getMessageTypes().get(0);
  7567. internal_static_paymentchannels_TwoWayChannelMessage_fieldAccessorTable = new
  7568. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7569. internal_static_paymentchannels_TwoWayChannelMessage_descriptor,
  7570. new java.lang.String[] { "Type", "ClientVersion", "ServerVersion", "Initiate", "ProvideRefund", "ReturnRefund", "ProvideContract", "UpdatePayment", "Close", "Error", });
  7571. internal_static_paymentchannels_ClientVersion_descriptor =
  7572. getDescriptor().getMessageTypes().get(1);
  7573. internal_static_paymentchannels_ClientVersion_fieldAccessorTable = new
  7574. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7575. internal_static_paymentchannels_ClientVersion_descriptor,
  7576. new java.lang.String[] { "Major", "Minor", "PreviousChannelContractHash", });
  7577. internal_static_paymentchannels_ServerVersion_descriptor =
  7578. getDescriptor().getMessageTypes().get(2);
  7579. internal_static_paymentchannels_ServerVersion_fieldAccessorTable = new
  7580. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7581. internal_static_paymentchannels_ServerVersion_descriptor,
  7582. new java.lang.String[] { "Major", "Minor", });
  7583. internal_static_paymentchannels_Initiate_descriptor =
  7584. getDescriptor().getMessageTypes().get(3);
  7585. internal_static_paymentchannels_Initiate_fieldAccessorTable = new
  7586. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7587. internal_static_paymentchannels_Initiate_descriptor,
  7588. new java.lang.String[] { "MultisigKey", "MinAcceptedChannelSize", "ExpireTimeSecs", });
  7589. internal_static_paymentchannels_ProvideRefund_descriptor =
  7590. getDescriptor().getMessageTypes().get(4);
  7591. internal_static_paymentchannels_ProvideRefund_fieldAccessorTable = new
  7592. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7593. internal_static_paymentchannels_ProvideRefund_descriptor,
  7594. new java.lang.String[] { "MultisigKey", "Tx", });
  7595. internal_static_paymentchannels_ReturnRefund_descriptor =
  7596. getDescriptor().getMessageTypes().get(5);
  7597. internal_static_paymentchannels_ReturnRefund_fieldAccessorTable = new
  7598. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7599. internal_static_paymentchannels_ReturnRefund_descriptor,
  7600. new java.lang.String[] { "Signature", });
  7601. internal_static_paymentchannels_ProvideContract_descriptor =
  7602. getDescriptor().getMessageTypes().get(6);
  7603. internal_static_paymentchannels_ProvideContract_fieldAccessorTable = new
  7604. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7605. internal_static_paymentchannels_ProvideContract_descriptor,
  7606. new java.lang.String[] { "Tx", });
  7607. internal_static_paymentchannels_UpdatePayment_descriptor =
  7608. getDescriptor().getMessageTypes().get(7);
  7609. internal_static_paymentchannels_UpdatePayment_fieldAccessorTable = new
  7610. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7611. internal_static_paymentchannels_UpdatePayment_descriptor,
  7612. new java.lang.String[] { "ClientChangeValue", "Signature", });
  7613. internal_static_paymentchannels_Close_descriptor =
  7614. getDescriptor().getMessageTypes().get(8);
  7615. internal_static_paymentchannels_Close_fieldAccessorTable = new
  7616. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7617. internal_static_paymentchannels_Close_descriptor,
  7618. new java.lang.String[] { "Tx", });
  7619. internal_static_paymentchannels_Error_descriptor =
  7620. getDescriptor().getMessageTypes().get(9);
  7621. internal_static_paymentchannels_Error_fieldAccessorTable = new
  7622. com.google.protobuf.GeneratedMessage.FieldAccessorTable(
  7623. internal_static_paymentchannels_Error_descriptor,
  7624. new java.lang.String[] { "Code", "Explanation", });
  7625. return null;
  7626. }
  7627. };
  7628. com.google.protobuf.Descriptors.FileDescriptor
  7629. .internalBuildGeneratedFileFrom(descriptorData,
  7630. new com.google.protobuf.Descriptors.FileDescriptor[] {
  7631. }, assigner);
  7632. }
  7633. // @@protoc_insertion_point(outer_class_scope)
  7634. }