Reference.reachabilityFence(logger);
Reference.reachabilityFence(custom_message_handler);
if (ret >= 0 && ret <= 4096) { return null; }
- PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PeerManager(null, ret); }
- ret_hu_conv.ptrs_to.add(ret_hu_conv);
- ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg);
- ret_hu_conv.ptrs_to.add(message_handler_route_handler_arg);
- ret_hu_conv.ptrs_to.add(logger);
- ret_hu_conv.ptrs_to.add(custom_message_handler);
+ org.ldk.structs.PeerManager ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerManager(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(message_handler_route_handler_arg); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_message_handler); };
return ret_hu_conv;
}
* peer using the init message.
* The user should pass the remote network address of the host they are connected to.
*
- * Note that if an Err is returned here you MUST NOT call socket_disconnected for the new
- * descriptor but must disconnect the connection immediately.
+ * If an `Err` is returned here you must disconnect the connection immediately.
*
* Returns a small number of bytes to send to the remote node (currently always 50).
*
Reference.reachabilityFence(remote_network_address);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
- this.ptrs_to.add(descriptor);
+ if (this != null) { this.ptrs_to.add(descriptor); };
return ret_hu_conv;
}
* The user should pass the remote network address of the host they are connected to.
*
* May refuse the connection by returning an Err, but will never write bytes to the remote end
- * (outbound connector always speaks first). Note that if an Err is returned here you MUST NOT
- * call socket_disconnected for the new descriptor but must disconnect the connection
- * immediately.
+ * (outbound connector always speaks first). If an `Err` is returned here you must disconnect
+ * the connection immediately.
*
* Panics if descriptor is duplicative with some other descriptor which has not yet been
* [`socket_disconnected()`].
Reference.reachabilityFence(remote_network_address);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
- this.ptrs_to.add(descriptor);
+ if (this != null) { this.ptrs_to.add(descriptor); };
return ret_hu_conv;
}
* You don't have to call this function explicitly if you are using [`lightning-net-tokio`]
* or one of the other clients provided in our language bindings.
*
+ * Note that if there are any other calls to this function waiting on lock(s) this may return
+ * without doing any work. All available events that need handling will be handled before the
+ * other calls return.
+ *
* [`send_payment`]: crate::ln::channelmanager::ChannelManager::send_payment
* [`ChannelManager::process_pending_htlc_forwards`]: crate::ln::channelmanager::ChannelManager::process_pending_htlc_forwards
* [`send_data`]: SocketDescriptor::send_data