X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPersist.java;h=57e740669264bc57958c727a220d93682eb3289c;hb=b9716bc7ee492882e4643c9365971fef3761989f;hp=ebb48ed949b9376c752cad1126a915a82c7e299e;hpb=1b870a3ffab1c0024411e30102bc6d198300f095;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index ebb48ed9..57e74066 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; /** * `Persist` defines behavior for persisting channel monitors: this could mean @@ -40,11 +41,8 @@ public class Persist extends CommonBase { * stored channel data). Note that you **must** persist every new monitor to * disk. See the `Persist` trait documentation for more details. * - * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`, * and [`ChannelMonitorUpdateErr`] for requirements when returning errors. - * - * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk - * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html */ Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data); /** @@ -67,14 +65,9 @@ public class Persist extends CommonBase { * them in batches. The size of each monitor grows `O(number of state updates)` * whereas updates are small and `O(1)`. * - * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`, * [`ChannelMonitorUpdate::write`] for writing out an update, and * [`ChannelMonitorUpdateErr`] for requirements when returning errors. - * - * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1 - * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk - * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write - * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html */ Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data); } @@ -109,14 +102,12 @@ public class Persist extends CommonBase { * stored channel data). Note that you **must** persist every new monitor to * disk. See the `Persist` trait documentation for more details. * - * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`, * and [`ChannelMonitorUpdateErr`] for requirements when returning errors. - * - * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk - * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html */ public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data) { long ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1); + if (ret < 1024) { return null; } Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); this.ptrs_to.add(id); this.ptrs_to.add(data); @@ -143,17 +134,13 @@ public class Persist extends CommonBase { * them in batches. The size of each monitor grows `O(number of state updates)` * whereas updates are small and `O(1)`. * - * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`, + * See [`ChannelMonitor::write`] for writing out a `ChannelMonitor`, * [`ChannelMonitorUpdate::write`] for writing out an update, and * [`ChannelMonitorUpdateErr`] for requirements when returning errors. - * - * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1 - * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk - * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write - * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html */ public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data) { long ret = bindings.Persist_update_persisted_channel(this.ptr, id == null ? 0 : id.ptr & ~1, update == null ? 0 : update.ptr & ~1, data == null ? 0 : data.ptr & ~1); + if (ret < 1024) { return null; } Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); this.ptrs_to.add(id); this.ptrs_to.add(update);