X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fstructs%2FChannelMonitor.ts;h=8baaf1897141c0c97ad929fc4d825284bcf7b22f;hb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;hp=9c3bc931c38090ebffef8134e28289e1e7064a48;hpb=22f5f4208b1f3b5542292250f1612b944f5cd7fd;p=ldk-java diff --git a/ts/structs/ChannelMonitor.ts b/ts/structs/ChannelMonitor.ts index 9c3bc931..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; @@ -87,7 +96,7 @@ import * as bindings from '../bindings' // TODO: figure out location for (int z = 0; z < arr_conv_49_b.length; z++) { number arr_conv_25 = arr_conv_49_b[z]; number arr_conv_25_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_25); - number arr_conv_25_b = bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_25); + number arr_conv_25_b = bindings.TxOut_clone(bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_25)); TxOut arr_conv_25_b_conv = new TxOut(null, arr_conv_25_b);; TwoTuple arr_conv_25_conv = new TwoTuple(arr_conv_25_a, arr_conv_25_b_conv); arr_conv_25_arr[z] = arr_conv_25_conv;