X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FFilesystemPersister.java;h=753d4e0cf95291e7d750b97ea479f697f5f7c698;hb=5e9de82b3a7712a41189756d9d16d946142b2ac5;hp=a274e07b1553e8a05bfd745b291f050dfbdbb3c5;hpb=1854b5cebef22ace9e9e4dd191f609818df9ce08;p=ldk-java diff --git a/src/main/java/org/ldk/structs/FilesystemPersister.java b/src/main/java/org/ldk/structs/FilesystemPersister.java index a274e07b..753d4e0c 100644 --- a/src/main/java/org/ldk/structs/FilesystemPersister.java +++ b/src/main/java/org/ldk/structs/FilesystemPersister.java @@ -39,8 +39,8 @@ public class FilesystemPersister extends CommonBase { long ret = bindings.FilesystemPersister_new(path_to_channel_data); Reference.reachabilityFence(path_to_channel_data); if (ret >= 0 && ret <= 4096) { return null; } - FilesystemPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new FilesystemPersister(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); + org.ldk.structs.FilesystemPersister ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FilesystemPersister(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -62,20 +62,7 @@ public class FilesystemPersister extends CommonBase { Reference.reachabilityFence(keys_manager); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret); - this.ptrs_to.add(keys_manager); - return ret_hu_conv; - } - - /** - * Constructs a new Persist which calls the relevant methods on this_arg. - * This copies the `inner` pointer in this_arg and thus the returned Persist must be freed before this_arg is - */ - public Persist as_Persist() { - long ret = bindings.FilesystemPersister_as_Persist(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Persist ret_hu_conv = new Persist(null, ret); - ret_hu_conv.ptrs_to.add(this); + if (this != null) { this.ptrs_to.add(keys_manager); }; return ret_hu_conv; }