[Java] Update auto-generated Java structs
[ldk-java] / src / main / java / org / ldk / structs / PeerManager.java
index e41024f8ed7b6397687d8a0748103959b8a56cee..70591023eecf3ae63b3077cf61c8973505991651 100644 (file)
@@ -52,12 +52,12 @@ public class PeerManager extends CommonBase {
                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;
        }
 
@@ -82,8 +82,7 @@ public class PeerManager extends CommonBase {
         * 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).
         * 
@@ -100,7 +99,7 @@ public class PeerManager extends CommonBase {
                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;
        }
 
@@ -113,9 +112,8 @@ public class PeerManager extends CommonBase {
         * 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()`].
@@ -129,7 +127,7 @@ public class PeerManager extends CommonBase {
                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;
        }
 
@@ -193,6 +191,10 @@ public class PeerManager extends CommonBase {
         * 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