1 package org.ldk.structs;
3 import org.ldk.impl.bindings;
4 import org.ldk.enums.*;
6 import java.util.Arrays;
10 * Proof that the sender knows the per-commitment secret of the previous commitment transaction.
11 * This is used to convince the recipient that the channel is at a certain commitment
12 * number even if they lost that data due to a local failure. Of course, the peer may lie
13 * and even later commitments may have been revoked.
15 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
16 public class DataLossProtect extends CommonBase {
17 DataLossProtect(Object _dummy, long ptr) { super(ptr); }
18 @Override @SuppressWarnings("deprecation")
19 protected void finalize() throws Throwable {
21 if (ptr != 0) { bindings.DataLossProtect_free(ptr); }
25 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
26 * belonging to the recipient
28 public byte[] get_your_last_per_commitment_secret() {
29 byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr);
34 * Proof that the sender knows the per-commitment secret of a specific commitment transaction
35 * belonging to the recipient
37 public void set_your_last_per_commitment_secret(byte[] val) {
38 bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, val);
42 * The sender's per-commitment point for their current commitment transaction
44 public byte[] get_my_current_per_commitment_point() {
45 byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr);
50 * The sender's per-commitment point for their current commitment transaction
52 public void set_my_current_per_commitment_point(byte[] val) {
53 bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, val);
57 * Constructs a new DataLossProtect given each field
59 public static DataLossProtect constructor_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) {
60 long ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg);
61 DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
62 ret_hu_conv.ptrs_to.add(ret_hu_conv);
67 * Creates a copy of the DataLossProtect
69 public DataLossProtect clone() {
70 long ret = bindings.DataLossProtect_clone(this.ptr);
71 DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
72 ret_hu_conv.ptrs_to.add(this);