- public void block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
- bindings.ChainMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height);
- /* TODO 2 TwoTuple<Long, byte[]> */;
+ public static ChainMonitor of(Option_FilterZ chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
+ long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
+ Reference.reachabilityFence(chain_source);
+ Reference.reachabilityFence(broadcaster);
+ Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(feeest);
+ Reference.reachabilityFence(persister);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ ChainMonitor ret_hu_conv = null; if (ret < 0 || ret > 4096) { 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;