X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FReceiveTlvs.java;h=9b095526acb9608d7fb3b74113d32a464e11ed13;hb=ffdd56c967087cba7548599934585b8a9a3102e2;hp=292fdfe5061edbdc3b52c6897849235afade468f;hpb=7811d2191440c55034e1abfbf3be442d4b25481b;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ReceiveTlvs.java b/src/main/java/org/ldk/structs/ReceiveTlvs.java index 292fdfe5..9b095526 100644 --- a/src/main/java/org/ldk/structs/ReceiveTlvs.java +++ b/src/main/java/org/ldk/structs/ReceiveTlvs.java @@ -55,7 +55,29 @@ public class ReceiveTlvs extends CommonBase { * Constraints for the receiver of this payment. */ public void set_payment_constraints(org.ldk.structs.PaymentConstraints val) { - bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val == null ? 0 : val.ptr); + bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; + } + + /** + * Context for the receiver of this payment. + */ + public PaymentContext get_payment_context() { + long ret = bindings.ReceiveTlvs_get_payment_context(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Context for the receiver of this payment. + */ + public void set_payment_context(org.ldk.structs.PaymentContext val) { + bindings.ReceiveTlvs_set_payment_context(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); if (this != null) { this.ptrs_to.add(val); }; @@ -64,14 +86,16 @@ public class ReceiveTlvs extends CommonBase { /** * Constructs a new ReceiveTlvs given each field */ - public static ReceiveTlvs of(byte[] payment_secret_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg) { - long ret = bindings.ReceiveTlvs_new(InternalUtils.check_arr_len(payment_secret_arg, 32), payment_constraints_arg == null ? 0 : payment_constraints_arg.ptr); + public static ReceiveTlvs of(byte[] payment_secret_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.PaymentContext payment_context_arg) { + long ret = bindings.ReceiveTlvs_new(InternalUtils.check_arr_len(payment_secret_arg, 32), payment_constraints_arg.ptr, payment_context_arg.ptr); Reference.reachabilityFence(payment_secret_arg); Reference.reachabilityFence(payment_constraints_arg); + Reference.reachabilityFence(payment_context_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ReceiveTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReceiveTlvs(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_constraints_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(payment_context_arg); }; return ret_hu_conv; } @@ -102,15 +126,4 @@ public class ReceiveTlvs extends CommonBase { return ret; } - /** - * Read a ReceiveTlvs from a byte array, created by ReceiveTlvs_write - */ - public static Result_ReceiveTlvsDecodeErrorZ read(byte[] ser) { - long ret = bindings.ReceiveTlvs_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_ReceiveTlvsDecodeErrorZ ret_hu_conv = Result_ReceiveTlvsDecodeErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - }