Package org.ldk.structs
Class Listen
- java.lang.Object
-
- org.ldk.structs.Listen
-
public class Listen extends Object
The `Listen` trait is used to notify 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. Clients sourcing chain data using a block-oriented API should prefer this interface over [`Confirm`]. Such clients fetch the entire header chain whereas clients using [`Confirm`] only fetch headers when needed. By using [`Listen::filtered_block_connected`] this interface supports clients fetching the entire header chain and only blocks with matching transaction data using BIP 157 filters or other similar filtering.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Listen.ListenInterface
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
block_connected(byte[] block, int height)
Notifies the listener that a block was added at the given height.void
block_disconnected(byte[] header, int height)
Notifies the listener that a block was removed at the given height.void
destroy()
Destroys the object, freeing associated resources.void
filtered_block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height)
Notifies the listener that a block was added at the given height, with the transaction data possibly filtered.protected void
finalize()
static Listen
new_impl(Listen.ListenInterface arg)
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
destroy
public void destroy()
Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
-
new_impl
public static Listen new_impl(Listen.ListenInterface arg)
-
filtered_block_connected
public void filtered_block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height)
Notifies the listener that a block was added at the given height, with the transaction data possibly filtered.
-
block_connected
public void block_connected(byte[] block, int height)
Notifies the listener that a block was added at the given height.
-
block_disconnected
public void block_disconnected(byte[] header, int height)
Notifies the listener that a block was removed at the given height.
-
-