+ super.finalize();
+ if (ptr != 0) { bindings.ChainMonitor_free(ptr); }
+ }
+
+ /**
+ * Creates a new `ChainMonitor` used to watch on-chain activity pertaining to channels.
+ *
+ * When an optional chain source implementing [`chain::Filter`] is provided, the chain monitor
+ * will call back to it indicating transactions and outputs of interest. This allows clients to
+ * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
+ * always need to fetch full blocks absent another means for determining which blocks contain
+ * transactions relevant to the watched channels.
+ */
+ public static ChainMonitor of(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
+ long ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
+ ChainMonitor ret_hu_conv = new ChainMonitor(null, ret);
+ ret_hu_conv.ptrs_to.add(ret_hu_conv);
+ ret_hu_conv.ptrs_to.add(chain_source);
+ ret_hu_conv.ptrs_to.add(broadcaster);
+ ret_hu_conv.ptrs_to.add(logger);
+ ret_hu_conv.ptrs_to.add(feeest);
+ ret_hu_conv.ptrs_to.add(persister);
+ return ret_hu_conv;