X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelMonitor.java;fp=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelMonitor.java;h=df8456c3bdb2b9f092775ddff8b7cb305d146fad;hb=a7653cf8717b1f9df4d3f4c4bd0b1f50f3bbc230;hp=75d8140babefbd9902959af8cf86be431d5461b0;hpb=fcf4198defb48c5fa122ece7f5e922d22bbeb813;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index 75d8140b..df8456c3 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -223,7 +223,6 @@ public class ChannelMonitor extends CommonBase { // Warning: We may not free the C tuple object! ret_conv_46_arr[u] = ret_conv_46_conv; } - /* TODO 2 TwoTuple */; this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); @@ -273,7 +272,6 @@ public class ChannelMonitor extends CommonBase { // Warning: We may not free the C tuple object! ret_conv_46_arr[u] = ret_conv_46_conv; } - /* TODO 2 TwoTuple */; this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); @@ -353,4 +351,32 @@ public class ChannelMonitor extends CommonBase { return ret_hu_conv; } + /** + * Gets the balances in this channel which are either claimable by us if we were to + * force-close the channel now or which are claimable on-chain (possibly awaiting + * confirmation). + * + * Any balances in the channel which are available on-chain (excluding on-chain fees) are + * included here until an [`Event::SpendableOutputs`] event has been generated for the + * balance, or until our counterparty has claimed the balance and accrued several + * confirmations on the claim transaction. + * + * Note that the balances available when you or your counterparty have broadcasted revoked + * state(s) may not be fully captured here. + * + * See [`Balance`] for additional details on the types of claimable balances which + * may be returned here and their meanings. + */ + public Balance[] get_claimable_balances() { + long[] ret = bindings.ChannelMonitor_get_claimable_balances(this.ptr); + Balance[] ret_conv_9_arr = new Balance[ret.length]; + for (int j = 0; j < ret.length; j++) { + long ret_conv_9 = ret[j]; + Balance ret_conv_9_hu_conv = Balance.constr_from_ptr(ret_conv_9); + ret_conv_9_hu_conv.ptrs_to.add(this); + ret_conv_9_arr[j] = ret_conv_9_hu_conv; + } + return ret_conv_9_arr; + } + }