]> git.bitcoin.ninja Git - ldk-java/commitdiff
[Java] Update auto-generated bindings
authorMatt Corallo <git@bluematt.me>
Wed, 31 May 2023 19:35:12 +0000 (19:35 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 31 May 2023 19:35:12 +0000 (19:35 +0000)
44 files changed:
src/main/java/org/ldk/impl/bindings.java
src/main/java/org/ldk/structs/BackgroundProcessor.java
src/main/java/org/ldk/structs/BlindedPath.java
src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java
src/main/java/org/ldk/structs/ChainMonitor.java
src/main/java/org/ldk/structs/ChannelManager.java
src/main/java/org/ldk/structs/ChannelManagerReadArgs.java
src/main/java/org/ldk/structs/ChannelMonitor.java
src/main/java/org/ldk/structs/CustomMessageHandler.java
src/main/java/org/ldk/structs/CustomOnionMessageHandler.java
src/main/java/org/ldk/structs/DefaultRouter.java
src/main/java/org/ldk/structs/EventsProvider.java
src/main/java/org/ldk/structs/FilesystemPersister.java
src/main/java/org/ldk/structs/Future.java
src/main/java/org/ldk/structs/InMemorySigner.java
src/main/java/org/ldk/structs/LockableScore.java
src/main/java/org/ldk/structs/MessageHandler.java
src/main/java/org/ldk/structs/MultiThreadedLockableScore.java
src/main/java/org/ldk/structs/NetworkGraph.java
src/main/java/org/ldk/structs/OnionMessageContents.java
src/main/java/org/ldk/structs/OnionMessenger.java
src/main/java/org/ldk/structs/Option_CustomOnionMessageContentsZ.java
src/main/java/org/ldk/structs/Option_FilterZ.java
src/main/java/org/ldk/structs/Option_ScalarZ.java
src/main/java/org/ldk/structs/Option_TypeZ.java
src/main/java/org/ldk/structs/Option_UtxoLookupZ.java
src/main/java/org/ldk/structs/Option_WriteableScoreZ.java
src/main/java/org/ldk/structs/P2PGossipSync.java
src/main/java/org/ldk/structs/PeerManager.java
src/main/java/org/ldk/structs/Persister.java
src/main/java/org/ldk/structs/ProbabilisticScorer.java
src/main/java/org/ldk/structs/RapidGossipSync.java
src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_WriteableEcdsaChannelSignerDecodeErrorZ.java
src/main/java/org/ldk/structs/ScorerAccountingForInFlightHtlcs.java
src/main/java/org/ldk/structs/SignerProvider.java
src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java
src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelManagerZ.java
src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java
src/main/java/org/ldk/structs/UtilMethods.java
src/main/jni/bindings.c
src/main/jni/bindings.c.body
src/main/jni/org_ldk_impl_bindings.h

index bacc1d12fa8baa46c7a7d166fa825d822c4ee677..d0acc48171541c95fe719275e826d37fab550dab 100644 (file)
@@ -3512,6 +3512,10 @@ public class bindings {
        public static native long COption_ScalarZ_none();
        // void COption_ScalarZ_free(struct LDKCOption_ScalarZ _res);
        public static native void COption_ScalarZ_free(long _res);
+       // uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg);
+       public static native long COption_ScalarZ_clone_ptr(long arg);
+       // struct LDKCOption_ScalarZ COption_ScalarZ_clone(const struct LDKCOption_ScalarZ *NONNULL_PTR orig);
+       public static native long COption_ScalarZ_clone(long orig);
        // struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_ok(struct LDKThirtyTwoBytes o);
        public static native long CResult_SharedSecretNoneZ_ok(byte[] o);
        // struct LDKCResult_SharedSecretNoneZ CResult_SharedSecretNoneZ_err(void);
index 72bdae5a8e7c721d2917f73a5cba93bcebc6356e..84c36931fe6173a951df1d2af6256f498732bc39 100644 (file)
@@ -91,7 +91,7 @@ public class BackgroundProcessor extends CommonBase {
         * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable
         */
        public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) {
-               long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger == null ? 0 : logger.ptr, scorer.ptr);
+               long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger.ptr, scorer.ptr);
                Reference.reachabilityFence(persister);
                Reference.reachabilityFence(event_handler);
                Reference.reachabilityFence(chain_monitor);
index 7a7999d038944f0ac29350a81f7193db4b2ec2dc..27a7a0e75a3a67f3548ceab023e3892c82eb9a90 100644 (file)
@@ -75,7 +75,7 @@ public class BlindedPath extends CommonBase {
         * Errors if less than two hops are provided or if `node_pk`(s) are invalid.
         */
        public static Result_BlindedPathNoneZ new_for_message(byte[][] node_pks, org.ldk.structs.EntropySource entropy_source) {
-               long ret = bindings.BlindedPath_new_for_message(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, entropy_source == null ? 0 : entropy_source.ptr);
+               long ret = bindings.BlindedPath_new_for_message(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, entropy_source.ptr);
                Reference.reachabilityFence(node_pks);
                Reference.reachabilityFence(entropy_source);
                if (ret >= 0 && ret <= 4096) { return null; }
index 52f04d5f48d0e6f8fc6a86d6be45eed24fbee59f..d816d8c43842ea06c4795c56fc4b6fbc7b448c95 100644 (file)
@@ -142,7 +142,7 @@ public class BuiltCommitmentTransaction extends CommonBase {
         * Signs the holder commitment transaction because we are about to broadcast it.
         */
        public byte[] sign_holder_commitment(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis, org.ldk.structs.EntropySource entropy_source) {
-               byte[] ret = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis, entropy_source == null ? 0 : entropy_source.ptr);
+               byte[] ret = bindings.BuiltCommitmentTransaction_sign_holder_commitment(this.ptr, InternalUtils.check_arr_len(funding_key, 32), funding_redeemscript, channel_value_satoshis, entropy_source.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(funding_key);
                Reference.reachabilityFence(funding_redeemscript);
index 9c83ff243ea5b77c52a8edb8ac0f6c602356133c..e7bfc524fe5fc91c3c15a37d0649bc072152ec56 100644 (file)
@@ -45,7 +45,7 @@ public class ChainMonitor extends CommonBase {
         * transactions relevant to the watched channels.
         */
        public static ChainMonitor of(org.ldk.structs.Option_FilterZ chain_source, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.FeeEstimator feeest, org.ldk.structs.Persist persister) {
-               long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
+               long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster.ptr, logger.ptr, feeest.ptr, persister.ptr);
                Reference.reachabilityFence(chain_source);
                Reference.reachabilityFence(broadcaster);
                Reference.reachabilityFence(logger);
index dd34eb87ba0fee76d55749092c825019f64f6977..14f4b1e65ac543fc445d2c76a34e8401d86effe9 100644 (file)
@@ -89,7 +89,7 @@ public class ChannelManager extends CommonBase {
         * [`params.best_block.block_hash`]: chain::BestBlock::block_hash
         */
        public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params) {
-               long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, signer_provider == null ? 0 : signer_provider.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr);
+               long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr);
                Reference.reachabilityFence(fee_est);
                Reference.reachabilityFence(chain_monitor);
                Reference.reachabilityFence(tx_broadcaster);
index d542693e1cc7735a95391c4eba4e136e978d2618..95703760703acfa5fad61a9b2ff879004aadc7ef 100644 (file)
@@ -67,7 +67,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * A cryptographically secure source of entropy.
         */
        public void set_entropy_source(org.ldk.structs.EntropySource val) {
-               bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_entropy_source(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -89,7 +89,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * A signer that is able to perform node-scoped cryptographic operations.
         */
        public void set_node_signer(org.ldk.structs.NodeSigner val) {
-               bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_node_signer(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -115,7 +115,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * signing data.
         */
        public void set_signer_provider(org.ldk.structs.SignerProvider val) {
-               bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_signer_provider(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -141,7 +141,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * No calls to the FeeEstimator will be made during deserialization.
         */
        public void set_fee_estimator(org.ldk.structs.FeeEstimator val) {
-               bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -171,7 +171,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * chain::Watch after deserializing this ChannelManager.
         */
        public void set_chain_monitor(org.ldk.structs.Watch val) {
-               bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -197,7 +197,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * force-closed during deserialization.
         */
        public void set_tx_broadcaster(org.ldk.structs.BroadcasterInterface val) {
-               bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -225,7 +225,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * No calls to the router will be made during deserialization.
         */
        public void set_router(org.ldk.structs.Router val) {
-               bindings.ChannelManagerReadArgs_set_router(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_router(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -249,7 +249,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * deserialization.
         */
        public void set_logger(org.ldk.structs.Logger val) {
-               bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : val.ptr);
+               bindings.ChannelManagerReadArgs_set_logger(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -285,7 +285,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         * populate a HashMap directly from C.
         */
        public static ChannelManagerReadArgs of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) {
-               long ret = bindings.ChannelManagerReadArgs_new(entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, signer_provider == null ? 0 : signer_provider.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr).toArray() : null);
+               long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr).toArray() : null);
                Reference.reachabilityFence(entropy_source);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(signer_provider);
index 2f05f3c9d5872927bd17fe2d1d199364fcc92135..a505f8bd22548d6e1c123bcbc57871826ca598f9 100644 (file)
@@ -69,7 +69,7 @@ public class ChannelMonitor extends CommonBase {
         * panics if the given update is not the next update by update_id.
         */
        public Result_NoneNoneZ update_monitor(org.ldk.structs.ChannelMonitorUpdate updates, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(updates);
                Reference.reachabilityFence(broadcaster);
@@ -130,7 +130,7 @@ public class ChannelMonitor extends CommonBase {
         * have been registered.
         */
        public void load_outputs_to_watch(org.ldk.structs.Filter filter) {
-               bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr);
+               bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(filter);
                if (this != null) { this.ptrs_to.add(filter); };
@@ -211,7 +211,7 @@ public class ChannelMonitor extends CommonBase {
         * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
         */
        public byte[][] get_latest_holder_commitment_txn(org.ldk.structs.Logger logger) {
-               byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr);
+               byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(logger);
                if (this != null) { this.ptrs_to.add(logger); };
@@ -232,7 +232,7 @@ public class ChannelMonitor extends CommonBase {
         * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
         */
        public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(header);
                Reference.reachabilityFence(txdata);
@@ -259,7 +259,7 @@ public class ChannelMonitor extends CommonBase {
         * appropriately.
         */
        public void block_disconnected(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(header);
                Reference.reachabilityFence(height);
@@ -281,7 +281,7 @@ public class ChannelMonitor extends CommonBase {
         * [`block_connected`]: Self::block_connected
         */
        public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.check_arr_len(header, 80), txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_28 -> txdata_conv_28 != null ? txdata_conv_28.ptr : 0).toArray() : null, height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(header);
                Reference.reachabilityFence(txdata);
@@ -312,7 +312,7 @@ public class ChannelMonitor extends CommonBase {
         * [`block_disconnected`]: Self::block_disconnected
         */
        public void transaction_unconfirmed(byte[] txid, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(txid);
                Reference.reachabilityFence(broadcaster);
@@ -333,7 +333,7 @@ public class ChannelMonitor extends CommonBase {
         * [`block_connected`]: Self::block_connected
         */
        public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(header);
                Reference.reachabilityFence(height);
@@ -392,7 +392,7 @@ public class ChannelMonitor extends CommonBase {
         * connections, like on mobile.
         */
        public void rebroadcast_pending_claims(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) {
-               bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               bindings.ChannelMonitor_rebroadcast_pending_claims(this.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(broadcaster);
                Reference.reachabilityFence(fee_estimator);
index 7425c2ebe65c4c4dfeb30a6c9ffd016fc7dfce3b..247de06e1614c244955ebfc47cb12fe900d81d2d 100644 (file)
@@ -95,7 +95,7 @@ public class CustomMessageHandler extends CommonBase {
         * to send.
         */
        public Result_NoneLightningErrorZ handle_custom_message(org.ldk.structs.Type msg, byte[] sender_node_id) {
-               long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33));
+               long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33));
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(msg);
                Reference.reachabilityFence(sender_node_id);
index 33d21a3007559cf6d703a5dd5a921b87b037572d..da87808f32e9bd4ac10b1309cc5c2b0eaecdd725 100644 (file)
@@ -79,7 +79,7 @@ public class CustomOnionMessageHandler extends CommonBase {
         * Called with the custom message that was received.
         */
        public void handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) {
-               bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr);
+               bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(msg);
                if (this != null) { this.ptrs_to.add(msg); };
index 3f4919616c2f15a8abdd904d7c74dd189da6be65..aa5dcaeafa74ccd20a40a85b94ffe3cc91b2f4c2 100644 (file)
@@ -24,7 +24,7 @@ public class DefaultRouter extends CommonBase {
         * Creates a new router.
         */
        public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes, org.ldk.structs.LockableScore scorer) {
-               long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer == null ? 0 : scorer.ptr);
+               long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer.ptr);
                Reference.reachabilityFence(network_graph);
                Reference.reachabilityFence(logger);
                Reference.reachabilityFence(random_seed_bytes);
index db707f514b0df4da3a4718b487bd18973ec05640..a46ddd2ca1c8eb6ec4d8532a2f7aa210ac1a64f4 100644 (file)
@@ -98,7 +98,7 @@ public class EventsProvider extends CommonBase {
         * See the trait-level documentation for requirements.
         */
        public void process_pending_events(org.ldk.structs.EventHandler handler) {
-               bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0 : handler.ptr);
+               bindings.EventsProvider_process_pending_events(this.ptr, handler.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(handler);
                if (this != null) { this.ptrs_to.add(handler); };
index 118a806bad299ab2e7390b2283439fe7530547d7..f80fb3a8dd8649dfb5a42d5f0881f3256cd5bc83 100644 (file)
@@ -57,7 +57,7 @@ public class FilesystemPersister extends CommonBase {
         * Read `ChannelMonitor`s from disk.
         */
        public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.SignerProvider signer_provider) {
-               long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, entropy_source == null ? 0 : entropy_source.ptr, signer_provider == null ? 0 : signer_provider.ptr);
+               long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, entropy_source.ptr, signer_provider.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(entropy_source);
                Reference.reachabilityFence(signer_provider);
index 74c5a62a50adb33585bed1aba36530b262219602..8e7b97fbe5de8ee1cb5bf35e4e35a081c960639f 100644 (file)
@@ -45,7 +45,7 @@ public class Future extends CommonBase {
         * completed, the callback will be called immediately.
         */
        public void register_callback_fn(org.ldk.structs.FutureCallback callback) {
-               bindings.Future_register_callback_fn(this.ptr, callback == null ? 0 : callback.ptr);
+               bindings.Future_register_callback_fn(this.ptr, callback.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(callback);
                if (this != null) { this.ptrs_to.add(callback); };
index 5afb560503a00633b315e439fd9627dbddbaf5c8..d1761eb0c50ef3dff3d0716a1168f2e093b84acd 100644 (file)
@@ -373,7 +373,7 @@ public class InMemorySigner extends CommonBase {
         * Read a InMemorySigner from a byte array, created by InMemorySigner_write
         */
        public static Result_InMemorySignerDecodeErrorZ read(byte[] ser, org.ldk.structs.EntropySource arg) {
-               long ret = bindings.InMemorySigner_read(ser, arg == null ? 0 : arg.ptr);
+               long ret = bindings.InMemorySigner_read(ser, arg.ptr);
                Reference.reachabilityFence(ser);
                Reference.reachabilityFence(arg);
                if (ret >= 0 && ret <= 4096) { return null; }
index 206b6e54a021396999e048105ae5034b9de23311..a8cc6788bd2e48d7c11af3d0856bea5ba51e9410 100644 (file)
@@ -56,7 +56,7 @@ public class LockableScore extends CommonBase {
                        @Override public long lock() {
                                Score ret = arg.lock();
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.ptr;
+                               long result = ret.ptr;
                                if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); };
                                return result;
                        }
index 20d74af36dd5fd3c5c19cf1e80214b61f52f60c1..e2d88b4afa648067e5a73cfa48c71a8b238972fb 100644 (file)
@@ -42,7 +42,7 @@ public class MessageHandler extends CommonBase {
         * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
         */
        public void set_chan_handler(org.ldk.structs.ChannelMessageHandler val) {
-               bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr);
+               bindings.MessageHandler_set_chan_handler(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -70,7 +70,7 @@ public class MessageHandler extends CommonBase {
         * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync
         */
        public void set_route_handler(org.ldk.structs.RoutingMessageHandler val) {
-               bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr);
+               bindings.MessageHandler_set_route_handler(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -94,7 +94,7 @@ public class MessageHandler extends CommonBase {
         * [`IgnoringMessageHandler`].
         */
        public void set_onion_message_handler(org.ldk.structs.OnionMessageHandler val) {
-               bindings.MessageHandler_set_onion_message_handler(this.ptr, val == null ? 0 : val.ptr);
+               bindings.MessageHandler_set_onion_message_handler(this.ptr, val.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(val);
                if (this != null) { this.ptrs_to.add(val); };
@@ -104,7 +104,7 @@ public class MessageHandler extends CommonBase {
         * Constructs a new MessageHandler given each field
         */
        public static MessageHandler of(org.ldk.structs.ChannelMessageHandler chan_handler_arg, org.ldk.structs.RoutingMessageHandler route_handler_arg, org.ldk.structs.OnionMessageHandler onion_message_handler_arg) {
-               long ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr, onion_message_handler_arg == null ? 0 : onion_message_handler_arg.ptr);
+               long ret = bindings.MessageHandler_new(chan_handler_arg.ptr, route_handler_arg.ptr, onion_message_handler_arg.ptr);
                Reference.reachabilityFence(chan_handler_arg);
                Reference.reachabilityFence(route_handler_arg);
                Reference.reachabilityFence(onion_message_handler_arg);
index 3a7f2bafda1727f9b91ea0b23d51372924107126..2f6ca6c641ab810ed5dd889df08bacfd9f1f7171 100644 (file)
@@ -59,7 +59,7 @@ public class MultiThreadedLockableScore extends CommonBase {
         * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
         */
        public static MultiThreadedLockableScore of(org.ldk.structs.Score score) {
-               long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr);
+               long ret = bindings.MultiThreadedLockableScore_new(score.ptr);
                Reference.reachabilityFence(score);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.MultiThreadedLockableScore ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.MultiThreadedLockableScore(null, ret); }
index 42ebedb43d78eb982d91c998f988ce517709cee2..5ee9a791df5ec1c013be1ffa3025608c0f716a89 100644 (file)
@@ -44,7 +44,7 @@ public class NetworkGraph extends CommonBase {
         * Read a NetworkGraph from a byte array, created by NetworkGraph_write
         */
        public static Result_NetworkGraphDecodeErrorZ read(byte[] ser, org.ldk.structs.Logger arg) {
-               long ret = bindings.NetworkGraph_read(ser, arg == null ? 0 : arg.ptr);
+               long ret = bindings.NetworkGraph_read(ser, arg.ptr);
                Reference.reachabilityFence(ser);
                Reference.reachabilityFence(arg);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -57,7 +57,7 @@ public class NetworkGraph extends CommonBase {
         * Creates a new, empty, network graph.
         */
        public static NetworkGraph of(org.ldk.enums.Network network, org.ldk.structs.Logger logger) {
-               long ret = bindings.NetworkGraph_new(network, logger == null ? 0 : logger.ptr);
+               long ret = bindings.NetworkGraph_new(network, logger.ptr);
                Reference.reachabilityFence(network);
                Reference.reachabilityFence(logger);
                if (ret >= 0 && ret <= 4096) { return null; }
index f2aba0ee97faffbbfa935d1b787d5cffd98639b7..8bc1a7ed1f015ed5363f880530722896b45a1cca 100644 (file)
@@ -63,7 +63,7 @@ public class OnionMessageContents extends CommonBase {
         * Utility method to constructs a new Custom-variant OnionMessageContents
         */
        public static OnionMessageContents custom(org.ldk.structs.CustomOnionMessageContents a) {
-               long ret = bindings.OnionMessageContents_custom(a == null ? 0 : a.ptr);
+               long ret = bindings.OnionMessageContents_custom(a.ptr);
                Reference.reachabilityFence(a);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.OnionMessageContents ret_hu_conv = org.ldk.structs.OnionMessageContents.constr_from_ptr(ret);
index 2315e3bae777f1089bca3762fa0c3928cafd9cdf..26b85f0661f3e37008e6ec54c2aab638b70dc1e1 100644 (file)
@@ -97,7 +97,7 @@ public class OnionMessenger extends CommonBase {
         * their respective handlers.
         */
        public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) {
-               long ret = bindings.OnionMessenger_new(entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, custom_handler == null ? 0 : custom_handler.ptr);
+               long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr);
                Reference.reachabilityFence(entropy_source);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(logger);
index a7254c11b12a522ba061dbca9c76f1c6d5a46cf4..e1a73abdcc48386d5025e1f6f9e3097e866a7d86 100644 (file)
@@ -55,7 +55,7 @@ public class Option_CustomOnionMessageContentsZ extends CommonBase {
         * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
         */
        public static Option_CustomOnionMessageContentsZ some(org.ldk.structs.CustomOnionMessageContents o) {
-               long ret = bindings.COption_CustomOnionMessageContentsZ_some(o == null ? 0 : o.ptr);
+               long ret = bindings.COption_CustomOnionMessageContentsZ_some(o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret);
index 279be2f20407482454fca3203082fa6afbd8607f..5c5a51ff5e6dbd73ab5c813b4ece055133721f12 100644 (file)
@@ -55,7 +55,7 @@ public class Option_FilterZ extends CommonBase {
         * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter
         */
        public static Option_FilterZ some(org.ldk.structs.Filter o) {
-               long ret = bindings.COption_FilterZ_some(o == null ? 0 : o.ptr);
+               long ret = bindings.COption_FilterZ_some(o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Option_FilterZ ret_hu_conv = org.ldk.structs.Option_FilterZ.constr_from_ptr(ret);
index eb553b93ecf136cdea082ec8d13d5cafc11867a0..78b28c876de1c4078c18260f4e8bac0455c131f2 100644 (file)
@@ -74,4 +74,23 @@ public class Option_ScalarZ extends CommonBase {
                return ret_hu_conv;
        }
 
+       long clone_ptr() {
+               long ret = bindings.COption_ScalarZ_clone_ptr(this.ptr);
+               Reference.reachabilityFence(this);
+               return ret;
+       }
+
+       /**
+        * Creates a new COption_ScalarZ which has the same data as `orig`
+        * but with all dynamically-allocated buffers duplicated in new buffers.
+        */
+       public Option_ScalarZ clone() {
+               long ret = bindings.COption_ScalarZ_clone(this.ptr);
+               Reference.reachabilityFence(this);
+               if (ret >= 0 && ret <= 4096) { return null; }
+               org.ldk.structs.Option_ScalarZ ret_hu_conv = org.ldk.structs.Option_ScalarZ.constr_from_ptr(ret);
+               if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+               return ret_hu_conv;
+       }
+
 }
index e71c922411c8182c5d89719e5d77ffa8e7cf0555..fe1ec84680fdcae3b5290b4ec5ed95960d74935e 100644 (file)
@@ -55,7 +55,7 @@ public class Option_TypeZ extends CommonBase {
         * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type
         */
        public static Option_TypeZ some(org.ldk.structs.Type o) {
-               long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr);
+               long ret = bindings.COption_TypeZ_some(o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Option_TypeZ ret_hu_conv = org.ldk.structs.Option_TypeZ.constr_from_ptr(ret);
index 9326de4712d6c1e5c22438c19cc0dc6d37a38124..cad3befbc79cae85b3c9bb52da24ee67d2f579d4 100644 (file)
@@ -55,7 +55,7 @@ public class Option_UtxoLookupZ extends CommonBase {
         * Constructs a new COption_UtxoLookupZ containing a crate::lightning::routing::utxo::UtxoLookup
         */
        public static Option_UtxoLookupZ some(org.ldk.structs.UtxoLookup o) {
-               long ret = bindings.COption_UtxoLookupZ_some(o == null ? 0 : o.ptr);
+               long ret = bindings.COption_UtxoLookupZ_some(o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Option_UtxoLookupZ ret_hu_conv = org.ldk.structs.Option_UtxoLookupZ.constr_from_ptr(ret);
index 7ed1adf100d1f7835f830e86f4bbd6bdc660307a..08eb67c7cad6ffbeb05a587c0b3fa1bb27eec1f1 100644 (file)
@@ -55,7 +55,7 @@ public class Option_WriteableScoreZ extends CommonBase {
         * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore
         */
        public static Option_WriteableScoreZ some(org.ldk.structs.WriteableScore o) {
-               long ret = bindings.COption_WriteableScoreZ_some(o == null ? 0 : o.ptr);
+               long ret = bindings.COption_WriteableScoreZ_some(o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                org.ldk.structs.Option_WriteableScoreZ ret_hu_conv = org.ldk.structs.Option_WriteableScoreZ.constr_from_ptr(ret);
index 0eb913815fe05314b5cdb009525e36e3619a5949..57544fdc719fac09cf70c9013c7b535c378632cf 100644 (file)
@@ -31,7 +31,7 @@ public class P2PGossipSync extends CommonBase {
         * correct, and the announcement is signed with channel owners' keys.
         */
        public static P2PGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Option_UtxoLookupZ utxo_lookup, org.ldk.structs.Logger logger) {
-               long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, utxo_lookup.ptr, logger == null ? 0 : logger.ptr);
+               long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, utxo_lookup.ptr, logger.ptr);
                Reference.reachabilityFence(network_graph);
                Reference.reachabilityFence(utxo_lookup);
                Reference.reachabilityFence(logger);
index ce9d3159666f94ec8724a73c8153c1af3df4fe8c..5e9a79f89cae39b931f260b6a3963be7a1b380ac 100644 (file)
@@ -50,7 +50,7 @@ public class PeerManager extends CommonBase {
         * minute should suffice.
         */
        public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, int current_time, byte[] ephemeral_random_data, org.ldk.structs.Logger logger, org.ldk.structs.CustomMessageHandler custom_message_handler, org.ldk.structs.NodeSigner node_signer) {
-               long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr, message_handler_onion_message_handler_arg == null ? 0 : message_handler_onion_message_handler_arg.ptr), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr, node_signer == null ? 0 : node_signer.ptr);
+               long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg.ptr, message_handler_onion_message_handler_arg.ptr), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger.ptr, custom_message_handler.ptr, node_signer.ptr);
                Reference.reachabilityFence(message_handler_chan_handler_arg);
                Reference.reachabilityFence(message_handler_route_handler_arg);
                Reference.reachabilityFence(message_handler_onion_message_handler_arg);
@@ -115,7 +115,7 @@ public class PeerManager extends CommonBase {
         * [`socket_disconnected`]: PeerManager::socket_disconnected
         */
        public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) {
-               long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr);
+               long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor.ptr, remote_network_address.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(their_node_id);
                Reference.reachabilityFence(descriptor);
@@ -145,7 +145,7 @@ public class PeerManager extends CommonBase {
         * [`socket_disconnected`]: PeerManager::socket_disconnected
         */
        public Result_NonePeerHandleErrorZ new_inbound_connection(org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) {
-               long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr);
+               long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor.ptr, remote_network_address.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(descriptor);
                Reference.reachabilityFence(remote_network_address);
@@ -171,7 +171,7 @@ public class PeerManager extends CommonBase {
         * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail
         */
        public Result_NonePeerHandleErrorZ write_buffer_space_avail(org.ldk.structs.SocketDescriptor descriptor) {
-               long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+               long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(descriptor);
                if (ret >= 0 && ret <= 4096) { return null; }
@@ -199,7 +199,7 @@ public class PeerManager extends CommonBase {
         * [`process_events`]: PeerManager::process_events
         */
        public Result_boolPeerHandleErrorZ read_event(org.ldk.structs.SocketDescriptor peer_descriptor, byte[] data) {
-               long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data);
+               long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor.ptr, data);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(peer_descriptor);
                Reference.reachabilityFence(data);
@@ -236,7 +236,7 @@ public class PeerManager extends CommonBase {
         * Indicates that the given socket descriptor's connection is now closed.
         */
        public void socket_disconnected(org.ldk.structs.SocketDescriptor descriptor) {
-               bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+               bindings.PeerManager_socket_disconnected(this.ptr, descriptor.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(descriptor);
        }
index 3cdf7360d3957a82df5dec0de1826cf9444affd2..d735aa249efda015c14bf7c1eca665bac26930b9 100644 (file)
@@ -109,7 +109,7 @@ public class Persister extends CommonBase {
         * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed.
         */
        public Result_NoneErrorZ persist_scorer(org.ldk.structs.WriteableScore scorer) {
-               long ret = bindings.Persister_persist_scorer(this.ptr, scorer == null ? 0 : scorer.ptr);
+               long ret = bindings.Persister_persist_scorer(this.ptr, scorer.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(scorer);
                if (ret >= 0 && ret <= 4096) { return null; }
index ecd6aafb856cf48762bf656d24904ce336aae467..db52ae427132951ca02be9558a733311368a2239 100644 (file)
@@ -60,7 +60,7 @@ public class ProbabilisticScorer extends CommonBase {
         * through a network graph.
         */
        public static ProbabilisticScorer of(org.ldk.structs.ProbabilisticScoringParameters params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) {
-               long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr);
+               long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr);
                Reference.reachabilityFence(params);
                Reference.reachabilityFence(network_graph);
                Reference.reachabilityFence(logger);
@@ -211,7 +211,7 @@ public class ProbabilisticScorer extends CommonBase {
         * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write
         */
        public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, org.ldk.structs.ProbabilisticScoringParameters arg_a, org.ldk.structs.NetworkGraph arg_b, org.ldk.structs.Logger arg_c) {
-               long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c == null ? 0 : arg_c.ptr);
+               long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c.ptr);
                Reference.reachabilityFence(ser);
                Reference.reachabilityFence(arg_a);
                Reference.reachabilityFence(arg_b);
index d9b85257633f46a0e62bd6c12f033c8e8851b7da..9af3bb6456b52e61e2bd8816d8750ef72797a5d7 100644 (file)
@@ -28,7 +28,7 @@ public class RapidGossipSync extends CommonBase {
         * Instantiate a new [`RapidGossipSync`] instance.
         */
        public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) {
-               long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr);
+               long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr);
                Reference.reachabilityFence(network_graph);
                Reference.reachabilityFence(logger);
                if (ret >= 0 && ret <= 4096) { return null; }
index 5bc5b47370e7af2ddc4550c73f270c8fd958b628..b285d0c957a6445441889e327dd3c350a9510af9 100644 (file)
@@ -46,7 +46,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase {
         * Creates a new CResult_NetworkGraphDecodeErrorZ in the success state.
         */
        public static Result_NetworkGraphDecodeErrorZ ok(Network o_network, Logger o_logger) {
-               long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, o_logger == null ? 0 : o_logger.ptr));
+               long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(bindings.NetworkGraph_new(o_network, o_logger.ptr));
                Reference.reachabilityFence(o_network);
                Reference.reachabilityFence(o_logger);
                if (ret >= 0 && ret <= 4096) { return null; }
index 3f13fb8c9584ac2f2672f1abaf02de1e5a355884..0ced81857064d884d5e7581755f200a550083a1d 100644 (file)
@@ -46,7 +46,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase {
         * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state.
         */
        public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringParameters o_params, NetworkGraph o_network_graph, Logger o_logger) {
-               long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger == null ? 0 : o_logger.ptr));
+               long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_params == null ? 0 : o_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger.ptr));
                Reference.reachabilityFence(o_params);
                Reference.reachabilityFence(o_network_graph);
                Reference.reachabilityFence(o_logger);
index b3c4f4aa51a88e1b1ce8e1b745be83c1edb7f409..bad96df5735d3c3db43fe75b77ade52792bf532c 100644 (file)
@@ -46,7 +46,7 @@ public class Result_WriteableEcdsaChannelSignerDecodeErrorZ extends CommonBase {
         * Creates a new CResult_WriteableEcdsaChannelSignerDecodeErrorZ in the success state.
         */
        public static Result_WriteableEcdsaChannelSignerDecodeErrorZ ok(org.ldk.structs.WriteableEcdsaChannelSigner o) {
-               long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o == null ? 0 : o.ptr);
+               long ret = bindings.CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(o.ptr);
                Reference.reachabilityFence(o);
                if (ret >= 0 && ret <= 4096) { return null; }
                Result_WriteableEcdsaChannelSignerDecodeErrorZ ret_hu_conv = Result_WriteableEcdsaChannelSignerDecodeErrorZ.constr_from_ptr(ret);
index ffc3dea9a577f5a4125f968f874410d1f6def9f3..c0dc28c713cab3225f0fdfbc0d8dc2e1e256b34a 100644 (file)
@@ -29,7 +29,7 @@ public class ScorerAccountingForInFlightHtlcs extends CommonBase {
         * Initialize a new `ScorerAccountingForInFlightHtlcs`.
         */
        public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.Score scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) {
-               long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer == null ? 0 : scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr);
+               long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr);
                Reference.reachabilityFence(scorer);
                Reference.reachabilityFence(inflight_htlcs);
                if (ret >= 0 && ret <= 4096) { return null; }
index 86a5cb7fd322d92a09dc50ee3f98ee7f8ea889dd..690e35c57c3f745f5240373a219b1dac2e6895cb 100644 (file)
@@ -100,7 +100,7 @@ public class SignerProvider extends CommonBase {
                        @Override public long derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) {
                                WriteableEcdsaChannelSigner ret = arg.derive_channel_signer(channel_value_satoshis, channel_keys_id);
                                Reference.reachabilityFence(arg);
-                               long result = ret == null ? 0 : ret.clone_ptr();
+                               long result = ret.clone_ptr();
                                if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); };
                                return result;
                        }
index ae83aef96732a8d147b1e1d852190a6e205f69b3..181512a37d9bfdd0e3a0c444d8dc418687431731 100644 (file)
@@ -76,7 +76,7 @@ public class TrustedCommitmentTransaction extends CommonBase {
         * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All.
         */
        public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.EntropySource entropy_source) {
-               long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source == null ? 0 : entropy_source.ptr);
+               long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.check_arr_len(htlc_base_key, 32), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source.ptr);
                Reference.reachabilityFence(this);
                Reference.reachabilityFence(htlc_base_key);
                Reference.reachabilityFence(channel_parameters);
index 778492d163c928066f494201e579a3d7327282a9..e17ad1f163917feb6276fe2287ff2f88f725f698 100644 (file)
@@ -45,7 +45,7 @@ public class TwoTuple_BlockHashChannelManagerZ extends CommonBase {
         * Creates a new C2Tuple_BlockHashChannelManagerZ from the contained elements.
         */
        public static TwoTuple_BlockHashChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params) {
-               long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est == null ? 0 : b_fee_est.ptr, b_chain_monitor == null ? 0 : b_chain_monitor.ptr, b_tx_broadcaster == null ? 0 : b_tx_broadcaster.ptr, b_router == null ? 0 : b_router.ptr, b_logger == null ? 0 : b_logger.ptr, b_entropy_source == null ? 0 : b_entropy_source.ptr, b_node_signer == null ? 0 : b_node_signer.ptr, b_signer_provider == null ? 0 : b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr));
+               long ret = bindings.C2Tuple_BlockHashChannelManagerZ_new(InternalUtils.check_arr_len(a, 32), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr));
                Reference.reachabilityFence(a);
                Reference.reachabilityFence(b_fee_est);
                Reference.reachabilityFence(b_chain_monitor);
index f6326afc6e67c108cad84492485e5d562bf61613..49e053274eb6a6846171b3b86c4a9602bebba0ea 100644 (file)
@@ -64,7 +64,7 @@ public class TwoTuple_PublicKeyTypeZ extends CommonBase {
         * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements.
         */
        public static TwoTuple_PublicKeyTypeZ of(byte[] a, org.ldk.structs.Type b) {
-               long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr);
+               long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b.ptr);
                Reference.reachabilityFence(a);
                Reference.reachabilityFence(b);
                if (ret >= 0 && ret <= 4096) { return null; }
index 513b48b4191f11278915bf2a256aebadaa9fb610..0fc32fb5203f2c8038276c3b4c0434365b53b070 100644 (file)
@@ -116,7 +116,7 @@ public class UtilMethods {
         * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write
         */
        public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, org.ldk.structs.EntropySource arg_a, org.ldk.structs.SignerProvider arg_b) {
-               long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr);
+               long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg_a.ptr, arg_b.ptr);
                Reference.reachabilityFence(ser);
                Reference.reachabilityFence(arg_a);
                Reference.reachabilityFence(arg_b);
@@ -145,7 +145,7 @@ public class UtilMethods {
         * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
         */
        public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, EntropySource arg_entropy_source, NodeSigner arg_node_signer, SignerProvider arg_signer_provider, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Router arg_router, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
-               long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source == null ? 0 : arg_entropy_source.ptr, arg_node_signer == null ? 0 : arg_node_signer.ptr, arg_signer_provider == null ? 0 : arg_signer_provider.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_router == null ? 0 : arg_router.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr).toArray() : null));
+               long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr).toArray() : null));
                Reference.reachabilityFence(ser);
                Reference.reachabilityFence(arg_entropy_source);
                Reference.reachabilityFence(arg_node_signer);
@@ -190,7 +190,7 @@ public class UtilMethods {
         * [`NodeSigner::get_inbound_payment_key_material`]: crate::chain::keysinterface::NodeSigner::get_inbound_payment_key_material
         */
        public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.EntropySource entropy_source, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
-               long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source == null ? 0 : entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr);
+               long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(keys);
                Reference.reachabilityFence(min_value_msat);
                Reference.reachabilityFence(invoice_expiry_delta_secs);
@@ -512,7 +512,7 @@ public class UtilMethods {
         * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, @Nullable ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.Score scorer, byte[] random_seed_bytes) {
-               long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, logger == null ? 0 : logger.ptr, scorer == null ? 0 : scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
+               long ret = bindings.find_route(InternalUtils.check_arr_len(our_node_pubkey, 33), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, logger.ptr, scorer.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
                Reference.reachabilityFence(our_node_pubkey);
                Reference.reachabilityFence(route_params);
                Reference.reachabilityFence(network_graph);
@@ -537,7 +537,7 @@ public class UtilMethods {
         * Re-uses logic from `find_route`, so the restrictions described there also apply here.
         */
        public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) {
-               long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
+               long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32));
                Reference.reachabilityFence(our_node_pubkey);
                Reference.reachabilityFence(hops);
                Reference.reachabilityFence(route_params);
@@ -741,7 +741,7 @@ public class UtilMethods {
         * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) {
-               long ret = bindings.create_phantom_invoice(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), description, invoice_expiry_delta_secs, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
+               long ret = bindings.create_phantom_invoice(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), description, invoice_expiry_delta_secs, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
                Reference.reachabilityFence(amt_msat);
                Reference.reachabilityFence(payment_hash);
                Reference.reachabilityFence(description);
@@ -805,7 +805,7 @@ public class UtilMethods {
         * Note that payment_hash (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) {
-               long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source == null ? 0 : entropy_source.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
+               long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, InternalUtils.check_arr_len(payment_hash, 32), invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, phantom_route_hints != null ? Arrays.stream(phantom_route_hints).mapToLong(phantom_route_hints_conv_19 -> phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr).toArray() : null, entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch);
                Reference.reachabilityFence(amt_msat);
                Reference.reachabilityFence(payment_hash);
                Reference.reachabilityFence(invoice_expiry_delta_secs);
@@ -847,7 +847,7 @@ public class UtilMethods {
         * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
         */
        public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
-               long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+               long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(channelmanager);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(logger);
@@ -885,7 +885,7 @@ public class UtilMethods {
         * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA
         */
        public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
-               long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+               long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(channelmanager);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(logger);
@@ -911,7 +911,7 @@ public class UtilMethods {
         * available and the current time is supplied by the caller.
         */
        public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
-               long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+               long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(channelmanager);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(logger);
@@ -938,7 +938,7 @@ public class UtilMethods {
         * available and the current time is supplied by the caller.
         */
        public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
-               long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
+               long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(channelmanager);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(logger);
@@ -965,7 +965,7 @@ public class UtilMethods {
         * the payment hash is also involved outside the scope of lightning.
         */
        public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) {
-               long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer == null ? 0 : node_signer.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr);
+               long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32), min_final_cltv_expiry_delta.ptr);
                Reference.reachabilityFence(channelmanager);
                Reference.reachabilityFence(node_signer);
                Reference.reachabilityFence(logger);
index b039192b94b3bc34fa4414a5af1077179e13a18d..72dd3c3171289ed72ca8e499c6257c4abc7a684b 100644 (file)
@@ -76,7 +76,7 @@ JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclas
        arr_of_B_clz = (*env)->FindClass(env, "[B");
        CHECK(arr_of_B_clz != NULL);
        arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
-       String_clz = (*env)->FindClass(env, "Ljava/lang/String;");
+       String_clz = (*env)->FindClass(env, "java/lang/String");
        CHECK(String_clz != NULL);
        String_clz = (*env)->NewGlobalRef(env, String_clz);
 }
@@ -8153,7 +8153,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh(JNIEnv *en
        void* tweak_ptr = untag_ptr(tweak);
        CHECK_ACCESS(tweak_ptr);
        LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
-       // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+       tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
        LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
        *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
        return tag_ptr(ret_conv, true);
@@ -20929,6 +20929,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free(JNIEnv
        COption_ScalarZ_free(_res_conv);
 }
 
+static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
+       LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+       *ret_copy = COption_ScalarZ_clone(arg);
+       int64_t ret_ref = tag_ptr(ret_copy, true);
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
+       int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
+       return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
+       LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+       *ret_copy = COption_ScalarZ_clone(orig_conv);
+       int64_t ret_ref = tag_ptr(ret_copy, true);
+       return ret_ref;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
        LDKThirtyTwoBytes o_ref;
        CHECK((*env)->GetArrayLength(env, o) == 32);
index 6a44bd7f87e91693ee122a7c76938e3726b06f99..dba7f31e131516b47d7051ae5c7dd48a08551a9f 100644 (file)
@@ -74,7 +74,7 @@ JNIEXPORT void Java_org_ldk_impl_bindings_init_1class_1cache(JNIEnv * env, jclas
        arr_of_B_clz = (*env)->FindClass(env, "[B");
        CHECK(arr_of_B_clz != NULL);
        arr_of_B_clz = (*env)->NewGlobalRef(env, arr_of_B_clz);
-       String_clz = (*env)->FindClass(env, "Ljava/lang/String;");
+       String_clz = (*env)->FindClass(env, "java/lang/String");
        CHECK(String_clz != NULL);
        String_clz = (*env)->NewGlobalRef(env, String_clz);
 }
@@ -8151,7 +8151,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeSigner_1ecdh(JNIEnv *en
        void* tweak_ptr = untag_ptr(tweak);
        CHECK_ACCESS(tweak_ptr);
        LDKCOption_ScalarZ tweak_conv = *(LDKCOption_ScalarZ*)(tweak_ptr);
-       // WARNING: we may need a move here but no clone is available for LDKCOption_ScalarZ
+       tweak_conv = COption_ScalarZ_clone((LDKCOption_ScalarZ*)untag_ptr(tweak));
        LDKCResult_SharedSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SharedSecretNoneZ), "LDKCResult_SharedSecretNoneZ");
        *ret_conv = (this_arg_conv->ecdh)(this_arg_conv->this_arg, recipient_conv, other_key_ref, tweak_conv);
        return tag_ptr(ret_conv, true);
@@ -20927,6 +20927,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free(JNIEnv
        COption_ScalarZ_free(_res_conv);
 }
 
+static inline uint64_t COption_ScalarZ_clone_ptr(LDKCOption_ScalarZ *NONNULL_PTR arg) {
+       LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+       *ret_copy = COption_ScalarZ_clone(arg);
+       int64_t ret_ref = tag_ptr(ret_copy, true);
+       return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCOption_ScalarZ* arg_conv = (LDKCOption_ScalarZ*)untag_ptr(arg);
+       int64_t ret_conv = COption_ScalarZ_clone_ptr(arg_conv);
+       return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKCOption_ScalarZ* orig_conv = (LDKCOption_ScalarZ*)untag_ptr(orig);
+       LDKCOption_ScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_ScalarZ), "LDKCOption_ScalarZ");
+       *ret_copy = COption_ScalarZ_clone(orig_conv);
+       int64_t ret_ref = tag_ptr(ret_copy, true);
+       return ret_ref;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SharedSecretNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
        LDKThirtyTwoBytes o_ref;
        CHECK((*env)->GetArrayLength(env, o) == 32);
index cdb12d6aca64972aa0bde4235b69114c0c0c69ba..0003f22af0f2f2529933d4be396ce01ac2bd872d 100644 (file)
@@ -8727,6 +8727,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1none
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1free
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    COption_ScalarZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone_1ptr
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    COption_ScalarZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1clone
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    CResult_SharedSecretNoneZ_ok