bindings.LDKBroadcasterInterface broad_trait;
bindings.LDKLogger log_trait;
bindings.LDKWatch watcher;
- ArrayList<Long> results_to_free;
Peer(byte seed) {
this.log_trait = (String arg)-> System.out.println(seed + ": " + arg);
this.broad_trait = tx -> {
// We should broadcast
};
- this.results_to_free = new ArrayList<>();
this.tx_broadcaster = bindings.LDKBroadcasterInterface_new(this.broad_trait);
this.monitors = new HashMap<>();
this.watcher = new bindings.LDKWatch() {
assert monitors.put(Arrays.toString(bindings.OutPoint_get_txid(funding_txo)), monitor) == null;
}
bindings.OutPoint_free(funding_txo);
- long res = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
- results_to_free.add(res);
- return res;
+ return bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
}
@Override
}
bindings.OutPoint_free(funding_txo);
bindings.ChannelMonitorUpdate_free(update);
- long res = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
- results_to_free.add(res);
- return res;
+ return bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
}
@Override
bindings.ChannelMonitor_free(mon);
}
}
- for (Long res : results_to_free) {
- bindings.CResult_NoneChannelMonitorUpdateErrZ_free(res);
- }
}
}