Update java bindings with new generator and new upstream code
[ldk-java] / src / main / java / org / ldk / structs / Listen.java
index 075137cbc3d63db05d038cf817e4625ddf0f9cb8..456b44f8372fce25568e66bbbccf42845729cea7 100644 (file)
@@ -5,6 +5,12 @@ import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
 
+/**
+ * The `Listen` trait is used to be notified of when blocks have been connected or disconnected
+ * from the chain.
+ * 
+ * Useful when needing to replay chain data upon startup or as new chain events occur.
+ */
 @SuppressWarnings("unchecked") // We correctly assign various generic arrays
 public class Listen extends CommonBase {
        final bindings.LDKListen bindings_instance;
@@ -20,7 +26,13 @@ public class Listen extends CommonBase {
        }
 
        public static interface ListenInterface {
+               /**
+                * Notifies the listener that a block was added at the given height.
+                */
                void block_connected(byte[] block, int height);
+               /**
+                * Notifies the listener that a block was removed at the given height.
+                */
                void block_disconnected(byte[] header, int height);
        }
        private static class LDKListenHolder { Listen held; }
@@ -36,10 +48,16 @@ public class Listen extends CommonBase {
                });
                return impl_holder.held;
        }
+       /**
+        * Notifies the listener that a block was added at the given height.
+        */
        public void block_connected(byte[] block, int height) {
                bindings.Listen_block_connected(this.ptr, block, height);
        }
 
+       /**
+        * Notifies the listener that a block was removed at the given height.
+        */
        public void block_disconnected(byte[] header, int height) {
                bindings.Listen_block_disconnected(this.ptr, header, height);
        }