* inclusion in the return value.
*/
public Balance[] get_claimable_balances(ChannelDetails[] ignored_channels) {
- long[] ret = bindings.ChainMonitor_get_claimable_balances(this.ptr, ignored_channels != null ? Arrays.stream(ignored_channels).mapToLong(ignored_channels_conv_16 -> ignored_channels_conv_16 == null ? 0 : ignored_channels_conv_16.ptr).toArray() : null);
+ long[] ret = bindings.ChainMonitor_get_claimable_balances(this.ptr, ignored_channels != null ? Arrays.stream(ignored_channels).mapToLong(ignored_channels_conv_16 -> ignored_channels_conv_16.ptr).toArray() : null);
Reference.reachabilityFence(this);
Reference.reachabilityFence(ignored_channels);
int ret_conv_9_len = ret.length;
* indefinitely.
*/
public Result_LockedChannelMonitorNoneZ get_monitor(org.ldk.structs.OutPoint funding_txo) {
- long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : funding_txo.ptr);
+ long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(funding_txo);
if (ret >= 0 && ret <= 4096) { return null; }
}
/**
- * Lists the funding outpoint of each [`ChannelMonitor`] being monitored.
+ * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored.
*
* Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always
* monitoring for on-chain state resolutions.
*/
- public OutPoint[] list_monitors() {
+ public TwoTuple_OutPointChannelIdZ[] list_monitors() {
long[] ret = bindings.ChainMonitor_list_monitors(this.ptr);
Reference.reachabilityFence(this);
- int ret_conv_10_len = ret.length;
- OutPoint[] ret_conv_10_arr = new OutPoint[ret_conv_10_len];
- for (int k = 0; k < ret_conv_10_len; k++) {
- long ret_conv_10 = ret[k];
- org.ldk.structs.OutPoint ret_conv_10_hu_conv = null; if (ret_conv_10 < 0 || ret_conv_10 > 4096) { ret_conv_10_hu_conv = new org.ldk.structs.OutPoint(null, ret_conv_10); }
- if (ret_conv_10_hu_conv != null) { ret_conv_10_hu_conv.ptrs_to.add(this); };
- ret_conv_10_arr[k] = ret_conv_10_hu_conv;
+ int ret_conv_29_len = ret.length;
+ TwoTuple_OutPointChannelIdZ[] ret_conv_29_arr = new TwoTuple_OutPointChannelIdZ[ret_conv_29_len];
+ for (int d = 0; d < ret_conv_29_len; d++) {
+ long ret_conv_29 = ret[d];
+ TwoTuple_OutPointChannelIdZ ret_conv_29_hu_conv = new TwoTuple_OutPointChannelIdZ(null, ret_conv_29);
+ if (ret_conv_29_hu_conv != null) { ret_conv_29_hu_conv.ptrs_to.add(this); };
+ ret_conv_29_arr[d] = ret_conv_29_hu_conv;
}
- return ret_conv_10_arr;
+ return ret_conv_29_arr;
}
/**
* registered [`ChannelMonitor`]s.
*/
public Result_NoneAPIErrorZ channel_monitor_updated(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.MonitorUpdateId completed_update_id) {
- long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, completed_update_id == null ? 0 : completed_update_id.ptr);
+ long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo.ptr, completed_update_id.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(funding_txo);
Reference.reachabilityFence(completed_update_id);
Reference.reachabilityFence(this);
}
+ /**
+ * Triggers rebroadcasts of pending claims from force-closed channels after a transaction
+ * signature generation failure.
+ *
+ * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor.
+ *
+ * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ public void signer_unblocked(@Nullable org.ldk.structs.OutPoint monitor_opt) {
+ bindings.ChainMonitor_signer_unblocked(this.ptr, monitor_opt == null ? 0 : monitor_opt.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(monitor_opt);
+ if (this != null) { this.ptrs_to.add(monitor_opt); };
+ }
+
+ /**
+ * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`].
+ *
+ * This is useful for pruning fully resolved monitors from the monitor set and primary
+ * storage so they are not kept in memory and reloaded on restart.
+ *
+ * Should be called occasionally (once every handful of blocks or on startup).
+ *
+ * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor
+ * data could be moved to an archive location or removed entirely.
+ */
+ public void archive_fully_resolved_channel_monitors() {
+ bindings.ChainMonitor_archive_fully_resolved_channel_monitors(this.ptr);
+ Reference.reachabilityFence(this);
+ }
+
/**
* Constructs a new Listen which calls the relevant methods on this_arg.
* This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is