+ /**
+ * Because much of the lightning network does not yet support forwarding onion messages, we
+ * may need to directly connect to a node which will forward a message for us. In such a case,
+ * this method will return the set of nodes which need connection by node_id and the
+ * corresponding socket addresses where they may accept incoming connections.
+ *
+ * Thus, this method should be polled regularly to detect messages await such a direct
+ * connection.
+ */
+ public TwoTuple_PublicKeyCVec_SocketAddressZZ[] get_and_clear_connections_needed() {
+ long ret = bindings.OnionMessageHandler_get_and_clear_connections_needed(this.ptr);
+ GC.KeepAlive(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ int ret_conv_40_len = InternalUtils.getArrayLength(ret);
+ TwoTuple_PublicKeyCVec_SocketAddressZZ[] ret_conv_40_arr = new TwoTuple_PublicKeyCVec_SocketAddressZZ[ret_conv_40_len];
+ for (int o = 0; o < ret_conv_40_len; o++) {
+ long ret_conv_40 = InternalUtils.getU64ArrayElem(ret, o);
+ TwoTuple_PublicKeyCVec_SocketAddressZZ ret_conv_40_hu_conv = new TwoTuple_PublicKeyCVec_SocketAddressZZ(null, ret_conv_40);
+ if (ret_conv_40_hu_conv != null) { ret_conv_40_hu_conv.ptrs_to.AddLast(this); };
+ ret_conv_40_arr[o] = ret_conv_40_hu_conv;
+ }
+ bindings.free_buffer(ret);
+ return ret_conv_40_arr;
+ }
+