* Returns the list of channels in the graph
*/
public long[] list_channels() {
- long[] ret = bindings.ReadOnlyNetworkGraph_list_channels(this.ptr);
+ long ret = bindings.ReadOnlyNetworkGraph_list_channels(this.ptr);
GC.KeepAlive(this);
- return ret;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ long[] ret_conv = InternalUtils.decodeUint64Array(ret);
+ return ret_conv;
}
/**
* Returns the list of nodes in the graph
*/
public NodeId[] list_nodes() {
- long[] ret = bindings.ReadOnlyNetworkGraph_list_nodes(this.ptr);
+ long ret = bindings.ReadOnlyNetworkGraph_list_nodes(this.ptr);
GC.KeepAlive(this);
- int ret_conv_8_len = ret.Length;
+ if (ret >= 0 && ret <= 4096) { return null; }
+ int ret_conv_8_len = InternalUtils.getArrayLength(ret);
NodeId[] ret_conv_8_arr = new NodeId[ret_conv_8_len];
for (int i = 0; i < ret_conv_8_len; i++) {
- long ret_conv_8 = ret[i];
+ long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i);
org.ldk.structs.NodeId ret_conv_8_hu_conv = null; if (ret_conv_8 < 0 || ret_conv_8 > 4096) { ret_conv_8_hu_conv = new org.ldk.structs.NodeId(null, ret_conv_8); }
if (ret_conv_8_hu_conv != null) { ret_conv_8_hu_conv.ptrs_to.AddLast(this); };
ret_conv_8_arr[i] = ret_conv_8_hu_conv;
}
+ bindings.free_buffer(ret);
return ret_conv_8_arr;
}
* Returns None if the requested node is completely unknown,
* or if node announcement for the node was never received.
*/
- public Option_CVec_NetAddressZZ get_addresses(byte[] pubkey) {
- long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, InternalUtils.check_arr_len(pubkey, 33));
+ public Option_CVec_SocketAddressZZ get_addresses(byte[] pubkey) {
+ long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey, 33)));
GC.KeepAlive(this);
GC.KeepAlive(pubkey);
if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.Option_CVec_NetAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_NetAddressZZ.constr_from_ptr(ret);
+ org.ldk.structs.Option_CVec_SocketAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_SocketAddressZZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
return ret_hu_conv;
}