X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelMonitor.ts;fp=ts%2Fstructs%2FChannelMonitor.ts;h=8baaf1897141c0c97ad929fc4d825284bcf7b22f;hb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;hp=96bf8c5bf1d5418d96e51d8b5ee2912aecd935fd;hpb=e9c2970adecaa14b3e83e11eb160a7bcbdae20da;p=ldk-java diff --git a/ts/structs/ChannelMonitor.ts b/ts/structs/ChannelMonitor.ts index 96bf8c5b..8baaf189 100644 --- a/ts/structs/ChannelMonitor.ts +++ b/ts/structs/ChannelMonitor.ts @@ -18,6 +18,13 @@ import * as bindings from '../bindings' // TODO: figure out location bindings.ChannelMonitor_free(this.ptr); } } + public ChannelMonitor clone() { + number ret = bindings.ChannelMonitor_clone(this.ptr); + const ret_hu_conv: ChannelMonitor = new ChannelMonitor(null, ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + public Uint8Array write() { Uint8Array ret = bindings.ChannelMonitor_write(this.ptr); return ret; @@ -41,7 +48,8 @@ import * as bindings from '../bindings' // TODO: figure out location public TwoTuple get_funding_txo() { number ret = bindings.ChannelMonitor_get_funding_txo(this.ptr); number ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret); - const ret_a_hu_conv: OutPoint = new OutPoint(null, ret_a);; + const ret_a_hu_conv: OutPoint = new OutPoint(null, ret_a); + ret_a_hu_conv.ptrs_to.add(this);; Uint8Array ret_b = bindings.LDKC2Tuple_OutPointScriptZ_get_b(ret); TwoTuple ret_conv = new TwoTuple(ret_a_hu_conv, ret_b); return ret_conv; @@ -53,6 +61,7 @@ import * as bindings from '../bindings' // TODO: figure out location for (int o = 0; o < ret.length; o++) { number arr_conv_14 = ret[o]; const arr_conv_14_hu_conv: MonitorEvent = new MonitorEvent(null, arr_conv_14); + arr_conv_14_hu_conv.ptrs_to.add(this); arr_conv_14_arr[o] = arr_conv_14_hu_conv; } return arr_conv_14_arr;