+++ /dev/null
-package org.ldk.enums;
-
-/**
- * An error enum representing a failure to persist a channel monitor update.
- */
-public enum ChannelMonitorUpdateErr {
- /**
- * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
- * our state failed, but is expected to succeed at some point in the future).
- *
- * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
- * submitting new commitment transactions to the counterparty. Once the update(s) that failed
- * have been successfully applied, a [`MonitorEvent::UpdateCompleted`] event should be returned
- * via [`Watch::release_pending_monitor_events`] which will then restore the channel to an
- * operational state.
- *
- * Note that a given ChannelManager will *never* re-generate a given ChannelMonitorUpdate. If
- * you return a TemporaryFailure you must ensure that it is written to disk safely before
- * writing out the latest ChannelManager state.
- *
- * Even when a channel has been \"frozen\" updates to the ChannelMonitor can continue to occur
- * (eg if an inbound HTLC which we forwarded was claimed upstream resulting in us attempting
- * to claim it on this channel) and those updates must be applied wherever they can be. At
- * least one such updated ChannelMonitor must be persisted otherwise PermanentFailure should
- * be returned to get things on-chain ASAP using only the in-memory copy. Obviously updates to
- * the channel which would invalidate previous ChannelMonitors are not made when a channel has
- * been \"frozen\".
- *
- * Note that even if updates made after TemporaryFailure succeed you must still provide a
- * [`MonitorEvent::UpdateCompleted`] to ensure you have the latest monitor and re-enable
- * normal channel operation. Note that this is normally generated through a call to
- * [`ChainMonitor::channel_monitor_updated`].
- *
- * Note that the update being processed here will not be replayed for you when you return a
- * [`MonitorEvent::UpdateCompleted`] event via [`Watch::release_pending_monitor_events`], so
- * you must store the update itself on your own local disk prior to returning a
- * TemporaryFailure. You may, of course, employ a journaling approach, storing only the
- * ChannelMonitorUpdate on disk without updating the monitor itself, replaying the journal at
- * reload-time.
- *
- * For deployments where a copy of ChannelMonitors and other local state are backed up in a
- * remote location (with local copies persisted immediately), it is anticipated that all
- * updates will return TemporaryFailure until the remote copies could be updated.
- *
- * [`ChainMonitor::channel_monitor_updated`]: chainmonitor::ChainMonitor::channel_monitor_updated
- */
- LDKChannelMonitorUpdateErr_TemporaryFailure,
- /**
- * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a
- * different watchtower and cannot update with all watchtowers that were previously informed
- * of this channel).
- *
- * At reception of this error, ChannelManager will force-close the channel and return at
- * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at
- * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel
- * update must be rejected.
- *
- * This failure may also signal a failure to update the local persisted copy of one of
- * the channel monitor instance.
- *
- * Note that even when you fail a holder commitment transaction update, you must store the
- * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor
- * broadcasts it (e.g distributed channel-monitor deployment)
- *
- * In case of distributed watchtowers deployment, the new version must be written to disk, as
- * state may have been stored but rejected due to a block forcing a commitment broadcast. This
- * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
- * lagging behind on block processing.
- */
- LDKChannelMonitorUpdateErr_PermanentFailure,
- ; static native void init();
- static { init(); }
-}
\ No newline at end of file
--- /dev/null
+package org.ldk.enums;
+
+/**
+ * An enum representing the status of a channel monitor update persistence.
+ */
+public enum ChannelMonitorUpdateStatus {
+ /**
+ * The update has been durably persisted and all copies of the relevant [`ChannelMonitor`]
+ * have been updated.
+ *
+ * This includes performing any `fsync()` calls required to ensure the update is guaranteed to
+ * be available on restart even if the application crashes.
+ */
+ LDKChannelMonitorUpdateStatus_Completed,
+ /**
+ * Used to indicate a temporary failure (eg connection to a watchtower or remote backup of
+ * our state failed, but is expected to succeed at some point in the future).
+ *
+ * Such a failure will \"freeze\" a channel, preventing us from revoking old states or
+ * submitting new commitment transactions to the counterparty. Once the update(s) which failed
+ * have been successfully applied, a [`MonitorEvent::Completed`] can be used to restore the
+ * channel to an operational state.
+ *
+ * Note that a given [`ChannelManager`] will *never* re-generate a [`ChannelMonitorUpdate`].
+ * If you return this error you must ensure that it is written to disk safely before writing
+ * the latest [`ChannelManager`] state, or you should return [`PermanentFailure`] instead.
+ *
+ * Even when a channel has been \"frozen\", updates to the [`ChannelMonitor`] can continue to
+ * occur (e.g. if an inbound HTLC which we forwarded was claimed upstream, resulting in us
+ * attempting to claim it on this channel) and those updates must still be persisted.
+ *
+ * No updates to the channel will be made which could invalidate other [`ChannelMonitor`]s
+ * until a [`MonitorEvent::Completed`] is provided, even if you return no error on a later
+ * monitor update for the same channel.
+ *
+ * For deployments where a copy of ChannelMonitors and other local state are backed up in a
+ * remote location (with local copies persisted immediately), it is anticipated that all
+ * updates will return [`InProgress`] until the remote copies could be updated.
+ *
+ * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
+ * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+ LDKChannelMonitorUpdateStatus_InProgress,
+ /**
+ * Used to indicate no further channel monitor updates will be allowed (likely a disk failure
+ * or a remote copy of this [`ChannelMonitor`] is no longer reachable and thus not updatable).
+ *
+ * When this is returned, [`ChannelManager`] will force-close the channel but *not* broadcast
+ * our current commitment transaction. This avoids a dangerous case where a local disk failure
+ * (e.g. the Linux-default remounting of the disk as read-only) causes [`PermanentFailure`]s
+ * for all monitor updates. If we were to broadcast our latest commitment transaction and then
+ * restart, we could end up reading a previous [`ChannelMonitor`] and [`ChannelManager`],
+ * revoking our now-broadcasted state before seeing it confirm and losing all our funds.
+ *
+ * Note that this is somewhat of a tradeoff - if the disk is really gone and we may have lost
+ * the data permanently, we really should broadcast immediately. If the data can be recovered
+ * with manual intervention, we'd rather close the channel, rejecting future updates to it,
+ * and broadcast the latest state only if we have HTLCs to claim which are timing out (which
+ * we do as long as blocks are connected).
+ *
+ * In order to broadcast the latest local commitment transaction, you'll need to call
+ * [`ChannelMonitor::get_latest_holder_commitment_txn`] and broadcast the resulting
+ * transactions once you've safely ensured no further channel updates can be generated by your
+ * [`ChannelManager`].
+ *
+ * Note that at least one final [`ChannelMonitorUpdate`] may still be provided, which must
+ * still be processed by a running [`ChannelMonitor`]. This final update will mark the
+ * [`ChannelMonitor`] as finalized, ensuring no further updates (e.g. revocation of the latest
+ * commitment transaction) are allowed.
+ *
+ * Note that even if you return a [`PermanentFailure`] due to unavailability of secondary
+ * [`ChannelMonitor`] copies, you should still make an attempt to store the update where
+ * possible to ensure you can claim HTLC outputs on the latest commitment transaction
+ * broadcasted later.
+ *
+ * In case of distributed watchtowers deployment, the new version must be written to disk, as
+ * state may have been stored but rejected due to a block forcing a commitment broadcast. This
+ * storage is used to claim outputs of rejected state confirmed onchain by another watchtower,
+ * lagging behind on block processing.
+ *
+ * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ */
+ LDKChannelMonitorUpdateStatus_PermanentFailure,
+ ; static native void init();
+ static { init(); }
+}
\ No newline at end of file
static { AccessError.values(); /* Force enum statics to run */ }
static { COption_NoneZ.values(); /* Force enum statics to run */ }
- static { ChannelMonitorUpdateErr.values(); /* Force enum statics to run */ }
+ static { ChannelMonitorUpdateStatus.values(); /* Force enum statics to run */ }
static { ConfirmationTarget.values(); /* Force enum statics to run */ }
static { CreationError.values(); /* Force enum statics to run */ }
static { Currency.values(); /* Force enum statics to run */ }
public static native long CResult_BlindedRouteNoneZ_get_ok(long owner);
// void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner);
public static native void CResult_BlindedRouteNoneZ_get_err(long owner);
+ public static class LDKDecodeError {
+ private LDKDecodeError() {}
+ public final static class UnknownVersion extends LDKDecodeError {
+ UnknownVersion() { }
+ }
+ public final static class UnknownRequiredFeature extends LDKDecodeError {
+ UnknownRequiredFeature() { }
+ }
+ public final static class InvalidValue extends LDKDecodeError {
+ InvalidValue() { }
+ }
+ public final static class ShortRead extends LDKDecodeError {
+ ShortRead() { }
+ }
+ public final static class BadLengthDescriptor extends LDKDecodeError {
+ BadLengthDescriptor() { }
+ }
+ public final static class Io extends LDKDecodeError {
+ public org.ldk.enums.IOError io;
+ Io(org.ldk.enums.IOError io) { this.io = io; }
+ }
+ public final static class UnsupportedCompression extends LDKDecodeError {
+ UnsupportedCompression() { }
+ }
+ static native void init();
+ }
+ static { LDKDecodeError.init(); }
+ public static native LDKDecodeError LDKDecodeError_ref_from_ptr(long ptr);
// struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_BlindedRouteDecodeErrorZ_get_ok(long owner);
// struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner);
public static native long C2Tuple_usizeTransactionZ_get_a(long owner);
// struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner);
public static native byte[] C2Tuple_usizeTransactionZ_get_b(long owner);
- // void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner);
- public static native void CResult_NoneChannelMonitorUpdateErrZ_get_ok(long owner);
- // enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner);
- public static native ChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(long owner);
public static class LDKMonitorEvent {
private LDKMonitorEvent() {}
public final static class HTLCEvent extends LDKMonitorEvent {
public long commitment_tx_confirmed;
CommitmentTxConfirmed(long commitment_tx_confirmed) { this.commitment_tx_confirmed = commitment_tx_confirmed; }
}
- public final static class UpdateCompleted extends LDKMonitorEvent {
+ public final static class Completed extends LDKMonitorEvent {
public long funding_txo;
public long monitor_update_id;
- UpdateCompleted(long funding_txo, long monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; }
+ Completed(long funding_txo, long monitor_update_id) { this.funding_txo = funding_txo; this.monitor_update_id = monitor_update_id; }
}
public final static class UpdateFailed extends LDKMonitorEvent {
public long update_failed;
public static native byte[] CResult_SecretKeyNoneZ_get_ok(long owner);
// void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner);
public static native void CResult_SecretKeyNoneZ_get_err(long owner);
+ // struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner);
+ public static native byte[] CResult_PublicKeyNoneZ_get_ok(long owner);
+ // void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner);
+ public static native void CResult_PublicKeyNoneZ_get_err(long owner);
public static class LDKCOption_ScalarZ {
private LDKCOption_ScalarZ() {}
public final static class Some extends LDKCOption_ScalarZ {
long sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
long sign_closing_transaction(long closing_tx);
+ long sign_holder_anchor_input(byte[] anchor_tx, long input);
long sign_channel_announcement(long msg);
void ready_channel(long channel_parameters);
}
public static native long BaseSign_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
// LDKCResult_SignatureNoneZ BaseSign_sign_closing_transaction LDKBaseSign *NONNULL_PTR this_arg, const struct LDKClosingTransaction *NONNULL_PTR closing_tx
public static native long BaseSign_sign_closing_transaction(long this_arg, long closing_tx);
+ // LDKCResult_SignatureNoneZ BaseSign_sign_holder_anchor_input LDKBaseSign *NONNULL_PTR this_arg, struct LDKTransaction anchor_tx, uintptr_t input
+ public static native long BaseSign_sign_holder_anchor_input(long this_arg, byte[] anchor_tx, long input);
// LDKCResult_C2Tuple_SignatureSignatureZNoneZ BaseSign_sign_channel_announcement LDKBaseSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg
public static native long BaseSign_sign_channel_announcement(long this_arg, long msg);
// void BaseSign_ready_channel LDKBaseSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters
public java.lang.String err;
ChannelUnavailable(java.lang.String err) { this.err = err; }
}
- public final static class MonitorUpdateFailed extends LDKAPIError {
- MonitorUpdateFailed() { }
+ public final static class MonitorUpdateInProgress extends LDKAPIError {
+ MonitorUpdateInProgress() { }
}
public final static class IncompatibleShutdownScript extends LDKAPIError {
public long script;
// struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner);
public static native long CResult_PhantomRouteHintsDecodeErrorZ_get_err(long owner);
public interface LDKWatch {
- long watch_channel(long funding_txo, long monitor);
- long update_channel(long funding_txo, long update);
+ ChannelMonitorUpdateStatus watch_channel(long funding_txo, long monitor);
+ ChannelMonitorUpdateStatus update_channel(long funding_txo, long update);
long[] release_pending_monitor_events();
}
public static native long LDKWatch_new(LDKWatch impl);
- // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor
- public static native long Watch_watch_channel(long this_arg, long funding_txo, long monitor);
- // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update
- public static native long Watch_update_channel(long this_arg, long funding_txo, long update);
+ // LDKChannelMonitorUpdateStatus Watch_watch_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor
+ public static native ChannelMonitorUpdateStatus Watch_watch_channel(long this_arg, long funding_txo, long monitor);
+ // LDKChannelMonitorUpdateStatus Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update
+ public static native ChannelMonitorUpdateStatus Watch_update_channel(long this_arg, long funding_txo, long update);
// LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg
public static native long[] Watch_release_pending_monitor_events(long this_arg);
public interface LDKBroadcasterInterface {
public static native void BroadcasterInterface_broadcast_transaction(long this_arg, byte[] tx);
public interface LDKKeysInterface {
long get_node_secret(Recipient recipient);
+ long get_node_id(Recipient recipient);
long ecdh(Recipient recipient, byte[] other_key, long tweak);
byte[] get_destination_script();
long get_shutdown_scriptpubkey();
public static native long LDKKeysInterface_new(LDKKeysInterface impl);
// LDKCResult_SecretKeyNoneZ KeysInterface_get_node_secret LDKKeysInterface *NONNULL_PTR this_arg, enum LDKRecipient recipient
public static native long KeysInterface_get_node_secret(long this_arg, Recipient recipient);
+ // LDKCResult_PublicKeyNoneZ KeysInterface_get_node_id LDKKeysInterface *NONNULL_PTR this_arg, enum LDKRecipient recipient
+ public static native long KeysInterface_get_node_id(long this_arg, Recipient recipient);
// LDKCResult_SharedSecretNoneZ KeysInterface_ecdh LDKKeysInterface *NONNULL_PTR this_arg, enum LDKRecipient recipient, struct LDKPublicKey other_key, struct LDKCOption_ScalarZ tweak
public static native long KeysInterface_ecdh(long this_arg, Recipient recipient, byte[] other_key, long tweak);
// LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface *NONNULL_PTR this_arg
public static native byte[] C2Tuple_PublicKeyTypeZ_get_a(long owner);
// struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner);
public static native long C2Tuple_PublicKeyTypeZ_get_b(long owner);
+ public interface LDKCustomOnionMessageContents {
+ long tlv_type();
+ byte[] write();
+ }
+ public static native long LDKCustomOnionMessageContents_new(LDKCustomOnionMessageContents impl);
+ // uint64_t CustomOnionMessageContents_tlv_type LDKCustomOnionMessageContents *NONNULL_PTR this_arg
+ public static native long CustomOnionMessageContents_tlv_type(long this_arg);
+ // LDKCVec_u8Z CustomOnionMessageContents_write LDKCustomOnionMessageContents *NONNULL_PTR this_arg
+ public static native byte[] CustomOnionMessageContents_write(long this_arg);
+ public static class LDKCOption_CustomOnionMessageContentsZ {
+ private LDKCOption_CustomOnionMessageContentsZ() {}
+ public final static class Some extends LDKCOption_CustomOnionMessageContentsZ {
+ public long some;
+ Some(long some) { this.some = some; }
+ }
+ public final static class None extends LDKCOption_CustomOnionMessageContentsZ {
+ None() { }
+ }
+ static native void init();
+ }
+ static { LDKCOption_CustomOnionMessageContentsZ.init(); }
+ public static native LDKCOption_CustomOnionMessageContentsZ LDKCOption_CustomOnionMessageContentsZ_ref_from_ptr(long ptr);
+ // struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner);
+ public static native long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(long owner);
+ // struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner);
+ public static native long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(long owner);
public static class LDKCOption_NetAddressZ {
private LDKCOption_NetAddressZ() {}
public final static class Some extends LDKCOption_NetAddressZ {
public final static class InvalidFirstHop extends LDKSendError {
InvalidFirstHop() { }
}
+ public final static class InvalidMessage extends LDKSendError {
+ InvalidMessage() { }
+ }
public final static class BufferFull extends LDKSendError {
BufferFull() { }
}
// LDKCVec_TxidZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg
public static native byte[][] Confirm_get_relevant_txids(long this_arg);
public interface LDKPersist {
- long persist_new_channel(long channel_id, long data, long update_id);
- long update_persisted_channel(long channel_id, long update, long data, long update_id);
+ ChannelMonitorUpdateStatus persist_new_channel(long channel_id, long data, long update_id);
+ ChannelMonitorUpdateStatus update_persisted_channel(long channel_id, long update, long data, long update_id);
}
public static native long LDKPersist_new(LDKPersist impl);
- // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
- public static native long Persist_persist_new_channel(long this_arg, long channel_id, long data, long update_id);
- // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
- public static native long Persist_update_persisted_channel(long this_arg, long channel_id, long update, long data, long update_id);
+ // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
+ public static native ChannelMonitorUpdateStatus Persist_persist_new_channel(long this_arg, long channel_id, long data, long update_id);
+ // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id
+ public static native ChannelMonitorUpdateStatus Persist_update_persisted_channel(long this_arg, long channel_id, long update, long data, long update_id);
public interface LDKChannelMessageHandler {
void handle_open_channel(byte[] their_node_id, long their_features, long msg);
void handle_accept_channel(byte[] their_node_id, long their_features, long msg);
void handle_update_fee(byte[] their_node_id, long msg);
void handle_announcement_signatures(byte[] their_node_id, long msg);
void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
- void peer_connected(byte[] their_node_id, long msg);
+ long peer_connected(byte[] their_node_id, long msg);
void handle_channel_reestablish(byte[] their_node_id, long msg);
void handle_channel_update(byte[] their_node_id, long msg);
void handle_error(byte[] their_node_id, long msg);
public static native void ChannelMessageHandler_handle_announcement_signatures(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible
public static native void ChannelMessageHandler_peer_disconnected(long this_arg, byte[] their_node_id, boolean no_connection_possible);
- // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg
- public static native void ChannelMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long msg);
+ // LDKCResult_NoneNoneZ ChannelMessageHandler_peer_connected LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg
+ public static native long ChannelMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg
public static native void ChannelMessageHandler_handle_channel_reestablish(long this_arg, byte[] their_node_id, long msg);
// void ChannelMessageHandler_handle_channel_update LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg
long handle_channel_update(long msg);
long get_next_channel_announcement(long starting_point);
long get_next_node_announcement(byte[] starting_point);
- void peer_connected(byte[] their_node_id, long init);
+ long peer_connected(byte[] their_node_id, long init);
long handle_reply_channel_range(byte[] their_node_id, long msg);
long handle_reply_short_channel_ids_end(byte[] their_node_id, long msg);
long handle_query_channel_range(byte[] their_node_id, long msg);
public static native long RoutingMessageHandler_get_next_channel_announcement(long this_arg, long starting_point);
// LDKNodeAnnouncement RoutingMessageHandler_get_next_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey starting_point
public static native long RoutingMessageHandler_get_next_node_announcement(long this_arg, byte[] starting_point);
- // void RoutingMessageHandler_peer_connected LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init
- public static native void RoutingMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long init);
+ // LDKCResult_NoneNoneZ RoutingMessageHandler_peer_connected LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init
+ public static native long RoutingMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long init);
// LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg
public static native long RoutingMessageHandler_handle_reply_channel_range(long this_arg, byte[] their_node_id, long msg);
// LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg
public static native long RoutingMessageHandler_provided_init_features(long this_arg, byte[] their_node_id);
public interface LDKOnionMessageHandler {
void handle_onion_message(byte[] peer_node_id, long msg);
- void peer_connected(byte[] their_node_id, long init);
+ long peer_connected(byte[] their_node_id, long init);
void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
long provided_node_features();
long provided_init_features(byte[] their_node_id);
public static native long LDKOnionMessageHandler_get_OnionMessageProvider(long arg);
// void OnionMessageHandler_handle_onion_message LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg
public static native void OnionMessageHandler_handle_onion_message(long this_arg, byte[] peer_node_id, long msg);
- // void OnionMessageHandler_peer_connected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init
- public static native void OnionMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long init);
+ // LDKCResult_NoneNoneZ OnionMessageHandler_peer_connected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init
+ public static native long OnionMessageHandler_peer_connected(long this_arg, byte[] their_node_id, long init);
// void OnionMessageHandler_peer_disconnected LDKOnionMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible
public static native void OnionMessageHandler_peer_disconnected(long this_arg, byte[] their_node_id, boolean no_connection_possible);
// LDKNodeFeatures OnionMessageHandler_provided_node_features LDKOnionMessageHandler *NONNULL_PTR this_arg
public static native long CustomMessageHandler_handle_custom_message(long this_arg, long msg, byte[] sender_node_id);
// LDKCVec_C2Tuple_PublicKeyTypeZZ CustomMessageHandler_get_and_clear_pending_msg LDKCustomMessageHandler *NONNULL_PTR this_arg
public static native long[] CustomMessageHandler_get_and_clear_pending_msg(long this_arg);
+ public interface LDKCustomOnionMessageHandler {
+ void handle_custom_message(long msg);
+ long read_custom_message(long message_type, byte[] buffer);
+ }
+ public static native long LDKCustomOnionMessageHandler_new(LDKCustomOnionMessageHandler impl);
+ // void CustomOnionMessageHandler_handle_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, struct LDKCustomOnionMessageContents msg
+ public static native void CustomOnionMessageHandler_handle_custom_message(long this_arg, long msg);
+ // LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CustomOnionMessageHandler_read_custom_message LDKCustomOnionMessageHandler *NONNULL_PTR this_arg, uint64_t message_type, struct LDKu8slice buffer
+ public static native long CustomOnionMessageHandler_read_custom_message(long this_arg, long message_type, byte[] buffer);
public interface LDKSocketDescriptor {
long send_data(byte[] data, boolean resume_read);
void disconnect_socket();
public static native void CVec_C2Tuple_usizeTransactionZZ_free(long[] _res);
// void CVec_TxidZ_free(struct LDKCVec_TxidZ _res);
public static native void CVec_TxidZ_free(byte[][] _res);
- // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
- public static native long CResult_NoneChannelMonitorUpdateErrZ_ok();
- // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e);
- public static native long CResult_NoneChannelMonitorUpdateErrZ_err(ChannelMonitorUpdateErr e);
- // bool CResult_NoneChannelMonitorUpdateErrZ_is_ok(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR o);
- public static native boolean CResult_NoneChannelMonitorUpdateErrZ_is_ok(long o);
- // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res);
- public static native void CResult_NoneChannelMonitorUpdateErrZ_free(long _res);
- // uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg);
- public static native long CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(long arg);
- // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_clone(const struct LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR orig);
- public static native long CResult_NoneChannelMonitorUpdateErrZ_clone(long orig);
// void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res);
public static native void CVec_MonitorEventZ_free(long[] _res);
// uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg);
public static native long CResult_SecretKeyNoneZ_clone_ptr(long arg);
// struct LDKCResult_SecretKeyNoneZ CResult_SecretKeyNoneZ_clone(const struct LDKCResult_SecretKeyNoneZ *NONNULL_PTR orig);
public static native long CResult_SecretKeyNoneZ_clone(long orig);
+ // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_ok(struct LDKPublicKey o);
+ public static native long CResult_PublicKeyNoneZ_ok(byte[] o);
+ // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_err(void);
+ public static native long CResult_PublicKeyNoneZ_err();
+ // bool CResult_PublicKeyNoneZ_is_ok(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR o);
+ public static native boolean CResult_PublicKeyNoneZ_is_ok(long o);
+ // void CResult_PublicKeyNoneZ_free(struct LDKCResult_PublicKeyNoneZ _res);
+ public static native void CResult_PublicKeyNoneZ_free(long _res);
+ // uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg);
+ public static native long CResult_PublicKeyNoneZ_clone_ptr(long arg);
+ // struct LDKCResult_PublicKeyNoneZ CResult_PublicKeyNoneZ_clone(const struct LDKCResult_PublicKeyNoneZ *NONNULL_PTR orig);
+ public static native long CResult_PublicKeyNoneZ_clone(long orig);
// struct LDKCOption_ScalarZ COption_ScalarZ_some(struct LDKBigEndianScalar o);
public static native long COption_ScalarZ_some(long o);
// struct LDKCOption_ScalarZ COption_ScalarZ_none(void);
public static native void C2Tuple_PublicKeyTypeZ_free(long _res);
// void CVec_C2Tuple_PublicKeyTypeZZ_free(struct LDKCVec_C2Tuple_PublicKeyTypeZZ _res);
public static native void CVec_C2Tuple_PublicKeyTypeZZ_free(long[] _res);
+ // struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_some(struct LDKCustomOnionMessageContents o);
+ public static native long COption_CustomOnionMessageContentsZ_some(long o);
+ // struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_none(void);
+ public static native long COption_CustomOnionMessageContentsZ_none();
+ // void COption_CustomOnionMessageContentsZ_free(struct LDKCOption_CustomOnionMessageContentsZ _res);
+ public static native void COption_CustomOnionMessageContentsZ_free(long _res);
+ // uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg);
+ public static native long COption_CustomOnionMessageContentsZ_clone_ptr(long arg);
+ // struct LDKCOption_CustomOnionMessageContentsZ COption_CustomOnionMessageContentsZ_clone(const struct LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR orig);
+ public static native long COption_CustomOnionMessageContentsZ_clone(long orig);
+ // struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(struct LDKCOption_CustomOnionMessageContentsZ o);
+ public static native long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(long o);
+ // struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(struct LDKDecodeError e);
+ public static native long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(long e);
+ // bool CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR o);
+ public static native boolean CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(long o);
+ // void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res);
+ public static native void CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(long _res);
+ // uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg);
+ public static native long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(long arg);
+ // struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(const struct LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR orig);
+ public static native long CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(long orig);
// struct LDKCOption_NetAddressZ COption_NetAddressZ_some(struct LDKNetAddress o);
public static native long COption_NetAddressZ_some(long o);
// struct LDKCOption_NetAddressZ COption_NetAddressZ_none(void);
public static native long ClosureReason_disconnected_peer();
// struct LDKClosureReason ClosureReason_outdated_channel_manager(void);
public static native long ClosureReason_outdated_channel_manager();
+ // bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b);
+ public static native boolean ClosureReason_eq(long a, long b);
// struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj);
public static native byte[] ClosureReason_write(long obj);
// struct LDKCResult_COption_ClosureReasonZDecodeErrorZ ClosureReason_read(struct LDKu8slice ser);
public static native long HTLCDestination_unknown_next_hop(long requested_forward_scid);
// struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash);
public static native long HTLCDestination_failed_payment(byte[] payment_hash);
+ // bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b);
+ public static native boolean HTLCDestination_eq(long a, long b);
// struct LDKCVec_u8Z HTLCDestination_write(const struct LDKHTLCDestination *NONNULL_PTR obj);
public static native byte[] HTLCDestination_write(long obj);
// struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ HTLCDestination_read(struct LDKu8slice ser);
public static native long APIError_route_error(String err);
// struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
public static native long APIError_channel_unavailable(String err);
- // struct LDKAPIError APIError_monitor_update_failed(void);
- public static native long APIError_monitor_update_failed();
+ // struct LDKAPIError APIError_monitor_update_in_progress(void);
+ public static native long APIError_monitor_update_in_progress();
// struct LDKAPIError APIError_incompatible_shutdown_script(struct LDKShutdownScript script);
public static native long APIError_incompatible_shutdown_script(long script);
+ // bool APIError_eq(const struct LDKAPIError *NONNULL_PTR a, const struct LDKAPIError *NONNULL_PTR b);
+ public static native boolean APIError_eq(long a, long b);
// void BigSize_free(struct LDKBigSize this_obj);
public static native void BigSize_free(long this_obj);
// uint64_t BigSize_get_a(const struct LDKBigSize *NONNULL_PTR this_ptr);
public static native long Hostname_clone_ptr(long arg);
// struct LDKHostname Hostname_clone(const struct LDKHostname *NONNULL_PTR orig);
public static native long Hostname_clone(long orig);
+ // bool Hostname_eq(const struct LDKHostname *NONNULL_PTR a, const struct LDKHostname *NONNULL_PTR b);
+ public static native boolean Hostname_eq(long a, long b);
// MUST_USE_RES uint8_t Hostname_len(const struct LDKHostname *NONNULL_PTR this_arg);
public static native byte Hostname_len(long this_arg);
// struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
public static native long ChannelConfig_clone_ptr(long arg);
// struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig);
public static native long ChannelConfig_clone(long orig);
+ // bool ChannelConfig_eq(const struct LDKChannelConfig *NONNULL_PTR a, const struct LDKChannelConfig *NONNULL_PTR b);
+ public static native boolean ChannelConfig_eq(long a, long b);
// MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void);
public static native long ChannelConfig_default();
// struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj);
public static native long BestBlock_clone_ptr(long arg);
// struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig);
public static native long BestBlock_clone(long orig);
+ // bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b);
+ public static native boolean BestBlock_eq(long a, long b);
// MUST_USE_RES struct LDKBestBlock BestBlock_from_genesis(enum LDKNetwork network);
public static native long BestBlock_from_genesis(Network network);
// MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height);
public static native void Listen_free(long this_ptr);
// void Confirm_free(struct LDKConfirm this_ptr);
public static native void Confirm_free(long this_ptr);
- // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
- public static native ChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(long orig);
- // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
- public static native ChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure();
- // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
- public static native ChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure();
+ // enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR orig);
+ public static native ChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_clone(long orig);
+ // enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed(void);
+ public static native ChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_completed();
+ // enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress(void);
+ public static native ChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_in_progress();
+ // enum LDKChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure(void);
+ public static native ChannelMonitorUpdateStatus ChannelMonitorUpdateStatus_permanent_failure();
+ // bool ChannelMonitorUpdateStatus_eq(const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR a, const enum LDKChannelMonitorUpdateStatus *NONNULL_PTR b);
+ public static native boolean ChannelMonitorUpdateStatus_eq(long a, long b);
// void Watch_free(struct LDKWatch this_ptr);
public static native void Watch_free(long this_ptr);
// void Filter_free(struct LDKFilter this_ptr);
public static native long WatchedOutput_clone_ptr(long arg);
// struct LDKWatchedOutput WatchedOutput_clone(const struct LDKWatchedOutput *NONNULL_PTR orig);
public static native long WatchedOutput_clone(long orig);
+ // bool WatchedOutput_eq(const struct LDKWatchedOutput *NONNULL_PTR a, const struct LDKWatchedOutput *NONNULL_PTR b);
+ public static native boolean WatchedOutput_eq(long a, long b);
// uint64_t WatchedOutput_hash(const struct LDKWatchedOutput *NONNULL_PTR o);
public static native long WatchedOutput_hash(long o);
// void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr);
public static native long MonitorEvent_htlcevent(long a);
// struct LDKMonitorEvent MonitorEvent_commitment_tx_confirmed(struct LDKOutPoint a);
public static native long MonitorEvent_commitment_tx_confirmed(long a);
- // struct LDKMonitorEvent MonitorEvent_update_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
- public static native long MonitorEvent_update_completed(long funding_txo, long monitor_update_id);
+ // struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id);
+ public static native long MonitorEvent_completed(long funding_txo, long monitor_update_id);
// struct LDKMonitorEvent MonitorEvent_update_failed(struct LDKOutPoint a);
public static native long MonitorEvent_update_failed(long a);
+ // bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b);
+ public static native boolean MonitorEvent_eq(long a, long b);
// struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj);
public static native byte[] MonitorEvent_write(long obj);
// struct LDKCResult_COption_MonitorEventZDecodeErrorZ MonitorEvent_read(struct LDKu8slice ser);
public static native long HTLCUpdate_clone_ptr(long arg);
// struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
public static native long HTLCUpdate_clone(long orig);
+ // bool HTLCUpdate_eq(const struct LDKHTLCUpdate *NONNULL_PTR a, const struct LDKHTLCUpdate *NONNULL_PTR b);
+ public static native boolean HTLCUpdate_eq(long a, long b);
// struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj);
public static native byte[] HTLCUpdate_write(long obj);
// struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
public static native long DelayedPaymentOutputDescriptor_clone_ptr(long arg);
// struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig);
public static native long DelayedPaymentOutputDescriptor_clone(long orig);
+ // bool DelayedPaymentOutputDescriptor_eq(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR b);
+ public static native boolean DelayedPaymentOutputDescriptor_eq(long a, long b);
// struct LDKCVec_u8Z DelayedPaymentOutputDescriptor_write(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR obj);
public static native byte[] DelayedPaymentOutputDescriptor_write(long obj);
// struct LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ DelayedPaymentOutputDescriptor_read(struct LDKu8slice ser);
public static native long StaticPaymentOutputDescriptor_clone_ptr(long arg);
// struct LDKStaticPaymentOutputDescriptor StaticPaymentOutputDescriptor_clone(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR orig);
public static native long StaticPaymentOutputDescriptor_clone(long orig);
+ // bool StaticPaymentOutputDescriptor_eq(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR a, const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR b);
+ public static native boolean StaticPaymentOutputDescriptor_eq(long a, long b);
// struct LDKCVec_u8Z StaticPaymentOutputDescriptor_write(const struct LDKStaticPaymentOutputDescriptor *NONNULL_PTR obj);
public static native byte[] StaticPaymentOutputDescriptor_write(long obj);
// struct LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ StaticPaymentOutputDescriptor_read(struct LDKu8slice ser);
public static native long SpendableOutputDescriptor_delayed_payment_output(long a);
// struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
public static native long SpendableOutputDescriptor_static_payment_output(long a);
+ // bool SpendableOutputDescriptor_eq(const struct LDKSpendableOutputDescriptor *NONNULL_PTR a, const struct LDKSpendableOutputDescriptor *NONNULL_PTR b);
+ public static native boolean SpendableOutputDescriptor_eq(long a, long b);
// struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
public static native byte[] SpendableOutputDescriptor_write(long obj);
// struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
public static native long ChannelManager_current_best_block(long this_arg);
// struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg);
public static native long ChannelManager_as_ChannelMessageHandler(long this_arg);
+ // struct LDKNodeFeatures provided_node_features(void);
+ public static native long provided_node_features();
+ // struct LDKChannelFeatures provided_channel_features(void);
+ public static native long provided_channel_features();
+ // struct LDKInitFeatures provided_init_features(void);
+ public static native long provided_init_features();
// struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj);
public static native byte[] CounterpartyForwardingInfo_write(long obj);
// struct LDKCResult_CounterpartyForwardingInfoDecodeErrorZ CounterpartyForwardingInfo_read(struct LDKu8slice ser);
public static native long create(long keys, long min_value_msat, int invoice_expiry_delta_secs, long keys_manager, long current_time);
// struct LDKCResult_PaymentSecretNoneZ create_from_hash(const struct LDKExpandedKey *NONNULL_PTR keys, struct LDKCOption_u64Z min_value_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, uint64_t current_time);
public static native long create_from_hash(long keys, long min_value_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long current_time);
- // void DecodeError_free(struct LDKDecodeError this_obj);
- public static native void DecodeError_free(long this_obj);
+ // void DecodeError_free(struct LDKDecodeError this_ptr);
+ public static native void DecodeError_free(long this_ptr);
// uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg);
public static native long DecodeError_clone_ptr(long arg);
// struct LDKDecodeError DecodeError_clone(const struct LDKDecodeError *NONNULL_PTR orig);
public static native long DecodeError_clone(long orig);
+ // struct LDKDecodeError DecodeError_unknown_version(void);
+ public static native long DecodeError_unknown_version();
+ // struct LDKDecodeError DecodeError_unknown_required_feature(void);
+ public static native long DecodeError_unknown_required_feature();
+ // struct LDKDecodeError DecodeError_invalid_value(void);
+ public static native long DecodeError_invalid_value();
+ // struct LDKDecodeError DecodeError_short_read(void);
+ public static native long DecodeError_short_read();
+ // struct LDKDecodeError DecodeError_bad_length_descriptor(void);
+ public static native long DecodeError_bad_length_descriptor();
+ // struct LDKDecodeError DecodeError_io(enum LDKIOError a);
+ public static native long DecodeError_io(IOError a);
+ // struct LDKDecodeError DecodeError_unsupported_compression(void);
+ public static native long DecodeError_unsupported_compression();
+ // bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b);
+ public static native boolean DecodeError_eq(long a, long b);
// void Init_free(struct LDKInit this_obj);
public static native void Init_free(long this_obj);
// struct LDKInitFeatures Init_get_features(const struct LDKInit *NONNULL_PTR this_ptr);
public static native long Init_clone_ptr(long arg);
// struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig);
public static native long Init_clone(long orig);
+ // bool Init_eq(const struct LDKInit *NONNULL_PTR a, const struct LDKInit *NONNULL_PTR b);
+ public static native boolean Init_eq(long a, long b);
// void ErrorMessage_free(struct LDKErrorMessage this_obj);
public static native void ErrorMessage_free(long this_obj);
// const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32];
public static native long ErrorMessage_clone_ptr(long arg);
// struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig);
public static native long ErrorMessage_clone(long orig);
+ // bool ErrorMessage_eq(const struct LDKErrorMessage *NONNULL_PTR a, const struct LDKErrorMessage *NONNULL_PTR b);
+ public static native boolean ErrorMessage_eq(long a, long b);
// void WarningMessage_free(struct LDKWarningMessage this_obj);
public static native void WarningMessage_free(long this_obj);
// const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32];
public static native long WarningMessage_clone_ptr(long arg);
// struct LDKWarningMessage WarningMessage_clone(const struct LDKWarningMessage *NONNULL_PTR orig);
public static native long WarningMessage_clone(long orig);
+ // bool WarningMessage_eq(const struct LDKWarningMessage *NONNULL_PTR a, const struct LDKWarningMessage *NONNULL_PTR b);
+ public static native boolean WarningMessage_eq(long a, long b);
// void Ping_free(struct LDKPing this_obj);
public static native void Ping_free(long this_obj);
// uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr);
public static native long Ping_clone_ptr(long arg);
// struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig);
public static native long Ping_clone(long orig);
+ // bool Ping_eq(const struct LDKPing *NONNULL_PTR a, const struct LDKPing *NONNULL_PTR b);
+ public static native boolean Ping_eq(long a, long b);
// void Pong_free(struct LDKPong this_obj);
public static native void Pong_free(long this_obj);
// uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr);
public static native long Pong_clone_ptr(long arg);
// struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig);
public static native long Pong_clone(long orig);
+ // bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b);
+ public static native boolean Pong_eq(long a, long b);
// void OpenChannel_free(struct LDKOpenChannel this_obj);
public static native void OpenChannel_free(long this_obj);
// const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32];
public static native long OpenChannel_clone_ptr(long arg);
// struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig);
public static native long OpenChannel_clone(long orig);
+ // bool OpenChannel_eq(const struct LDKOpenChannel *NONNULL_PTR a, const struct LDKOpenChannel *NONNULL_PTR b);
+ public static native boolean OpenChannel_eq(long a, long b);
// void AcceptChannel_free(struct LDKAcceptChannel this_obj);
public static native void AcceptChannel_free(long this_obj);
// const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32];
public static native long AcceptChannel_clone_ptr(long arg);
// struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig);
public static native long AcceptChannel_clone(long orig);
+ // bool AcceptChannel_eq(const struct LDKAcceptChannel *NONNULL_PTR a, const struct LDKAcceptChannel *NONNULL_PTR b);
+ public static native boolean AcceptChannel_eq(long a, long b);
// void FundingCreated_free(struct LDKFundingCreated this_obj);
public static native void FundingCreated_free(long this_obj);
// const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32];
public static native long FundingCreated_clone_ptr(long arg);
// struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig);
public static native long FundingCreated_clone(long orig);
+ // bool FundingCreated_eq(const struct LDKFundingCreated *NONNULL_PTR a, const struct LDKFundingCreated *NONNULL_PTR b);
+ public static native boolean FundingCreated_eq(long a, long b);
// void FundingSigned_free(struct LDKFundingSigned this_obj);
public static native void FundingSigned_free(long this_obj);
// const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32];
public static native long FundingSigned_clone_ptr(long arg);
// struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig);
public static native long FundingSigned_clone(long orig);
+ // bool FundingSigned_eq(const struct LDKFundingSigned *NONNULL_PTR a, const struct LDKFundingSigned *NONNULL_PTR b);
+ public static native boolean FundingSigned_eq(long a, long b);
// void ChannelReady_free(struct LDKChannelReady this_obj);
public static native void ChannelReady_free(long this_obj);
// const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32];
public static native long ChannelReady_clone_ptr(long arg);
// struct LDKChannelReady ChannelReady_clone(const struct LDKChannelReady *NONNULL_PTR orig);
public static native long ChannelReady_clone(long orig);
+ // bool ChannelReady_eq(const struct LDKChannelReady *NONNULL_PTR a, const struct LDKChannelReady *NONNULL_PTR b);
+ public static native boolean ChannelReady_eq(long a, long b);
// void Shutdown_free(struct LDKShutdown this_obj);
public static native void Shutdown_free(long this_obj);
// const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32];
public static native long Shutdown_clone_ptr(long arg);
// struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig);
public static native long Shutdown_clone(long orig);
+ // bool Shutdown_eq(const struct LDKShutdown *NONNULL_PTR a, const struct LDKShutdown *NONNULL_PTR b);
+ public static native boolean Shutdown_eq(long a, long b);
// void ClosingSignedFeeRange_free(struct LDKClosingSignedFeeRange this_obj);
public static native void ClosingSignedFeeRange_free(long this_obj);
// uint64_t ClosingSignedFeeRange_get_min_fee_satoshis(const struct LDKClosingSignedFeeRange *NONNULL_PTR this_ptr);
public static native long ClosingSignedFeeRange_clone_ptr(long arg);
// struct LDKClosingSignedFeeRange ClosingSignedFeeRange_clone(const struct LDKClosingSignedFeeRange *NONNULL_PTR orig);
public static native long ClosingSignedFeeRange_clone(long orig);
+ // bool ClosingSignedFeeRange_eq(const struct LDKClosingSignedFeeRange *NONNULL_PTR a, const struct LDKClosingSignedFeeRange *NONNULL_PTR b);
+ public static native boolean ClosingSignedFeeRange_eq(long a, long b);
// void ClosingSigned_free(struct LDKClosingSigned this_obj);
public static native void ClosingSigned_free(long this_obj);
// const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32];
public static native long ClosingSigned_clone_ptr(long arg);
// struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig);
public static native long ClosingSigned_clone(long orig);
+ // bool ClosingSigned_eq(const struct LDKClosingSigned *NONNULL_PTR a, const struct LDKClosingSigned *NONNULL_PTR b);
+ public static native boolean ClosingSigned_eq(long a, long b);
// void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj);
public static native void UpdateAddHTLC_free(long this_obj);
// const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32];
public static native long UpdateAddHTLC_clone_ptr(long arg);
// struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig);
public static native long UpdateAddHTLC_clone(long orig);
+ // bool UpdateAddHTLC_eq(const struct LDKUpdateAddHTLC *NONNULL_PTR a, const struct LDKUpdateAddHTLC *NONNULL_PTR b);
+ public static native boolean UpdateAddHTLC_eq(long a, long b);
// void OnionMessage_free(struct LDKOnionMessage this_obj);
public static native void OnionMessage_free(long this_obj);
// struct LDKPublicKey OnionMessage_get_blinding_point(const struct LDKOnionMessage *NONNULL_PTR this_ptr);
public static native long OnionMessage_clone_ptr(long arg);
// struct LDKOnionMessage OnionMessage_clone(const struct LDKOnionMessage *NONNULL_PTR orig);
public static native long OnionMessage_clone(long orig);
+ // bool OnionMessage_eq(const struct LDKOnionMessage *NONNULL_PTR a, const struct LDKOnionMessage *NONNULL_PTR b);
+ public static native boolean OnionMessage_eq(long a, long b);
// void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj);
public static native void UpdateFulfillHTLC_free(long this_obj);
// const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32];
public static native long UpdateFulfillHTLC_clone_ptr(long arg);
// struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig);
public static native long UpdateFulfillHTLC_clone(long orig);
+ // bool UpdateFulfillHTLC_eq(const struct LDKUpdateFulfillHTLC *NONNULL_PTR a, const struct LDKUpdateFulfillHTLC *NONNULL_PTR b);
+ public static native boolean UpdateFulfillHTLC_eq(long a, long b);
// void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj);
public static native void UpdateFailHTLC_free(long this_obj);
// const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32];
public static native long UpdateFailHTLC_clone_ptr(long arg);
// struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig);
public static native long UpdateFailHTLC_clone(long orig);
+ // bool UpdateFailHTLC_eq(const struct LDKUpdateFailHTLC *NONNULL_PTR a, const struct LDKUpdateFailHTLC *NONNULL_PTR b);
+ public static native boolean UpdateFailHTLC_eq(long a, long b);
// void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj);
public static native void UpdateFailMalformedHTLC_free(long this_obj);
// const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32];
public static native long UpdateFailMalformedHTLC_clone_ptr(long arg);
// struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig);
public static native long UpdateFailMalformedHTLC_clone(long orig);
+ // bool UpdateFailMalformedHTLC_eq(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR a, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR b);
+ public static native boolean UpdateFailMalformedHTLC_eq(long a, long b);
// void CommitmentSigned_free(struct LDKCommitmentSigned this_obj);
public static native void CommitmentSigned_free(long this_obj);
// const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32];
public static native long CommitmentSigned_clone_ptr(long arg);
// struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig);
public static native long CommitmentSigned_clone(long orig);
+ // bool CommitmentSigned_eq(const struct LDKCommitmentSigned *NONNULL_PTR a, const struct LDKCommitmentSigned *NONNULL_PTR b);
+ public static native boolean CommitmentSigned_eq(long a, long b);
// void RevokeAndACK_free(struct LDKRevokeAndACK this_obj);
public static native void RevokeAndACK_free(long this_obj);
// const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32];
public static native long RevokeAndACK_clone_ptr(long arg);
// struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig);
public static native long RevokeAndACK_clone(long orig);
+ // bool RevokeAndACK_eq(const struct LDKRevokeAndACK *NONNULL_PTR a, const struct LDKRevokeAndACK *NONNULL_PTR b);
+ public static native boolean RevokeAndACK_eq(long a, long b);
// void UpdateFee_free(struct LDKUpdateFee this_obj);
public static native void UpdateFee_free(long this_obj);
// const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32];
public static native long UpdateFee_clone_ptr(long arg);
// struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig);
public static native long UpdateFee_clone(long orig);
+ // bool UpdateFee_eq(const struct LDKUpdateFee *NONNULL_PTR a, const struct LDKUpdateFee *NONNULL_PTR b);
+ public static native boolean UpdateFee_eq(long a, long b);
// void DataLossProtect_free(struct LDKDataLossProtect this_obj);
public static native void DataLossProtect_free(long this_obj);
// const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32];
public static native long DataLossProtect_clone_ptr(long arg);
// struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig);
public static native long DataLossProtect_clone(long orig);
+ // bool DataLossProtect_eq(const struct LDKDataLossProtect *NONNULL_PTR a, const struct LDKDataLossProtect *NONNULL_PTR b);
+ public static native boolean DataLossProtect_eq(long a, long b);
// void ChannelReestablish_free(struct LDKChannelReestablish this_obj);
public static native void ChannelReestablish_free(long this_obj);
// const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32];
public static native long ChannelReestablish_clone_ptr(long arg);
// struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig);
public static native long ChannelReestablish_clone(long orig);
+ // bool ChannelReestablish_eq(const struct LDKChannelReestablish *NONNULL_PTR a, const struct LDKChannelReestablish *NONNULL_PTR b);
+ public static native boolean ChannelReestablish_eq(long a, long b);
// void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj);
public static native void AnnouncementSignatures_free(long this_obj);
// const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32];
public static native long AnnouncementSignatures_clone_ptr(long arg);
// struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig);
public static native long AnnouncementSignatures_clone(long orig);
+ // bool AnnouncementSignatures_eq(const struct LDKAnnouncementSignatures *NONNULL_PTR a, const struct LDKAnnouncementSignatures *NONNULL_PTR b);
+ public static native boolean AnnouncementSignatures_eq(long a, long b);
// void NetAddress_free(struct LDKNetAddress this_ptr);
public static native void NetAddress_free(long this_ptr);
// uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg);
public static native long NetAddress_onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port);
// struct LDKNetAddress NetAddress_hostname(struct LDKHostname hostname, uint16_t port);
public static native long NetAddress_hostname(long hostname, short port);
+ // bool NetAddress_eq(const struct LDKNetAddress *NONNULL_PTR a, const struct LDKNetAddress *NONNULL_PTR b);
+ public static native boolean NetAddress_eq(long a, long b);
// struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
public static native byte[] NetAddress_write(long obj);
// struct LDKCResult_NetAddressDecodeErrorZ NetAddress_read(struct LDKu8slice ser);
public static native long UnsignedNodeAnnouncement_clone_ptr(long arg);
// struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig);
public static native long UnsignedNodeAnnouncement_clone(long orig);
+ // bool UnsignedNodeAnnouncement_eq(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR a, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR b);
+ public static native boolean UnsignedNodeAnnouncement_eq(long a, long b);
// void NodeAnnouncement_free(struct LDKNodeAnnouncement this_obj);
public static native void NodeAnnouncement_free(long this_obj);
// struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr);
public static native long NodeAnnouncement_clone_ptr(long arg);
// struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig);
public static native long NodeAnnouncement_clone(long orig);
+ // bool NodeAnnouncement_eq(const struct LDKNodeAnnouncement *NONNULL_PTR a, const struct LDKNodeAnnouncement *NONNULL_PTR b);
+ public static native boolean NodeAnnouncement_eq(long a, long b);
// void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_obj);
public static native void UnsignedChannelAnnouncement_free(long this_obj);
// struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr);
public static native long UnsignedChannelAnnouncement_clone_ptr(long arg);
// struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig);
public static native long UnsignedChannelAnnouncement_clone(long orig);
+ // bool UnsignedChannelAnnouncement_eq(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR a, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR b);
+ public static native boolean UnsignedChannelAnnouncement_eq(long a, long b);
// void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_obj);
public static native void ChannelAnnouncement_free(long this_obj);
// struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr);
public static native long ChannelAnnouncement_clone_ptr(long arg);
// struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig);
public static native long ChannelAnnouncement_clone(long orig);
+ // bool ChannelAnnouncement_eq(const struct LDKChannelAnnouncement *NONNULL_PTR a, const struct LDKChannelAnnouncement *NONNULL_PTR b);
+ public static native boolean ChannelAnnouncement_eq(long a, long b);
// void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_obj);
public static native void UnsignedChannelUpdate_free(long this_obj);
// const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32];
public static native long UnsignedChannelUpdate_clone_ptr(long arg);
// struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig);
public static native long UnsignedChannelUpdate_clone(long orig);
+ // bool UnsignedChannelUpdate_eq(const struct LDKUnsignedChannelUpdate *NONNULL_PTR a, const struct LDKUnsignedChannelUpdate *NONNULL_PTR b);
+ public static native boolean UnsignedChannelUpdate_eq(long a, long b);
// void ChannelUpdate_free(struct LDKChannelUpdate this_obj);
public static native void ChannelUpdate_free(long this_obj);
// struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr);
public static native long ChannelUpdate_clone_ptr(long arg);
// struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig);
public static native long ChannelUpdate_clone(long orig);
+ // bool ChannelUpdate_eq(const struct LDKChannelUpdate *NONNULL_PTR a, const struct LDKChannelUpdate *NONNULL_PTR b);
+ public static native boolean ChannelUpdate_eq(long a, long b);
// void QueryChannelRange_free(struct LDKQueryChannelRange this_obj);
public static native void QueryChannelRange_free(long this_obj);
// const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32];
public static native long QueryChannelRange_clone_ptr(long arg);
// struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig);
public static native long QueryChannelRange_clone(long orig);
+ // bool QueryChannelRange_eq(const struct LDKQueryChannelRange *NONNULL_PTR a, const struct LDKQueryChannelRange *NONNULL_PTR b);
+ public static native boolean QueryChannelRange_eq(long a, long b);
// void ReplyChannelRange_free(struct LDKReplyChannelRange this_obj);
public static native void ReplyChannelRange_free(long this_obj);
// const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32];
public static native long ReplyChannelRange_clone_ptr(long arg);
// struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig);
public static native long ReplyChannelRange_clone(long orig);
+ // bool ReplyChannelRange_eq(const struct LDKReplyChannelRange *NONNULL_PTR a, const struct LDKReplyChannelRange *NONNULL_PTR b);
+ public static native boolean ReplyChannelRange_eq(long a, long b);
// void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_obj);
public static native void QueryShortChannelIds_free(long this_obj);
// const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32];
public static native long QueryShortChannelIds_clone_ptr(long arg);
// struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig);
public static native long QueryShortChannelIds_clone(long orig);
+ // bool QueryShortChannelIds_eq(const struct LDKQueryShortChannelIds *NONNULL_PTR a, const struct LDKQueryShortChannelIds *NONNULL_PTR b);
+ public static native boolean QueryShortChannelIds_eq(long a, long b);
// void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_obj);
public static native void ReplyShortChannelIdsEnd_free(long this_obj);
// const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32];
public static native long ReplyShortChannelIdsEnd_clone_ptr(long arg);
// struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig);
public static native long ReplyShortChannelIdsEnd_clone(long orig);
+ // bool ReplyShortChannelIdsEnd_eq(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR a, const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR b);
+ public static native boolean ReplyShortChannelIdsEnd_eq(long a, long b);
// void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_obj);
public static native void GossipTimestampFilter_free(long this_obj);
// const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32];
public static native long GossipTimestampFilter_clone_ptr(long arg);
// struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig);
public static native long GossipTimestampFilter_clone(long orig);
+ // bool GossipTimestampFilter_eq(const struct LDKGossipTimestampFilter *NONNULL_PTR a, const struct LDKGossipTimestampFilter *NONNULL_PTR b);
+ public static native boolean GossipTimestampFilter_eq(long a, long b);
// void ErrorAction_free(struct LDKErrorAction this_ptr);
public static native void ErrorAction_free(long this_ptr);
// uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg);
public static native long CommitmentUpdate_clone_ptr(long arg);
// struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig);
public static native long CommitmentUpdate_clone(long orig);
+ // bool CommitmentUpdate_eq(const struct LDKCommitmentUpdate *NONNULL_PTR a, const struct LDKCommitmentUpdate *NONNULL_PTR b);
+ public static native boolean CommitmentUpdate_eq(long a, long b);
// void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
public static native void ChannelMessageHandler_free(long this_ptr);
// void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
public static native long IgnoringMessageHandler_as_OnionMessageProvider(long this_arg);
// struct LDKOnionMessageHandler IgnoringMessageHandler_as_OnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
public static native long IgnoringMessageHandler_as_OnionMessageHandler(long this_arg);
+ // struct LDKCustomOnionMessageHandler IgnoringMessageHandler_as_CustomOnionMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
+ public static native long IgnoringMessageHandler_as_CustomOnionMessageHandler(long this_arg);
// struct LDKCustomMessageReader IgnoringMessageHandler_as_CustomMessageReader(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
public static native long IgnoringMessageHandler_as_CustomMessageReader(long this_arg);
// struct LDKCustomMessageHandler IgnoringMessageHandler_as_CustomMessageHandler(const struct LDKIgnoringMessageHandler *NONNULL_PTR this_arg);
public static native long PeerHandleError_clone(long orig);
// void PeerManager_free(struct LDKPeerManager this_obj);
public static native void PeerManager_free(long this_obj);
- // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, uint64_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
- public static native long PeerManager_new(long message_handler, byte[] our_node_secret, long current_time, byte[] ephemeral_random_data, long logger, long custom_message_handler);
+ // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKCustomMessageHandler custom_message_handler);
+ public static native long PeerManager_new(long message_handler, byte[] our_node_secret, int current_time, byte[] ephemeral_random_data, long logger, long custom_message_handler);
// MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg);
public static native byte[][] PeerManager_get_peer_node_ids(long this_arg);
// MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_NetAddressZ remote_network_address);
public static native void TxCreationKeys_set_broadcaster_delayed_payment_key(long this_ptr, byte[] val);
// MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg);
public static native long TxCreationKeys_new(byte[] per_commitment_point_arg, byte[] revocation_key_arg, byte[] broadcaster_htlc_key_arg, byte[] countersignatory_htlc_key_arg, byte[] broadcaster_delayed_payment_key_arg);
+ // bool TxCreationKeys_eq(const struct LDKTxCreationKeys *NONNULL_PTR a, const struct LDKTxCreationKeys *NONNULL_PTR b);
+ public static native boolean TxCreationKeys_eq(long a, long b);
// uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg);
public static native long TxCreationKeys_clone_ptr(long arg);
// struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig);
public static native long ChannelPublicKeys_clone_ptr(long arg);
// struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig);
public static native long ChannelPublicKeys_clone(long orig);
+ // bool ChannelPublicKeys_eq(const struct LDKChannelPublicKeys *NONNULL_PTR a, const struct LDKChannelPublicKeys *NONNULL_PTR b);
+ public static native boolean ChannelPublicKeys_eq(long a, long b);
// struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj);
public static native byte[] ChannelPublicKeys_write(long obj);
// struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser);
public static native long HTLCOutputInCommitment_clone_ptr(long arg);
// struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig);
public static native long HTLCOutputInCommitment_clone(long orig);
+ // bool HTLCOutputInCommitment_eq(const struct LDKHTLCOutputInCommitment *NONNULL_PTR a, const struct LDKHTLCOutputInCommitment *NONNULL_PTR b);
+ public static native boolean HTLCOutputInCommitment_eq(long a, long b);
// struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj);
public static native byte[] HTLCOutputInCommitment_write(long obj);
// struct LDKCResult_HTLCOutputInCommitmentDecodeErrorZ HTLCOutputInCommitment_read(struct LDKu8slice ser);
public static native long ClosingTransaction_clone(long orig);
// uint64_t ClosingTransaction_hash(const struct LDKClosingTransaction *NONNULL_PTR o);
public static native long ClosingTransaction_hash(long o);
+ // bool ClosingTransaction_eq(const struct LDKClosingTransaction *NONNULL_PTR a, const struct LDKClosingTransaction *NONNULL_PTR b);
+ public static native boolean ClosingTransaction_eq(long a, long b);
// MUST_USE_RES struct LDKClosingTransaction ClosingTransaction_new(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint);
public static native long ClosingTransaction_new(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, long funding_outpoint);
// MUST_USE_RES struct LDKTrustedClosingTransaction ClosingTransaction_trust(const struct LDKClosingTransaction *NONNULL_PTR this_arg);
public static native void InvoiceFeatures_free(long this_obj);
// void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj);
public static native void ChannelTypeFeatures_free(long this_obj);
- // MUST_USE_RES struct LDKInitFeatures InitFeatures_known_channel_features(void);
- public static native long InitFeatures_known_channel_features();
- // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known_channel_features(void);
- public static native long NodeFeatures_known_channel_features();
// MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void);
public static native long InitFeatures_empty();
- // MUST_USE_RES struct LDKInitFeatures InitFeatures_known(void);
- public static native long InitFeatures_known();
// MUST_USE_RES bool InitFeatures_requires_unknown_bits(const struct LDKInitFeatures *NONNULL_PTR this_arg);
public static native boolean InitFeatures_requires_unknown_bits(long this_arg);
// MUST_USE_RES struct LDKNodeFeatures NodeFeatures_empty(void);
public static native long NodeFeatures_empty();
- // MUST_USE_RES struct LDKNodeFeatures NodeFeatures_known(void);
- public static native long NodeFeatures_known();
// MUST_USE_RES bool NodeFeatures_requires_unknown_bits(const struct LDKNodeFeatures *NONNULL_PTR this_arg);
public static native boolean NodeFeatures_requires_unknown_bits(long this_arg);
// MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_empty(void);
public static native long ChannelFeatures_empty();
- // MUST_USE_RES struct LDKChannelFeatures ChannelFeatures_known(void);
- public static native long ChannelFeatures_known();
// MUST_USE_RES bool ChannelFeatures_requires_unknown_bits(const struct LDKChannelFeatures *NONNULL_PTR this_arg);
public static native boolean ChannelFeatures_requires_unknown_bits(long this_arg);
// MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_empty(void);
public static native long InvoiceFeatures_empty();
- // MUST_USE_RES struct LDKInvoiceFeatures InvoiceFeatures_known(void);
- public static native long InvoiceFeatures_known();
// MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg);
public static native boolean InvoiceFeatures_requires_unknown_bits(long this_arg);
// MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void);
public static native long ChannelTypeFeatures_empty();
- // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_known(void);
- public static native long ChannelTypeFeatures_known();
// MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg);
public static native boolean ChannelTypeFeatures_requires_unknown_bits(long this_arg);
// struct LDKCVec_u8Z InitFeatures_write(const struct LDKInitFeatures *NONNULL_PTR obj);
public static native long ShutdownScript_clone_ptr(long arg);
// struct LDKShutdownScript ShutdownScript_clone(const struct LDKShutdownScript *NONNULL_PTR orig);
public static native long ShutdownScript_clone(long orig);
+ // bool ShutdownScript_eq(const struct LDKShutdownScript *NONNULL_PTR a, const struct LDKShutdownScript *NONNULL_PTR b);
+ public static native boolean ShutdownScript_eq(long a, long b);
// void InvalidShutdownScript_free(struct LDKInvalidShutdownScript this_obj);
public static native void InvalidShutdownScript_free(long this_obj);
// struct LDKu8slice InvalidShutdownScript_get_script(const struct LDKInvalidShutdownScript *NONNULL_PTR this_ptr);
public static native long NetworkUpdate_channel_failure(long short_channel_id, boolean is_permanent);
// struct LDKNetworkUpdate NetworkUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
public static native long NetworkUpdate_node_failure(byte[] node_id, boolean is_permanent);
+ // bool NetworkUpdate_eq(const struct LDKNetworkUpdate *NONNULL_PTR a, const struct LDKNetworkUpdate *NONNULL_PTR b);
+ public static native boolean NetworkUpdate_eq(long a, long b);
// struct LDKCVec_u8Z NetworkUpdate_write(const struct LDKNetworkUpdate *NONNULL_PTR obj);
public static native byte[] NetworkUpdate_write(long obj);
// struct LDKCResult_COption_NetworkUpdateZDecodeErrorZ NetworkUpdate_read(struct LDKu8slice ser);
public static native long ChannelUpdateInfo_clone_ptr(long arg);
// struct LDKChannelUpdateInfo ChannelUpdateInfo_clone(const struct LDKChannelUpdateInfo *NONNULL_PTR orig);
public static native long ChannelUpdateInfo_clone(long orig);
+ // bool ChannelUpdateInfo_eq(const struct LDKChannelUpdateInfo *NONNULL_PTR a, const struct LDKChannelUpdateInfo *NONNULL_PTR b);
+ public static native boolean ChannelUpdateInfo_eq(long a, long b);
// struct LDKCVec_u8Z ChannelUpdateInfo_write(const struct LDKChannelUpdateInfo *NONNULL_PTR obj);
public static native byte[] ChannelUpdateInfo_write(long obj);
// struct LDKCResult_ChannelUpdateInfoDecodeErrorZ ChannelUpdateInfo_read(struct LDKu8slice ser);
public static native long ChannelInfo_clone_ptr(long arg);
// struct LDKChannelInfo ChannelInfo_clone(const struct LDKChannelInfo *NONNULL_PTR orig);
public static native long ChannelInfo_clone(long orig);
+ // bool ChannelInfo_eq(const struct LDKChannelInfo *NONNULL_PTR a, const struct LDKChannelInfo *NONNULL_PTR b);
+ public static native boolean ChannelInfo_eq(long a, long b);
// MUST_USE_RES struct LDKChannelUpdateInfo ChannelInfo_get_directional_info(const struct LDKChannelInfo *NONNULL_PTR this_arg, uint8_t channel_flags);
public static native long ChannelInfo_get_directional_info(long this_arg, byte channel_flags);
// struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj);
public static native long NodeAnnouncementInfo_clone_ptr(long arg);
// struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_clone(const struct LDKNodeAnnouncementInfo *NONNULL_PTR orig);
public static native long NodeAnnouncementInfo_clone(long orig);
+ // bool NodeAnnouncementInfo_eq(const struct LDKNodeAnnouncementInfo *NONNULL_PTR a, const struct LDKNodeAnnouncementInfo *NONNULL_PTR b);
+ public static native boolean NodeAnnouncementInfo_eq(long a, long b);
// struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj);
public static native byte[] NodeAnnouncementInfo_write(long obj);
// struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser);
public static native long NodeAlias_clone_ptr(long arg);
// struct LDKNodeAlias NodeAlias_clone(const struct LDKNodeAlias *NONNULL_PTR orig);
public static native long NodeAlias_clone(long orig);
+ // bool NodeAlias_eq(const struct LDKNodeAlias *NONNULL_PTR a, const struct LDKNodeAlias *NONNULL_PTR b);
+ public static native boolean NodeAlias_eq(long a, long b);
// struct LDKCVec_u8Z NodeAlias_write(const struct LDKNodeAlias *NONNULL_PTR obj);
public static native byte[] NodeAlias_write(long obj);
// struct LDKCResult_NodeAliasDecodeErrorZ NodeAlias_read(struct LDKu8slice ser);
public static native long NodeInfo_clone_ptr(long arg);
// struct LDKNodeInfo NodeInfo_clone(const struct LDKNodeInfo *NONNULL_PTR orig);
public static native long NodeInfo_clone(long orig);
+ // bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b);
+ public static native boolean NodeInfo_eq(long a, long b);
// struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj);
public static native byte[] NodeInfo_write(long obj);
// struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser);
public static native long NetworkGraph_add_channel_from_partial_announcement(long this_arg, long short_channel_id, long timestamp, long features, byte[] node_id_1, byte[] node_id_2);
// void NetworkGraph_channel_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent);
public static native void NetworkGraph_channel_failed(long this_arg, long short_channel_id, boolean is_permanent);
- // void NetworkGraph_node_failed(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey _node_id, bool is_permanent);
- public static native void NetworkGraph_node_failed(long this_arg, byte[] _node_id, boolean is_permanent);
- // void NetworkGraph_remove_stale_channels(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
- public static native void NetworkGraph_remove_stale_channels(long this_arg);
- // void NetworkGraph_remove_stale_channels_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
- public static native void NetworkGraph_remove_stale_channels_with_time(long this_arg, long current_time_unix);
+ // void NetworkGraph_node_failed_permanent(const struct LDKNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey node_id);
+ public static native void NetworkGraph_node_failed_permanent(long this_arg, byte[] node_id);
+ // void NetworkGraph_remove_stale_channels_and_tracking(const struct LDKNetworkGraph *NONNULL_PTR this_arg);
+ public static native void NetworkGraph_remove_stale_channels_and_tracking(long this_arg);
+ // void NetworkGraph_remove_stale_channels_and_tracking_with_time(const struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t current_time_unix);
+ public static native void NetworkGraph_remove_stale_channels_and_tracking_with_time(long this_arg, long current_time_unix);
// MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg);
public static native long NetworkGraph_update_channel(long this_arg, long msg);
// MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg);
public static native long ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(long this_ptr);
// void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
public static native void ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(long this_ptr, long val);
+ // uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
+ public static native long ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(long this_ptr);
+ // void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(long this_ptr, long val);
+ // uint64_t ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
+ public static native long ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(long this_ptr);
+ // void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(long this_ptr, long val);
+ // uint64_t ProbabilisticScoringParameters_get_historical_no_updates_half_life(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
+ public static native long ProbabilisticScoringParameters_get_historical_no_updates_half_life(long this_ptr);
+ // void ProbabilisticScoringParameters_set_historical_no_updates_half_life(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
+ public static native void ProbabilisticScoringParameters_set_historical_no_updates_half_life(long this_ptr, long val);
// uint64_t ProbabilisticScoringParameters_get_anti_probing_penalty_msat(const struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr);
public static native long ProbabilisticScoringParameters_get_anti_probing_penalty_msat(long this_ptr);
// void ProbabilisticScoringParameters_set_anti_probing_penalty_msat(struct LDKProbabilisticScoringParameters *NONNULL_PTR this_ptr, uint64_t val);
public static native long SendError_too_few_blinded_hops();
// struct LDKSendError SendError_invalid_first_hop(void);
public static native long SendError_invalid_first_hop();
+ // struct LDKSendError SendError_invalid_message(void);
+ public static native long SendError_invalid_message();
// struct LDKSendError SendError_buffer_full(void);
public static native long SendError_buffer_full();
- // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger);
- public static native long OnionMessenger_new(long keys_manager, long logger);
- // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKBlindedRoute reply_path);
- public static native long OnionMessenger_send_onion_message(long this_arg, byte[][] intermediate_nodes, long destination, long reply_path);
+ // bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b);
+ public static native boolean SendError_eq(long a, long b);
+ // void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr);
+ public static native void CustomOnionMessageHandler_free(long this_ptr);
+ // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler);
+ public static native long OnionMessenger_new(long keys_manager, long logger, long custom_handler);
+ // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_custom_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKCustomOnionMessageContents msg, struct LDKBlindedRoute reply_path);
+ public static native long OnionMessenger_send_custom_onion_message(long this_arg, byte[][] intermediate_nodes, long destination, long msg, long reply_path);
// struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
public static native long OnionMessenger_as_OnionMessageHandler(long this_arg);
// struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg);
public static native long OnionMessenger_as_OnionMessageProvider(long this_arg);
+ // uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg);
+ public static native long CustomOnionMessageContents_clone_ptr(long arg);
+ // struct LDKCustomOnionMessageContents CustomOnionMessageContents_clone(const struct LDKCustomOnionMessageContents *NONNULL_PTR orig);
+ public static native long CustomOnionMessageContents_clone(long orig);
+ // void CustomOnionMessageContents_free(struct LDKCustomOnionMessageContents this_ptr);
+ public static native void CustomOnionMessageContents_free(long this_ptr);
// void FilesystemPersister_free(struct LDKFilesystemPersister this_obj);
public static native void FilesystemPersister_free(long this_obj);
// MUST_USE_RES struct LDKFilesystemPersister FilesystemPersister_new(struct LDKStr path_to_channel_data);
public static native long ParseError_invalid_slice_length(String a);
// struct LDKParseError ParseError_skip(void);
public static native long ParseError_skip();
+ // bool ParseError_eq(const struct LDKParseError *NONNULL_PTR a, const struct LDKParseError *NONNULL_PTR b);
+ public static native boolean ParseError_eq(long a, long b);
// void ParseOrSemanticError_free(struct LDKParseOrSemanticError this_ptr);
public static native void ParseOrSemanticError_free(long this_ptr);
// uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg);
public static native long ParseOrSemanticError_parse_error(long a);
// struct LDKParseOrSemanticError ParseOrSemanticError_semantic_error(enum LDKSemanticError a);
public static native long ParseOrSemanticError_semantic_error(SemanticError a);
+ // bool ParseOrSemanticError_eq(const struct LDKParseOrSemanticError *NONNULL_PTR a, const struct LDKParseOrSemanticError *NONNULL_PTR b);
+ public static native boolean ParseOrSemanticError_eq(long a, long b);
// void Invoice_free(struct LDKInvoice this_obj);
public static native void Invoice_free(long this_obj);
// bool Invoice_eq(const struct LDKInvoice *NONNULL_PTR a, const struct LDKInvoice *NONNULL_PTR b);
public static native byte[] InFlightHtlcs_write(long obj);
// struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser);
public static native long InFlightHtlcs_read(byte[] ser);
- // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network);
- public static native long create_phantom_invoice(long amt_msat, byte[] payment_hash, String description, int invoice_expiry_delta_secs, long[] phantom_route_hints, long keys_manager, Currency network);
- // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, enum LDKCurrency network);
- public static native long create_phantom_invoice_with_description_hash(long amt_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long description_hash, long[] phantom_route_hints, long keys_manager, Currency network);
- // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs);
- public static native long create_invoice_from_channelmanager(long channelmanager, long keys_manager, Currency network, long amt_msat, String description, int invoice_expiry_delta_secs);
- // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs);
- public static native long create_invoice_from_channelmanager_with_description_hash(long channelmanager, long keys_manager, Currency network, long amt_msat, long description_hash, int invoice_expiry_delta_secs);
- // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
- public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long keys_manager, Currency network, long amt_msat, long description_hash, long duration_since_epoch, int invoice_expiry_delta_secs);
- // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
- public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long keys_manager, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs);
+ // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, struct LDKStr description, uint32_t invoice_expiry_delta_secs, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network);
+ public static native long create_phantom_invoice(long amt_msat, byte[] payment_hash, String description, int invoice_expiry_delta_secs, long[] phantom_route_hints, long keys_manager, long logger, Currency network);
+ // struct LDKCResult_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(struct LDKCOption_u64Z amt_msat, struct LDKThirtyTwoBytes payment_hash, uint32_t invoice_expiry_delta_secs, struct LDKSha256 description_hash, struct LDKCVec_PhantomRouteHintsZ phantom_route_hints, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network);
+ public static native long create_phantom_invoice_with_description_hash(long amt_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long description_hash, long[] phantom_route_hints, long keys_manager, long logger, Currency network);
+ // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint32_t invoice_expiry_delta_secs);
+ public static native long create_invoice_from_channelmanager(long channelmanager, long keys_manager, long logger, Currency network, long amt_msat, String description, int invoice_expiry_delta_secs);
+ // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint32_t invoice_expiry_delta_secs);
+ public static native long create_invoice_from_channelmanager_with_description_hash(long channelmanager, long keys_manager, long logger, Currency network, long amt_msat, long description_hash, int invoice_expiry_delta_secs);
+ // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKSha256 description_hash, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
+ public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long keys_manager, long logger, Currency network, long amt_msat, long description_hash, long duration_since_epoch, int invoice_expiry_delta_secs);
+ // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs);
+ public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long keys_manager, long logger, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs);
// void DefaultRouter_free(struct LDKDefaultRouter this_obj);
public static native void DefaultRouter_free(long this_obj);
// MUST_USE_RES struct LDKDefaultRouter DefaultRouter_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph, struct LDKLogger logger, struct LDKThirtyTwoBytes random_seed_bytes, struct LDKLockableScore scorer);
public static native void RapidGossipSync_free(long this_obj);
// MUST_USE_RES struct LDKRapidGossipSync RapidGossipSync_new(const struct LDKNetworkGraph *NONNULL_PTR network_graph);
public static native long RapidGossipSync_new(long network_graph);
- // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_sync_network_graph_with_file_path(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKStr sync_path);
- public static native long RapidGossipSync_sync_network_graph_with_file_path(long this_arg, String sync_path);
+ // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
+ public static native long RapidGossipSync_update_network_graph(long this_arg, byte[] update_data);
// MUST_USE_RES bool RapidGossipSync_is_initial_sync_complete(const struct LDKRapidGossipSync *NONNULL_PTR this_arg);
public static native boolean RapidGossipSync_is_initial_sync_complete(long this_arg);
// void GraphSyncError_free(struct LDKGraphSyncError this_ptr);
public static native long GraphSyncError_decode_error(long a);
// struct LDKGraphSyncError GraphSyncError_lightning_error(struct LDKLightningError a);
public static native long GraphSyncError_lightning_error(long a);
- // MUST_USE_RES struct LDKCResult_u32GraphSyncErrorZ RapidGossipSync_update_network_graph(const struct LDKRapidGossipSync *NONNULL_PTR this_arg, struct LDKu8slice update_data);
- public static native long RapidGossipSync_update_network_graph(long this_arg, byte[] update_data);
}
if (raw_val.getClass() == bindings.LDKAPIError.ChannelUnavailable.class) {
return new ChannelUnavailable(ptr, (bindings.LDKAPIError.ChannelUnavailable)raw_val);
}
- if (raw_val.getClass() == bindings.LDKAPIError.MonitorUpdateFailed.class) {
- return new MonitorUpdateFailed(ptr, (bindings.LDKAPIError.MonitorUpdateFailed)raw_val);
+ if (raw_val.getClass() == bindings.LDKAPIError.MonitorUpdateInProgress.class) {
+ return new MonitorUpdateInProgress(ptr, (bindings.LDKAPIError.MonitorUpdateInProgress)raw_val);
}
if (raw_val.getClass() == bindings.LDKAPIError.IncompatibleShutdownScript.class) {
return new IncompatibleShutdownScript(ptr, (bindings.LDKAPIError.IncompatibleShutdownScript)raw_val);
}
}
/**
- * An attempt to call watch/update_channel returned an Err (ie you did this!), causing the
- * attempted action to fail.
+ * An attempt to call [`chain::Watch::watch_channel`]/[`chain::Watch::update_channel`]
+ * returned a [`ChannelMonitorUpdateStatus::InProgress`] indicating the persistence of a
+ * monitor update is awaiting async resolution. Once it resolves the attempted action should
+ * complete automatically.
+ *
+ * [`chain::Watch::watch_channel`]: crate::chain::Watch::watch_channel
+ * [`chain::Watch::update_channel`]: crate::chain::Watch::update_channel
+ * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
*/
- public final static class MonitorUpdateFailed extends APIError {
- private MonitorUpdateFailed(long ptr, bindings.LDKAPIError.MonitorUpdateFailed obj) {
+ public final static class MonitorUpdateInProgress extends APIError {
+ private MonitorUpdateInProgress(long ptr, bindings.LDKAPIError.MonitorUpdateInProgress obj) {
super(null, ptr);
}
}
}
/**
- * Utility method to constructs a new MonitorUpdateFailed-variant APIError
+ * Utility method to constructs a new MonitorUpdateInProgress-variant APIError
*/
- public static APIError monitor_update_failed() {
- long ret = bindings.APIError_monitor_update_failed();
+ public static APIError monitor_update_in_progress() {
+ long ret = bindings.APIError_monitor_update_in_progress();
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
return ret_hu_conv;
}
+ /**
+ * Checks if two APIErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(APIError b) {
+ boolean ret = bindings.APIError_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof APIError)) return false;
+ return this.eq((APIError)o);
+ }
}
return ret_hu_conv;
}
+ /**
+ * Checks if two AcceptChannels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(AcceptChannel b) {
+ boolean ret = bindings.AcceptChannel_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof AcceptChannel)) return false;
+ return this.eq((AcceptChannel)o);
+ }
/**
* Serialize the AcceptChannel object into a byte array which can be read by AcceptChannel_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two AnnouncementSignaturess contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(AnnouncementSignatures b) {
+ boolean ret = bindings.AnnouncementSignatures_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof AnnouncementSignatures)) return false;
+ return this.eq((AnnouncementSignatures)o);
+ }
/**
* Serialize the AnnouncementSignatures object into a byte array which can be read by AnnouncementSignatures_read
*/
* [`ChannelManager`] persistence should be done in the background.
* Calling [`ChannelManager::timer_tick_occurred`] and [`PeerManager::timer_tick_occurred`]
* at the appropriate intervals.
- * Calling [`NetworkGraph::remove_stale_channels`] (if a [`GossipSync`] with a [`NetworkGraph`]
- * is provided to [`BackgroundProcessor::start`]).
+ * Calling [`NetworkGraph::remove_stale_channels_and_tracking`] (if a [`GossipSync`] with a
+ * [`NetworkGraph`] is provided to [`BackgroundProcessor::start`]).
*
* It will also call [`PeerManager::process_events`] periodically though this shouldn't be relied
* upon as doing so may result in high latency.
* chosen to forgo their output as dust.
*/
Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx);
+ /**
+ * Computes the signature for a commitment transaction's anchor output used as an
+ * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
+ */
+ Result_SignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input);
/**
* Signs a channel announcement message with our funding key and our node secret key (aka
* node_id or network_key), proving it comes from one of the channel participants.
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
+ @Override public long sign_holder_anchor_input(byte[] anchor_tx, long input) {
+ Result_SignatureNoneZ ret = arg.sign_holder_anchor_input(anchor_tx, input);
+ Reference.reachabilityFence(arg);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
+ }
@Override public long sign_channel_announcement(long msg) {
org.ldk.structs.UnsignedChannelAnnouncement msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, msg); }
Result_C2Tuple_SignatureSignatureZNoneZ ret = arg.sign_channel_announcement(msg_hu_conv);
return ret_hu_conv;
}
+ /**
+ * Computes the signature for a commitment transaction's anchor output used as an
+ * input within `anchor_tx`, which spends the commitment transaction, at index `input`.
+ */
+ public Result_SignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) {
+ long ret = bindings.BaseSign_sign_holder_anchor_input(this.ptr, anchor_tx, input);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(anchor_tx);
+ Reference.reachabilityFence(input);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
/**
* Signs a channel announcement message with our funding key and our node secret key (aka
* node_id or network_key), proving it comes from one of the channel participants.
return ret_hu_conv;
}
+ /**
+ * Checks if two BestBlocks contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(BestBlock b) {
+ boolean ret = bindings.BestBlock_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof BestBlock)) return false;
+ return this.eq((BestBlock)o);
+ }
/**
* Constructs a `BestBlock` that represents the genesis block at height 0 of the given
* network.
/**
* Indicates the persistence of a [`ChannelMonitor`] has completed after
- * [`ChannelMonitorUpdateErr::TemporaryFailure`] was returned from an update operation.
+ * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation.
*
* Thus, the anticipated use is, at a high level:
* 1) This [`ChainMonitor`] calls [`Persist::update_persisted_channel`] which stores the
* update to disk and begins updating any remote (e.g. watchtower/backup) copies,
- * returning [`ChannelMonitorUpdateErr::TemporaryFailure`],
+ * returning [`ChannelMonitorUpdateStatus::InProgress`],
* 2) once all remote copies are updated, you call this function with the
* `completed_update_id` that completed, and once all pending updates have completed the
* channel will be re-enabled.
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelAnnouncement b) {
+ boolean ret = bindings.ChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelAnnouncement)) return false;
+ return this.eq((ChannelAnnouncement)o);
+ }
/**
* Serialize the ChannelAnnouncement object into a byte array which can be read by ChannelAnnouncement_read
*/
* to such payments may be sustantial if there are many dust HTLCs present when the
* channel is force-closed.
*
+ * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
+ * channel negotiated throughout the channel open process, along with the fees required to have
+ * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
+ * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
+ * account the HTLC transaction fee as it is zero.
+ *
* This limit is applied for sent, forwarded, and received HTLCs and limits the total
* exposure across all three types per-channel. Setting this too low may prevent the
* sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
* to such payments may be sustantial if there are many dust HTLCs present when the
* channel is force-closed.
*
+ * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a
+ * channel negotiated throughout the channel open process, along with the fees required to have
+ * a broadcastable HTLC spending transaction. When a channel supports anchor outputs
+ * (specifically the zero fee HTLC transaction variant), this threshold no longer takes into
+ * account the HTLC transaction fee as it is zero.
+ *
* This limit is applied for sent, forwarded, and received HTLCs and limits the total
* exposure across all three types per-channel. Setting this too low may prevent the
* sending or receipt of low-value HTLCs on high-traffic nodes, and this limit is very
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelConfigs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelConfig b) {
+ boolean ret = bindings.ChannelConfig_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelConfig)) return false;
+ return this.eq((ChannelConfig)o);
+ }
/**
* Creates a "default" ChannelConfig. See struct and individual field documentaiton for details on which values are used.
*/
return ret_hu_conv;
}
- /**
- * Creates a Features with the bits set which are known by the implementation
- */
- public static ChannelFeatures known() {
- long ret = bindings.ChannelFeatures_known();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Returns true if this `Features` object contains unknown feature flags which are set as
* \"required\".
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelInfos contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelInfo b) {
+ boolean ret = bindings.ChannelInfo_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelInfo)) return false;
+ return this.eq((ChannelInfo)o);
+ }
/**
* Returns a [`ChannelUpdateInfo`] based on the direction implied by the channel_flag.
*
* PaymentSendFailure for more info.
*
* In general, a path may raise:
- * APIError::RouteError when an invalid route or forwarding parameter (cltv_delta, fee,
+ * [`APIError::RouteError`] when an invalid route or forwarding parameter (cltv_delta, fee,
* node public key) is specified.
- * APIError::ChannelUnavailable if the next-hop channel is not available for updates
+ * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates
* (including due to previous monitor update failure or new permanent monitor update
* failure).
- * APIError::MonitorUpdateFailed if a new monitor update failure prevented sending the
+ * [`APIError::MonitorUpdateInProgress`] if a new monitor update failure prevented sending the
* relevant updates.
*
* Note that depending on the type of the PaymentSendFailure the HTLC may have been
* is believed to be possible in the future (eg they're sending us messages we don't
* understand or indicate they require unknown feature bits), no_connection_possible is set
* and any outstanding channels should be failed.
+ *
+ * Note that in some rare cases this may be called without a corresponding
+ * [`Self::peer_connected`].
*/
void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
/**
* Handle a peer reconnecting, possibly generating channel_reestablish message(s).
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
*/
- void peer_connected(byte[] their_node_id, Init msg);
+ Result_NoneNoneZ peer_connected(byte[] their_node_id, Init msg);
/**
* Handle an incoming channel_reestablish message from the given peer.
*/
arg.peer_disconnected(their_node_id, no_connection_possible);
Reference.reachabilityFence(arg);
}
- @Override public void peer_connected(byte[] their_node_id, long msg) {
+ @Override public long peer_connected(byte[] their_node_id, long msg) {
org.ldk.structs.Init msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.Init(null, msg); }
- arg.peer_connected(their_node_id, msg_hu_conv);
+ Result_NoneNoneZ ret = arg.peer_connected(their_node_id, msg_hu_conv);
Reference.reachabilityFence(arg);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
}
@Override public void handle_channel_reestablish(byte[] their_node_id, long msg) {
org.ldk.structs.ChannelReestablish msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ChannelReestablish(null, msg); }
* is believed to be possible in the future (eg they're sending us messages we don't
* understand or indicate they require unknown feature bits), no_connection_possible is set
* and any outstanding channels should be failed.
+ *
+ * Note that in some rare cases this may be called without a corresponding
+ * [`Self::peer_connected`].
*/
public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
bindings.ChannelMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible);
/**
* Handle a peer reconnecting, possibly generating channel_reestablish message(s).
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
*/
- public void peer_connected(byte[] their_node_id, Init msg) {
- bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
+ public Result_NoneNoneZ peer_connected(byte[] their_node_id, Init msg) {
+ long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(their_node_id);
Reference.reachabilityFence(msg);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(msg); };
+ return ret_hu_conv;
}
/**
/**
* Used by ChannelManager deserialization to broadcast the latest holder state if its copy of
- * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of
- * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows
- * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these
- * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to
- * broadcast them if counterparty don't close channel with his higher commitment transaction after a
- * substantial amount of time (a month or even a year) to get back funds. Best may be to contact
- * out-of-band the other node operator to coordinate with him if option is available to you.
- * In any-case, choice is up to the user.
+ * the Channel was out-of-date.
+ *
+ * You may also use this to broadcast the latest local commitment transaction, either because
+ * a monitor update failed with [`ChannelMonitorUpdateStatus::PermanentFailure`] or because we've
+ * fallen behind (i.e. we've received proof that our counterparty side knows a revocation
+ * secret we gave them that they shouldn't know).
+ *
+ * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty
+ * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't
+ * close channel with their commitment transaction after a substantial amount of time. Best
+ * may be to contact the other node operator out-of-band to coordinate other options available
+ * to you. In any-case, the choice is up to you.
+ *
+ * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
*/
public byte[][] get_latest_holder_commitment_txn(Logger logger) {
byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr);
* increasing and increase by one for each new update, with one exception specified below.
*
* This sequence number is also used to track up to which points updates which returned
- * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
+ * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
* ChannelMonitor when ChannelManager::channel_monitor_updated is called.
*
* The only instance where update_id values are not strictly increasing is the case where we
* allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
* its docs for more details.
+ *
+ * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
*/
public long get_update_id() {
long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr);
* increasing and increase by one for each new update, with one exception specified below.
*
* This sequence number is also used to track up to which points updates which returned
- * ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
+ * [`ChannelMonitorUpdateStatus::InProgress`] have been applied to all copies of a given
* ChannelMonitor when ChannelManager::channel_monitor_updated is called.
*
* The only instance where update_id values are not strictly increasing is the case where we
* allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
* its docs for more details.
+ *
+ * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
*/
public void set_update_id(long val) {
bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val);
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelPublicKeyss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelPublicKeys b) {
+ boolean ret = bindings.ChannelPublicKeys_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelPublicKeys)) return false;
+ return this.eq((ChannelPublicKeys)o);
+ }
/**
* Serialize the ChannelPublicKeys object into a byte array which can be read by ChannelPublicKeys_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelReadys contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelReady b) {
+ boolean ret = bindings.ChannelReady_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelReady)) return false;
+ return this.eq((ChannelReady)o);
+ }
/**
* Serialize the ChannelReady object into a byte array which can be read by ChannelReady_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelReestablishs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelReestablish b) {
+ boolean ret = bindings.ChannelReestablish_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelReestablish)) return false;
+ return this.eq((ChannelReestablish)o);
+ }
/**
* Serialize the ChannelReestablish object into a byte array which can be read by ChannelReestablish_read
*/
}
/**
- * Are anchors used for this channel. Boolean is serialization backwards-compatible
+ * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
+ * serialization backwards-compatible.
*/
public COption_NoneZ get_opt_anchors() {
COption_NoneZ ret = bindings.ChannelTransactionParameters_get_opt_anchors(this.ptr);
}
/**
- * Are anchors used for this channel. Boolean is serialization backwards-compatible
+ * Are anchors (zero fee HTLC transaction variant) used for this channel. Boolean is
+ * serialization backwards-compatible.
*/
public void set_opt_anchors(org.ldk.enums.COption_NoneZ val) {
bindings.ChannelTransactionParameters_set_opt_anchors(this.ptr, val);
return ret_hu_conv;
}
- /**
- * Creates a Features with the bits set which are known by the implementation
- */
- public static ChannelTypeFeatures known() {
- long ret = bindings.ChannelTypeFeatures_known();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Returns true if this `Features` object contains unknown feature flags which are set as
* \"required\".
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelUpdate b) {
+ boolean ret = bindings.ChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelUpdate)) return false;
+ return this.eq((ChannelUpdate)o);
+ }
/**
* Serialize the ChannelUpdate object into a byte array which can be read by ChannelUpdate_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ChannelUpdateInfos contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ChannelUpdateInfo b) {
+ boolean ret = bindings.ChannelUpdateInfo_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ChannelUpdateInfo)) return false;
+ return this.eq((ChannelUpdateInfo)o);
+ }
/**
* Serialize the ChannelUpdateInfo object into a byte array which can be read by ChannelUpdateInfo_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ClosingSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ClosingSigned b) {
+ boolean ret = bindings.ClosingSigned_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ClosingSigned)) return false;
+ return this.eq((ClosingSigned)o);
+ }
/**
* Serialize the ClosingSigned object into a byte array which can be read by ClosingSigned_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ClosingSignedFeeRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ClosingSignedFeeRange b) {
+ boolean ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ClosingSignedFeeRange)) return false;
+ return this.eq((ClosingSignedFeeRange)o);
+ }
/**
* Serialize the ClosingSignedFeeRange object into a byte array which can be read by ClosingSignedFeeRange_read
*/
@Override public int hashCode() {
return (int)this.hash();
}
+ /**
+ * Checks if two ClosingTransactions contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ClosingTransaction b) {
+ boolean ret = bindings.ClosingTransaction_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ClosingTransaction)) return false;
+ return this.eq((ClosingTransaction)o);
+ }
/**
* Construct an object of the class
*/
* The peer disconnected prior to funding completing. In this case the spec mandates that we
* forget the channel entirely - we can attempt again if the peer reconnects.
*
+ * This includes cases where we restarted prior to funding completion, including prior to the
+ * initial [`ChannelMonitor`] persistence completing.
+ *
* In LDK versions prior to 0.0.107 this could also occur if we were unable to connect to the
* peer because of mutual incompatibility between us and our channel counterparty.
+ *
+ * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
*/
public final static class DisconnectedPeer extends ClosureReason {
private DisconnectedPeer(long ptr, bindings.LDKClosureReason.DisconnectedPeer obj) {
}
}
/**
- * Closure generated from `ChannelManager::read` if the ChannelMonitor is newer than
- * the ChannelManager deserialized.
+ * Closure generated from `ChannelManager::read` if the [`ChannelMonitor`] is newer than
+ * the [`ChannelManager`] deserialized.
+ *
+ * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
*/
public final static class OutdatedChannelManager extends ClosureReason {
private OutdatedChannelManager(long ptr, bindings.LDKClosureReason.OutdatedChannelManager obj) {
return ret_hu_conv;
}
+ /**
+ * Checks if two ClosureReasons contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(ClosureReason b) {
+ boolean ret = bindings.ClosureReason_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ClosureReason)) return false;
+ return this.eq((ClosureReason)o);
+ }
/**
* Serialize the ClosureReason object into a byte array which can be read by ClosureReason_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two CommitmentSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(CommitmentSigned b) {
+ boolean ret = bindings.CommitmentSigned_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof CommitmentSigned)) return false;
+ return this.eq((CommitmentSigned)o);
+ }
/**
* Serialize the CommitmentSigned object into a byte array which can be read by CommitmentSigned_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two CommitmentUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(CommitmentUpdate b) {
+ boolean ret = bindings.CommitmentUpdate_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof CommitmentUpdate)) return false;
+ return this.eq((CommitmentUpdate)o);
+ }
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+/**
+ * The contents of a custom onion message.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class CustomOnionMessageContents extends CommonBase {
+ final bindings.LDKCustomOnionMessageContents bindings_instance;
+ CustomOnionMessageContents(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private CustomOnionMessageContents(bindings.LDKCustomOnionMessageContents arg) {
+ super(bindings.LDKCustomOnionMessageContents_new(arg));
+ this.ptrs_to.add(arg);
+ this.bindings_instance = arg;
+ }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CustomOnionMessageContents_free(ptr); } super.finalize();
+ }
+
+ public static interface CustomOnionMessageContentsInterface {
+ /**
+ * Returns the TLV type identifying the message contents. MUST be >= 64.
+ */
+ long tlv_type();
+ /**
+ * Serialize the object into a byte array
+ */
+ byte[] write();
+ }
+ private static class LDKCustomOnionMessageContentsHolder { CustomOnionMessageContents held; }
+ public static CustomOnionMessageContents new_impl(CustomOnionMessageContentsInterface arg) {
+ final LDKCustomOnionMessageContentsHolder impl_holder = new LDKCustomOnionMessageContentsHolder();
+ impl_holder.held = new CustomOnionMessageContents(new bindings.LDKCustomOnionMessageContents() {
+ @Override public long tlv_type() {
+ long ret = arg.tlv_type();
+ Reference.reachabilityFence(arg);
+ return ret;
+ }
+ @Override public byte[] write() {
+ byte[] ret = arg.write();
+ Reference.reachabilityFence(arg);
+ return ret;
+ }
+ });
+ return impl_holder.held;
+ }
+ /**
+ * Returns the TLV type identifying the message contents. MUST be >= 64.
+ */
+ public long tlv_type() {
+ long ret = bindings.CustomOnionMessageContents_tlv_type(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Serialize the object into a byte array
+ */
+ public byte[] write() {
+ byte[] ret = bindings.CustomOnionMessageContents_write(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CustomOnionMessageContents_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a copy of a CustomOnionMessageContents
+ */
+ public CustomOnionMessageContents clone() {
+ long ret = bindings.CustomOnionMessageContents_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ return ret_hu_conv;
+ }
+
+}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+/**
+ * Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`],
+ * [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages,
+ * [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom
+ * implementation of this trait must be provided, with [`CustomMessage`] specifying the supported
+ * message types.
+ *
+ * See [`OnionMessenger`] for example usage.
+ *
+ * [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler
+ * [`CustomMessage`]: Self::CustomMessage
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class CustomOnionMessageHandler extends CommonBase {
+ final bindings.LDKCustomOnionMessageHandler bindings_instance;
+ CustomOnionMessageHandler(Object _dummy, long ptr) { super(ptr); bindings_instance = null; }
+ private CustomOnionMessageHandler(bindings.LDKCustomOnionMessageHandler arg) {
+ super(bindings.LDKCustomOnionMessageHandler_new(arg));
+ this.ptrs_to.add(arg);
+ this.bindings_instance = arg;
+ }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CustomOnionMessageHandler_free(ptr); } super.finalize();
+ }
+
+ public static interface CustomOnionMessageHandlerInterface {
+ /**
+ * Called with the custom message that was received.
+ */
+ void handle_custom_message(CustomOnionMessageContents msg);
+ /**
+ * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
+ * message type is unknown.
+ */
+ Result_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message(long message_type, byte[] buffer);
+ }
+ private static class LDKCustomOnionMessageHandlerHolder { CustomOnionMessageHandler held; }
+ public static CustomOnionMessageHandler new_impl(CustomOnionMessageHandlerInterface arg) {
+ final LDKCustomOnionMessageHandlerHolder impl_holder = new LDKCustomOnionMessageHandlerHolder();
+ impl_holder.held = new CustomOnionMessageHandler(new bindings.LDKCustomOnionMessageHandler() {
+ @Override public void handle_custom_message(long msg) {
+ CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, msg);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ arg.handle_custom_message(ret_hu_conv);
+ Reference.reachabilityFence(arg);
+ }
+ @Override public long read_custom_message(long message_type, byte[] buffer) {
+ Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret = arg.read_custom_message(message_type, buffer);
+ Reference.reachabilityFence(arg);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
+ }
+ });
+ return impl_holder.held;
+ }
+ /**
+ * Called with the custom message that was received.
+ */
+ public void handle_custom_message(CustomOnionMessageContents msg) {
+ bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(msg);
+ if (this != null) { this.ptrs_to.add(msg); };
+ }
+
+ /**
+ * Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the
+ * message type is unknown.
+ */
+ public Result_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message(long message_type, byte[] buffer) {
+ long ret = bindings.CustomOnionMessageHandler_read_custom_message(this.ptr, message_type, buffer);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(message_type);
+ Reference.reachabilityFence(buffer);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_CustomOnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
return ret_hu_conv;
}
+ /**
+ * Checks if two DataLossProtects contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(DataLossProtect b) {
+ boolean ret = bindings.DataLossProtect_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof DataLossProtect)) return false;
+ return this.eq((DataLossProtect)o);
+ }
}
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class DecodeError extends CommonBase {
- DecodeError(Object _dummy, long ptr) { super(ptr); }
+ private DecodeError(Object _dummy, long ptr) { super(ptr); }
@Override @SuppressWarnings("deprecation")
protected void finalize() throws Throwable {
super.finalize();
if (ptr != 0) { bindings.DecodeError_free(ptr); }
}
+ static DecodeError constr_from_ptr(long ptr) {
+ bindings.LDKDecodeError raw_val = bindings.LDKDecodeError_ref_from_ptr(ptr);
+ if (raw_val.getClass() == bindings.LDKDecodeError.UnknownVersion.class) {
+ return new UnknownVersion(ptr, (bindings.LDKDecodeError.UnknownVersion)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKDecodeError.UnknownRequiredFeature.class) {
+ return new UnknownRequiredFeature(ptr, (bindings.LDKDecodeError.UnknownRequiredFeature)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKDecodeError.InvalidValue.class) {
+ return new InvalidValue(ptr, (bindings.LDKDecodeError.InvalidValue)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKDecodeError.ShortRead.class) {
+ return new ShortRead(ptr, (bindings.LDKDecodeError.ShortRead)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKDecodeError.BadLengthDescriptor.class) {
+ return new BadLengthDescriptor(ptr, (bindings.LDKDecodeError.BadLengthDescriptor)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKDecodeError.Io.class) {
+ return new Io(ptr, (bindings.LDKDecodeError.Io)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKDecodeError.UnsupportedCompression.class) {
+ return new UnsupportedCompression(ptr, (bindings.LDKDecodeError.UnsupportedCompression)raw_val);
+ }
+ assert false; return null; // Unreachable without extending the (internal) bindings interface
+ }
+ /**
+ * A version byte specified something we don't know how to handle.
+ * Includes unknown realm byte in an OnionHopData packet
+ */
+ public final static class UnknownVersion extends DecodeError {
+ private UnknownVersion(long ptr, bindings.LDKDecodeError.UnknownVersion obj) {
+ super(null, ptr);
+ }
+ }
+ /**
+ * Unknown feature mandating we fail to parse message (eg TLV with an even, unknown type)
+ */
+ public final static class UnknownRequiredFeature extends DecodeError {
+ private UnknownRequiredFeature(long ptr, bindings.LDKDecodeError.UnknownRequiredFeature obj) {
+ super(null, ptr);
+ }
+ }
+ /**
+ * Value was invalid, eg a byte which was supposed to be a bool was something other than a 0
+ * or 1, a public key/private key/signature was invalid, text wasn't UTF-8, TLV was
+ * syntactically incorrect, etc
+ */
+ public final static class InvalidValue extends DecodeError {
+ private InvalidValue(long ptr, bindings.LDKDecodeError.InvalidValue obj) {
+ super(null, ptr);
+ }
+ }
+ /**
+ * Buffer too short
+ */
+ public final static class ShortRead extends DecodeError {
+ private ShortRead(long ptr, bindings.LDKDecodeError.ShortRead obj) {
+ super(null, ptr);
+ }
+ }
+ /**
+ * A length descriptor in the packet didn't describe the later data correctly
+ */
+ public final static class BadLengthDescriptor extends DecodeError {
+ private BadLengthDescriptor(long ptr, bindings.LDKDecodeError.BadLengthDescriptor obj) {
+ super(null, ptr);
+ }
+ }
+ /**
+ * Error from std::io
+ */
+ public final static class Io extends DecodeError {
+ public final org.ldk.enums.IOError io;
+ private Io(long ptr, bindings.LDKDecodeError.Io obj) {
+ super(null, ptr);
+ this.io = obj.io;
+ }
+ }
+ /**
+ * The message included zlib-compressed values, which we don't support.
+ */
+ public final static class UnsupportedCompression extends DecodeError {
+ private UnsupportedCompression(long ptr, bindings.LDKDecodeError.UnsupportedCompression obj) {
+ super(null, ptr);
+ }
+ }
long clone_ptr() {
long ret = bindings.DecodeError_clone_ptr(this.ptr);
Reference.reachabilityFence(this);
long ret = bindings.DecodeError_clone(this.ptr);
Reference.reachabilityFence(this);
if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.DecodeError ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DecodeError(null, ret); }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
return ret_hu_conv;
}
+ /**
+ * Utility method to constructs a new UnknownVersion-variant DecodeError
+ */
+ public static DecodeError unknown_version() {
+ long ret = bindings.DecodeError_unknown_version();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UnknownRequiredFeature-variant DecodeError
+ */
+ public static DecodeError unknown_required_feature() {
+ long ret = bindings.DecodeError_unknown_required_feature();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new InvalidValue-variant DecodeError
+ */
+ public static DecodeError invalid_value() {
+ long ret = bindings.DecodeError_invalid_value();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new ShortRead-variant DecodeError
+ */
+ public static DecodeError short_read() {
+ long ret = bindings.DecodeError_short_read();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new BadLengthDescriptor-variant DecodeError
+ */
+ public static DecodeError bad_length_descriptor() {
+ long ret = bindings.DecodeError_bad_length_descriptor();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new Io-variant DecodeError
+ */
+ public static DecodeError io(org.ldk.enums.IOError a) {
+ long ret = bindings.DecodeError_io(a);
+ Reference.reachabilityFence(a);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Utility method to constructs a new UnsupportedCompression-variant DecodeError
+ */
+ public static DecodeError unsupported_compression() {
+ long ret = bindings.DecodeError_unsupported_compression();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if two DecodeErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(DecodeError b) {
+ boolean ret = bindings.DecodeError_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof DecodeError)) return false;
+ return this.eq((DecodeError)o);
+ }
}
return ret_hu_conv;
}
+ /**
+ * Checks if two DelayedPaymentOutputDescriptors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(DelayedPaymentOutputDescriptor b) {
+ boolean ret = bindings.DelayedPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof DelayedPaymentOutputDescriptor)) return false;
+ return this.eq((DelayedPaymentOutputDescriptor)o);
+ }
/**
* Serialize the DelayedPaymentOutputDescriptor object into a byte array which can be read by DelayedPaymentOutputDescriptor_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ErrorMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ErrorMessage b) {
+ boolean ret = bindings.ErrorMessage_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ErrorMessage)) return false;
+ return this.eq((ErrorMessage)o);
+ }
/**
* Serialize the ErrorMessage object into a byte array which can be read by ErrorMessage_read
*/
}
/**
- * Construct an `ExpiryTime` from a `Duration`.
+ * Construct an `ExpiryTime` from a `Duration`, dropping the sub-second part.
*/
public static ExpiryTime from_duration(long duration) {
long ret = bindings.ExpiryTime_from_duration(duration);
* Note that use as part of a [`Watch`] implementation involves reentrancy. Therefore, the `Filter`
* should not block on I/O. Implementations should instead queue the newly monitored data to be
* processed later. Then, in order to block until the data has been processed, any [`Watch`]
- * invocation that has called the `Filter` must return [`TemporaryFailure`].
+ * invocation that has called the `Filter` must return [`InProgress`].
*
- * [`TemporaryFailure`]: ChannelMonitorUpdateErr::TemporaryFailure
+ * [`InProgress`]: ChannelMonitorUpdateStatus::InProgress
* [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
* [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two FundingCreateds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(FundingCreated b) {
+ boolean ret = bindings.FundingCreated_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof FundingCreated)) return false;
+ return this.eq((FundingCreated)o);
+ }
/**
* Serialize the FundingCreated object into a byte array which can be read by FundingCreated_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two FundingSigneds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(FundingSigned b) {
+ boolean ret = bindings.FundingSigned_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof FundingSigned)) return false;
+ return this.eq((FundingSigned)o);
+ }
/**
* Serialize the FundingSigned object into a byte array which can be read by FundingSigned_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two GossipTimestampFilters contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(GossipTimestampFilter b) {
+ boolean ret = bindings.GossipTimestampFilter_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof GossipTimestampFilter)) return false;
+ return this.eq((GossipTimestampFilter)o);
+ }
/**
* Serialize the GossipTimestampFilter object into a byte array which can be read by GossipTimestampFilter_read
*/
private DecodeError(long ptr, bindings.LDKGraphSyncError.DecodeError obj) {
super(null, ptr);
long decode_error = obj.decode_error;
- org.ldk.structs.DecodeError decode_error_hu_conv = null; if (decode_error < 0 || decode_error > 4096) { decode_error_hu_conv = new org.ldk.structs.DecodeError(null, decode_error); }
+ org.ldk.structs.DecodeError decode_error_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(decode_error);
if (decode_error_hu_conv != null) { decode_error_hu_conv.ptrs_to.add(this); };
this.decode_error = decode_error_hu_conv;
}
* Utility method to constructs a new DecodeError-variant GraphSyncError
*/
public static GraphSyncError decode_error(DecodeError a) {
- long ret = bindings.GraphSyncError_decode_error(a == null ? 0 : a.ptr);
+ long ret = bindings.GraphSyncError_decode_error(a.ptr);
Reference.reachabilityFence(a);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(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(a); };
return ret_hu_conv;
}
return ret_hu_conv;
}
+ /**
+ * Checks if two HTLCDestinations contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(HTLCDestination b) {
+ boolean ret = bindings.HTLCDestination_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof HTLCDestination)) return false;
+ return this.eq((HTLCDestination)o);
+ }
/**
* Serialize the HTLCDestination object into a byte array which can be read by HTLCDestination_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two HTLCOutputInCommitments contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(HTLCOutputInCommitment b) {
+ boolean ret = bindings.HTLCOutputInCommitment_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof HTLCOutputInCommitment)) return false;
+ return this.eq((HTLCOutputInCommitment)o);
+ }
/**
* Serialize the HTLCOutputInCommitment object into a byte array which can be read by HTLCOutputInCommitment_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two HTLCUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(HTLCUpdate b) {
+ boolean ret = bindings.HTLCUpdate_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof HTLCUpdate)) return false;
+ return this.eq((HTLCUpdate)o);
+ }
/**
* Serialize the HTLCUpdate object into a byte array which can be read by HTLCUpdate_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two Hostnames contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(Hostname b) {
+ boolean ret = bindings.Hostname_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Hostname)) return false;
+ return this.eq((Hostname)o);
+ }
/**
* Returns the length of the hostname.
*/
return ret_hu_conv;
}
+ /**
+ * Constructs a new CustomOnionMessageHandler which calls the relevant methods on this_arg.
+ * This copies the `inner` pointer in this_arg and thus the returned CustomOnionMessageHandler must be freed before this_arg is
+ */
+ public CustomOnionMessageHandler as_CustomOnionMessageHandler() {
+ long ret = bindings.IgnoringMessageHandler_as_CustomOnionMessageHandler(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ CustomOnionMessageHandler ret_hu_conv = new CustomOnionMessageHandler(null, ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ return ret_hu_conv;
+ }
+
/**
* Constructs a new CustomMessageReader which calls the relevant methods on this_arg.
* This copies the `inner` pointer in this_arg and thus the returned CustomMessageReader must be freed before this_arg is
return ret_hu_conv;
}
+ /**
+ * Checks if two Inits contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(Init b) {
+ boolean ret = bindings.Init_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Init)) return false;
+ return this.eq((Init)o);
+ }
/**
* Serialize the Init object into a byte array which can be read by Init_read
*/
return ret_hu_conv;
}
- /**
- * Returns the set of known init features that are related to channels. At least some of
- * these features are likely required for peers to talk to us.
- */
- public static InitFeatures known_channel_features() {
- long ret = bindings.InitFeatures_known_channel_features();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Create a blank Features with no features set
*/
return ret_hu_conv;
}
- /**
- * Creates a Features with the bits set which are known by the implementation
- */
- public static InitFeatures known() {
- long ret = bindings.InitFeatures_known();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Returns true if this `Features` object contains unknown feature flags which are set as
* \"required\".
return ret_hu_conv;
}
- /**
- * Creates a Features with the bits set which are known by the implementation
- */
- public static InvoiceFeatures known() {
- long ret = bindings.InvoiceFeatures_known();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Returns true if this `Features` object contains unknown feature flags which are set as
* \"required\".
*
* This method must return the same value each time it is called with a given `Recipient`
* parameter.
+ *
+ * Errors if the `Recipient` variant is not supported by the implementation.
*/
Result_SecretKeyNoneZ get_node_secret(Recipient recipient);
+ /**
+ * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in
+ * [`get_node_secret`].
+ *
+ * This method must return the same value each time it is called with a given `Recipient`
+ * parameter.
+ *
+ * Errors if the `Recipient` variant is not supported by the implementation.
+ *
+ * [`get_node_secret`]: KeysInterface::get_node_secret
+ */
+ Result_PublicKeyNoneZ get_node_id(Recipient recipient);
/**
* Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if
* one is provided. Note that this tweak can be applied to `other_key` instead of our node
* secret, though this is less efficient.
*
+ * Errors if the `Recipient` variant is not supported by the implementation.
+ *
* [`node secret`]: Self::get_node_secret
*/
Result_SharedSecretNoneZ ecdh(Recipient recipient, byte[] other_key, Option_ScalarZ tweak);
* The hrp is ascii bytes, while the invoice data is base32.
*
* The secret key used to sign the invoice is dependent on the [`Recipient`].
+ *
+ * Errors if the `Recipient` variant is not supported by the implementation.
*/
Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient receipient);
/**
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
+ @Override public long get_node_id(Recipient recipient) {
+ Result_PublicKeyNoneZ ret = arg.get_node_id(recipient);
+ Reference.reachabilityFence(arg);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
+ }
@Override public long ecdh(Recipient recipient, byte[] other_key, long tweak) {
org.ldk.structs.Option_ScalarZ tweak_hu_conv = org.ldk.structs.Option_ScalarZ.constr_from_ptr(tweak);
if (tweak_hu_conv != null) { tweak_hu_conv.ptrs_to.add(this); };
*
* This method must return the same value each time it is called with a given `Recipient`
* parameter.
+ *
+ * Errors if the `Recipient` variant is not supported by the implementation.
*/
public Result_SecretKeyNoneZ get_node_secret(org.ldk.enums.Recipient recipient) {
long ret = bindings.KeysInterface_get_node_secret(this.ptr, recipient);
return ret_hu_conv;
}
+ /**
+ * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in
+ * [`get_node_secret`].
+ *
+ * This method must return the same value each time it is called with a given `Recipient`
+ * parameter.
+ *
+ * Errors if the `Recipient` variant is not supported by the implementation.
+ *
+ * [`get_node_secret`]: KeysInterface::get_node_secret
+ */
+ public Result_PublicKeyNoneZ get_node_id(org.ldk.enums.Recipient recipient) {
+ long ret = bindings.KeysInterface_get_node_id(this.ptr, recipient);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(recipient);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
/**
* Gets the ECDH shared secret of our [`node secret`] and `other_key`, multiplying by `tweak` if
* one is provided. Note that this tweak can be applied to `other_key` instead of our node
* secret, though this is less efficient.
*
+ * Errors if the `Recipient` variant is not supported by the implementation.
+ *
* [`node secret`]: Self::get_node_secret
*/
public Result_SharedSecretNoneZ ecdh(org.ldk.enums.Recipient recipient, byte[] other_key, Option_ScalarZ tweak) {
* The hrp is ascii bytes, while the invoice data is base32.
*
* The secret key used to sign the invoice is dependent on the [`Recipient`].
+ *
+ * Errors if the `Recipient` variant is not supported by the implementation.
*/
public Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, org.ldk.enums.Recipient receipient) {
long ret = bindings.KeysInterface_sign_invoice(this.ptr, hrp_bytes, invoice_data != null ? InternalUtils.convUInt5Array(invoice_data) : null, receipient);
if (raw_val.getClass() == bindings.LDKMonitorEvent.CommitmentTxConfirmed.class) {
return new CommitmentTxConfirmed(ptr, (bindings.LDKMonitorEvent.CommitmentTxConfirmed)raw_val);
}
- if (raw_val.getClass() == bindings.LDKMonitorEvent.UpdateCompleted.class) {
- return new UpdateCompleted(ptr, (bindings.LDKMonitorEvent.UpdateCompleted)raw_val);
+ if (raw_val.getClass() == bindings.LDKMonitorEvent.Completed.class) {
+ return new Completed(ptr, (bindings.LDKMonitorEvent.Completed)raw_val);
}
if (raw_val.getClass() == bindings.LDKMonitorEvent.UpdateFailed.class) {
return new UpdateFailed(ptr, (bindings.LDKMonitorEvent.UpdateFailed)raw_val);
}
/**
* Indicates a [`ChannelMonitor`] update has completed. See
- * [`ChannelMonitorUpdateErr::TemporaryFailure`] for more information on how this is used.
+ * [`ChannelMonitorUpdateStatus::InProgress`] for more information on how this is used.
*
- * [`ChannelMonitorUpdateErr::TemporaryFailure`]: super::ChannelMonitorUpdateErr::TemporaryFailure
+ * [`ChannelMonitorUpdateStatus::InProgress`]: super::ChannelMonitorUpdateStatus::InProgress
*/
- public final static class UpdateCompleted extends MonitorEvent {
+ public final static class Completed extends MonitorEvent {
/**
* The funding outpoint of the [`ChannelMonitor`] that was updated
*/
* same [`ChannelMonitor`] have been applied and persisted.
*/
public final long monitor_update_id;
- private UpdateCompleted(long ptr, bindings.LDKMonitorEvent.UpdateCompleted obj) {
+ private Completed(long ptr, bindings.LDKMonitorEvent.Completed obj) {
super(null, ptr);
long funding_txo = obj.funding_txo;
org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); }
}
/**
* Indicates a [`ChannelMonitor`] update has failed. See
- * [`ChannelMonitorUpdateErr::PermanentFailure`] for more information on how this is used.
+ * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more information on how this is used.
*
- * [`ChannelMonitorUpdateErr::PermanentFailure`]: super::ChannelMonitorUpdateErr::PermanentFailure
+ * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure
*/
public final static class UpdateFailed extends MonitorEvent {
public final org.ldk.structs.OutPoint update_failed;
}
/**
- * Utility method to constructs a new UpdateCompleted-variant MonitorEvent
+ * Utility method to constructs a new Completed-variant MonitorEvent
*/
- public static MonitorEvent update_completed(OutPoint funding_txo, long monitor_update_id) {
- long ret = bindings.MonitorEvent_update_completed(funding_txo == null ? 0 : funding_txo.ptr, monitor_update_id);
+ public static MonitorEvent completed(OutPoint funding_txo, long monitor_update_id) {
+ long ret = bindings.MonitorEvent_completed(funding_txo == null ? 0 : funding_txo.ptr, monitor_update_id);
Reference.reachabilityFence(funding_txo);
Reference.reachabilityFence(monitor_update_id);
if (ret >= 0 && ret <= 4096) { return null; }
return ret_hu_conv;
}
+ /**
+ * Checks if two MonitorEvents contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(MonitorEvent b) {
+ boolean ret = bindings.MonitorEvent_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof MonitorEvent)) return false;
+ return this.eq((MonitorEvent)o);
+ }
/**
* Serialize the MonitorEvent object into a byte array which can be read by MonitorEvent_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two NetAddresss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(NetAddress b) {
+ boolean ret = bindings.NetAddress_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NetAddress)) return false;
+ return this.eq((NetAddress)o);
+ }
/**
* Serialize the NetAddress object into a byte array which can be read by NetAddress_read
*/
}
/**
- * Marks a node in the graph as failed.
+ * Marks a node in the graph as permanently failed, effectively removing it and its channels
+ * from local storage.
*/
- public void node_failed(byte[] _node_id, boolean is_permanent) {
- bindings.NetworkGraph_node_failed(this.ptr, InternalUtils.check_arr_len(_node_id, 33), is_permanent);
+ public void node_failed_permanent(byte[] node_id) {
+ bindings.NetworkGraph_node_failed_permanent(this.ptr, InternalUtils.check_arr_len(node_id, 33));
Reference.reachabilityFence(this);
- Reference.reachabilityFence(_node_id);
- Reference.reachabilityFence(is_permanent);
+ Reference.reachabilityFence(node_id);
}
/**
* Note that for users of the `lightning-background-processor` crate this method may be
* automatically called regularly for you.
*
+ * This method will also cause us to stop tracking removed nodes and channels if they have been
+ * in the map for a while so that these can be resynced from gossip in the future.
+ *
* This method is only available with the `std` feature. See
- * [`NetworkGraph::remove_stale_channels_with_time`] for `no-std` use.
+ * [`NetworkGraph::remove_stale_channels_and_tracking_with_time`] for `no-std` use.
*/
- public void remove_stale_channels() {
- bindings.NetworkGraph_remove_stale_channels(this.ptr);
+ public void remove_stale_channels_and_tracking() {
+ bindings.NetworkGraph_remove_stale_channels_and_tracking(this.ptr);
Reference.reachabilityFence(this);
}
* updates every two weeks, the non-normative section of BOLT 7 currently suggests that
* pruning occur for updates which are at least two weeks old, which we implement here.
*
+ * This method will also cause us to stop tracking removed nodes and channels if they have been
+ * in the map for a while so that these can be resynced from gossip in the future.
+ *
* This function takes the current unix time as an argument. For users with the `std` feature
- * enabled, [`NetworkGraph::remove_stale_channels`] may be preferable.
+ * enabled, [`NetworkGraph::remove_stale_channels_and_tracking`] may be preferable.
*/
- public void remove_stale_channels_with_time(long current_time_unix) {
- bindings.NetworkGraph_remove_stale_channels_with_time(this.ptr, current_time_unix);
+ public void remove_stale_channels_and_tracking_with_time(long current_time_unix) {
+ bindings.NetworkGraph_remove_stale_channels_and_tracking_with_time(this.ptr, current_time_unix);
Reference.reachabilityFence(this);
Reference.reachabilityFence(current_time_unix);
}
}
/**
* An error indicating that a node failed to route a payment, which should be applied via
- * [`NetworkGraph::node_failed`].
+ * [`NetworkGraph::node_failed_permanent`] if permanent.
*/
public final static class NodeFailure extends NetworkUpdate {
/**
return ret_hu_conv;
}
+ /**
+ * Checks if two NetworkUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(NetworkUpdate b) {
+ boolean ret = bindings.NetworkUpdate_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NetworkUpdate)) return false;
+ return this.eq((NetworkUpdate)o);
+ }
/**
* Serialize the NetworkUpdate object into a byte array which can be read by NetworkUpdate_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two NodeAliass contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(NodeAlias b) {
+ boolean ret = bindings.NodeAlias_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NodeAlias)) return false;
+ return this.eq((NodeAlias)o);
+ }
/**
* Serialize the NodeAlias object into a byte array which can be read by NodeAlias_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two NodeAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(NodeAnnouncement b) {
+ boolean ret = bindings.NodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NodeAnnouncement)) return false;
+ return this.eq((NodeAnnouncement)o);
+ }
/**
* Serialize the NodeAnnouncement object into a byte array which can be read by NodeAnnouncement_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two NodeAnnouncementInfos contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(NodeAnnouncementInfo b) {
+ boolean ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NodeAnnouncementInfo)) return false;
+ return this.eq((NodeAnnouncementInfo)o);
+ }
/**
* Serialize the NodeAnnouncementInfo object into a byte array which can be read by NodeAnnouncementInfo_read
*/
return ret_hu_conv;
}
- /**
- * Returns the set of known node features that are related to channels.
- */
- public static NodeFeatures known_channel_features() {
- long ret = bindings.NodeFeatures_known_channel_features();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Create a blank Features with no features set
*/
return ret_hu_conv;
}
- /**
- * Creates a Features with the bits set which are known by the implementation
- */
- public static NodeFeatures known() {
- long ret = bindings.NodeFeatures_known();
- if (ret >= 0 && ret <= 4096) { return null; }
- org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
- return ret_hu_conv;
- }
-
/**
* Returns true if this `Features` object contains unknown feature flags which are set as
* \"required\".
return ret_hu_conv;
}
+ /**
+ * Checks if two NodeInfos contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(NodeInfo b) {
+ boolean ret = bindings.NodeInfo_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof NodeInfo)) return false;
+ return this.eq((NodeInfo)o);
+ }
/**
* Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two OnionMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(OnionMessage b) {
+ boolean ret = bindings.OnionMessage_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof OnionMessage)) return false;
+ return this.eq((OnionMessage)o);
+ }
/**
* Read a OnionMessage from a byte array, created by OnionMessage_write
*/
/**
* Called when a connection is established with a peer. Can be used to track which peers
* advertise onion message support and are online.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
*/
- void peer_connected(byte[] their_node_id, Init init);
+ Result_NoneNoneZ peer_connected(byte[] their_node_id, Init init);
/**
* Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
* drop and refuse to forward onion messages to this peer.
+ *
+ * Note that in some rare cases this may be called without a corresponding
+ * [`Self::peer_connected`].
*/
void peer_disconnected(byte[] their_node_id, boolean no_connection_possible);
/**
arg.handle_onion_message(peer_node_id, msg_hu_conv);
Reference.reachabilityFence(arg);
}
- @Override public void peer_connected(byte[] their_node_id, long init) {
+ @Override public long peer_connected(byte[] their_node_id, long init) {
org.ldk.structs.Init init_hu_conv = null; if (init < 0 || init > 4096) { init_hu_conv = new org.ldk.structs.Init(null, init); }
- arg.peer_connected(their_node_id, init_hu_conv);
+ Result_NoneNoneZ ret = arg.peer_connected(their_node_id, init_hu_conv);
Reference.reachabilityFence(arg);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
}
@Override public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
arg.peer_disconnected(their_node_id, no_connection_possible);
/**
* Called when a connection is established with a peer. Can be used to track which peers
* advertise onion message support and are online.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
*/
- public void peer_connected(byte[] their_node_id, Init init) {
- bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr);
+ public Result_NoneNoneZ peer_connected(byte[] their_node_id, Init init) {
+ long ret = bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(their_node_id);
Reference.reachabilityFence(init);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(init); };
+ return ret_hu_conv;
}
/**
* Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
* drop and refuse to forward onion messages to this peer.
+ *
+ * Note that in some rare cases this may be called without a corresponding
+ * [`Self::peer_connected`].
*/
public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) {
bindings.OnionMessageHandler_peer_disconnected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), no_connection_possible);
/**
* A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
* used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
- * and receiving empty onion messages is supported.
+ * and receiving custom onion messages is supported.
*
* # Example
*
* # use bitcoin::hashes::_export::_core::time::Duration;
* # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey};
* # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface};
+ * # use lightning::ln::msgs::DecodeError;
+ * # use lightning::ln::peer_handler::IgnoringMessageHandler;
* # use lightning::onion_message::messenger::{Destination, OnionMessenger};
+ * # use lightning::onion_message::packet::CustomOnionMessageContents;
* # use lightning::onion_message::blinded_route::BlindedRoute;
* # use lightning::util::logger::{Logger, Record};
+ * # use lightning::util::ser::{Writeable, Writer};
+ * # use lightning::io;
* # use std::sync::Arc;
* # struct FakeLogger {};
* # impl Logger for FakeLogger {
* # let node_secret = SecretKey::from_slice(&hex::decode(\"0101010101010101010101010101010101010101010101010101010101010101\").unwrap()[..]).unwrap();
* # let secp_ctx = Secp256k1::new();
* # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret);
- * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1,
- * hop_node_id1);
+ * # let (hop_node_id2, hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1, hop_node_id1);
* # let destination_node_id = hop_node_id1;
- * #
+ * # let your_custom_message_handler = IgnoringMessageHandler {};
* Create the onion messenger. This must use the same `keys_manager` as is passed to your
* ChannelManager.
- * let onion_messenger = OnionMessenger::new(&keys_manager, logger);
+ * let onion_messenger = OnionMessenger::new(&keys_manager, logger, your_custom_message_handler);
*
- * Send an empty onion message to a node id.
+ * # #[derive(Clone)]
+ * # struct YourCustomMessage {}
+ * impl Writeable for YourCustomMessage {
+ * \tfn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
+ * \t\t# Ok(())
+ * \t\t// Write your custom onion message to `w`
+ * \t}
+ * }
+ * impl CustomOnionMessageContents for YourCustomMessage {
+ * \tfn tlv_type(&self) -> u64 {
+ * \t\t# let your_custom_message_type = 42;
+ * \t\tyour_custom_message_type
+ * \t}
+ * }
+ * Send a custom onion message to a node id.
* let intermediate_hops = [hop_node_id1, hop_node_id2];
* let reply_path = None;
- * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), reply_path);
+ * # let your_custom_message = YourCustomMessage {};
+ * onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::Node(destination_node_id), your_custom_message, reply_path);
*
* Create a blinded route to yourself, for someone to send an onion message to.
* # let your_node_id = hop_node_id1;
* let hops = [hop_node_id3, hop_node_id4, your_node_id];
* let blinded_route = BlindedRoute::new(&hops, &keys_manager, &secp_ctx).unwrap();
*
- * Send an empty onion message to a blinded route.
+ * Send a custom onion message to a blinded route.
* # let intermediate_hops = [hop_node_id1, hop_node_id2];
* let reply_path = None;
- * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), reply_path);
+ * # let your_custom_message = YourCustomMessage {};
+ * onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), your_custom_message, reply_path);
* ```
*
* [offers]: <https://github.com/lightning/bolts/pull/798>
* Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to
* their respective handlers.
*/
- public static OnionMessenger of(KeysInterface keys_manager, Logger logger) {
- long ret = bindings.OnionMessenger_new(keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr);
+ public static OnionMessenger of(KeysInterface keys_manager, Logger logger, CustomOnionMessageHandler custom_handler) {
+ long ret = bindings.OnionMessenger_new(keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, custom_handler == null ? 0 : custom_handler.ptr);
Reference.reachabilityFence(keys_manager);
Reference.reachabilityFence(logger);
+ Reference.reachabilityFence(custom_handler);
if (ret >= 0 && ret <= 4096) { return null; }
org.ldk.structs.OnionMessenger ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OnionMessenger(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(keys_manager); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(custom_handler); };
return ret_hu_conv;
}
/**
- * Send an empty onion message to `destination`, routing it through `intermediate_nodes`.
+ * Send an onion message with contents `message` to `destination`, routing it through `intermediate_nodes`.
* See [`OnionMessenger`] for example usage.
*
* Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public Result_NoneSendErrorZ send_onion_message(byte[][] intermediate_nodes, Destination destination, @Nullable BlindedRoute reply_path) {
- long ret = bindings.OnionMessenger_send_onion_message(this.ptr, intermediate_nodes != null ? Arrays.stream(intermediate_nodes).map(intermediate_nodes_conv_8 -> InternalUtils.check_arr_len(intermediate_nodes_conv_8, 33)).toArray(byte[][]::new) : null, destination.ptr, reply_path == null ? 0 : reply_path.ptr);
+ public Result_NoneSendErrorZ send_custom_onion_message(byte[][] intermediate_nodes, Destination destination, CustomOnionMessageContents msg, @Nullable BlindedRoute reply_path) {
+ long ret = bindings.OnionMessenger_send_custom_onion_message(this.ptr, intermediate_nodes != null ? Arrays.stream(intermediate_nodes).map(intermediate_nodes_conv_8 -> InternalUtils.check_arr_len(intermediate_nodes_conv_8, 33)).toArray(byte[][]::new) : null, destination.ptr, msg == null ? 0 : msg.ptr, reply_path == null ? 0 : reply_path.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(intermediate_nodes);
Reference.reachabilityFence(destination);
+ Reference.reachabilityFence(msg);
Reference.reachabilityFence(reply_path);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret);
+ if (this != null) { this.ptrs_to.add(msg); };
if (this != null) { this.ptrs_to.add(reply_path); };
return ret_hu_conv;
}
return ret_hu_conv;
}
+ /**
+ * Checks if two OpenChannels contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(OpenChannel b) {
+ boolean ret = bindings.OpenChannel_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof OpenChannel)) return false;
+ return this.eq((OpenChannel)o);
+ }
/**
* Serialize the OpenChannel object into a byte array which can be read by OpenChannel_read
*/
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+
+/**
+ * An enum which can either contain a crate::lightning::onion_message::packet::CustomOnionMessageContents or not
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class Option_CustomOnionMessageContentsZ extends CommonBase {
+ private Option_CustomOnionMessageContentsZ(Object _dummy, long ptr) { super(ptr); }
+ @Override @SuppressWarnings("deprecation")
+ protected void finalize() throws Throwable {
+ super.finalize();
+ if (ptr != 0) { bindings.COption_CustomOnionMessageContentsZ_free(ptr); }
+ }
+ static Option_CustomOnionMessageContentsZ constr_from_ptr(long ptr) {
+ bindings.LDKCOption_CustomOnionMessageContentsZ raw_val = bindings.LDKCOption_CustomOnionMessageContentsZ_ref_from_ptr(ptr);
+ if (raw_val.getClass() == bindings.LDKCOption_CustomOnionMessageContentsZ.Some.class) {
+ return new Some(ptr, (bindings.LDKCOption_CustomOnionMessageContentsZ.Some)raw_val);
+ }
+ if (raw_val.getClass() == bindings.LDKCOption_CustomOnionMessageContentsZ.None.class) {
+ return new None(ptr, (bindings.LDKCOption_CustomOnionMessageContentsZ.None)raw_val);
+ }
+ assert false; return null; // Unreachable without extending the (internal) bindings interface
+ }
+
+ /**
+ * When we're in this state, this COption_CustomOnionMessageContentsZ contains a crate::lightning::onion_message::packet::CustomOnionMessageContents
+ */
+ public final static class Some extends Option_CustomOnionMessageContentsZ {
+ public final org.ldk.structs.CustomOnionMessageContents some;
+ private Some(long ptr, bindings.LDKCOption_CustomOnionMessageContentsZ.Some obj) {
+ super(null, ptr);
+ long some = obj.some;
+ CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, some);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ this.some = ret_hu_conv;
+ }
+ }
+ /**
+ * When we're in this state, this COption_CustomOnionMessageContentsZ contains nothing
+ */
+ public final static class None extends Option_CustomOnionMessageContentsZ {
+ private None(long ptr, bindings.LDKCOption_CustomOnionMessageContentsZ.None obj) {
+ super(null, ptr);
+ }
+ }
+ /**
+ * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents
+ */
+ public static Option_CustomOnionMessageContentsZ some(CustomOnionMessageContents o) {
+ long ret = bindings.COption_CustomOnionMessageContentsZ_some(o == null ? 0 : 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);
+ 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(o); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Constructs a new COption_CustomOnionMessageContentsZ containing nothing
+ */
+ public static Option_CustomOnionMessageContentsZ none() {
+ long ret = bindings.COption_CustomOnionMessageContentsZ_none();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.COption_CustomOnionMessageContentsZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new COption_CustomOnionMessageContentsZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Option_CustomOnionMessageContentsZ clone() {
+ long ret = bindings.COption_CustomOnionMessageContentsZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.Option_CustomOnionMessageContentsZ ret_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); };
+ return ret_hu_conv;
+ }
+
+}
return ret_hu_conv;
}
+ /**
+ * Checks if two ParseErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(ParseError b) {
+ boolean ret = bindings.ParseError_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ParseError)) return false;
+ return this.eq((ParseError)o);
+ }
/**
* Get the string representation of a ParseError object
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ParseOrSemanticErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(ParseOrSemanticError b) {
+ boolean ret = bindings.ParseOrSemanticError_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ParseOrSemanticError)) return false;
+ return this.eq((ParseOrSemanticError)o);
+ }
/**
* Get the string representation of a ParseOrSemanticError object
*/
* in over-/re-payment.
*
* The results here are ordered the same as the paths in the route object which was passed to
- * send_payment, and any Errs which are not APIError::MonitorUpdateFailed can be safely
- * retried (though there is currently no API with which to do so).
+ * send_payment, and any `Err`s which are not [`APIError::MonitorUpdateInProgress`] can be
+ * safely retried via [`ChannelManager::retry_payment`].
*
- * Any entries which contain Err(APIError::MonitorUpdateFailed) or Ok(()) MUST NOT be retried
- * as they will result in over-/re-payment. These HTLCs all either successfully sent (in the
- * case of Ok(())) or will send once channel_monitor_updated is called on the next-hop channel
- * with the latest update_id.
+ * Any entries which contain `Err(APIError::MonitorUpdateInprogress)` or `Ok(())` MUST NOT be
+ * retried as they will result in over-/re-payment. These HTLCs all either successfully sent
+ * (in the case of `Ok(())`) or will send once a [`MonitorEvent::Completed`] is provided for
+ * the next-hop channel with the latest update_id.
*/
public final static class PartialFailure extends PaymentSendFailure {
/**
* timestamp, however if it is not available a persistent counter that increases once per
* 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, byte[] our_node_secret, long current_time, byte[] ephemeral_random_data, Logger logger, CustomMessageHandler custom_message_handler) {
+ public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, byte[] our_node_secret, int current_time, byte[] ephemeral_random_data, Logger logger, CustomMessageHandler custom_message_handler) {
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), InternalUtils.check_arr_len(our_node_secret, 32), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr);
Reference.reachabilityFence(message_handler_chan_handler_arg);
Reference.reachabilityFence(message_handler_route_handler_arg);
*
* Each method can return three possible values:
* If persistence (including any relevant `fsync()` calls) happens immediately, the
- * implementation should return `Ok(())`, indicating normal channel operation should continue.
+ * implementation should return [`ChannelMonitorUpdateStatus::Completed`], indicating normal
+ * channel operation should continue.
* If persistence happens asynchronously, implementations should first ensure the
* [`ChannelMonitor`] or [`ChannelMonitorUpdate`] are written durably to disk, and then return
- * `Err(ChannelMonitorUpdateErr::TemporaryFailure)` while the update continues in the
- * background. Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be
- * called with the corresponding [`MonitorUpdateId`].
+ * [`ChannelMonitorUpdateStatus::InProgress`] while the update continues in the background.
+ * Once the update completes, [`ChainMonitor::channel_monitor_updated`] should be called with
+ * the corresponding [`MonitorUpdateId`].
*
* Note that unlike the direct [`chain::Watch`] interface,
* [`ChainMonitor::channel_monitor_updated`] must be called once for *each* update which occurs.
*
* If persistence fails for some reason, implementations should return
- * `Err(ChannelMonitorUpdateErr::PermanentFailure)`, in which case the channel will likely be
+ * [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
* closed without broadcasting the latest state. See
- * [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
+ * [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class Persist extends CommonBase {
* and the stored channel data). Note that you **must** persist every new monitor to disk.
*
* The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
- * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ * if you return [`ChannelMonitorUpdateStatus::InProgress`].
*
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
- * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+ * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
*
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
* [`Writeable::write`]: crate::util::ser::Writeable::write
*/
- Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id);
+ ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id);
/**
* Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
* update.
* whereas updates are small and `O(1)`.
*
* The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
- * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ * if you return [`ChannelMonitorUpdateStatus::InProgress`].
*
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
* [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
- * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+ * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
*
* [`Writeable::write`]: crate::util::ser::Writeable::write
*
* Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint channel_id, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id);
+ ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_id, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id);
}
private static class LDKPersistHolder { Persist held; }
public static Persist new_impl(PersistInterface arg) {
final LDKPersistHolder impl_holder = new LDKPersistHolder();
impl_holder.held = new Persist(new bindings.LDKPersist() {
- @Override public long persist_new_channel(long channel_id, long data, long update_id) {
+ @Override public ChannelMonitorUpdateStatus persist_new_channel(long channel_id, long data, long update_id) {
org.ldk.structs.OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.OutPoint(null, channel_id); }
if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.add(this); };
org.ldk.structs.ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new org.ldk.structs.ChannelMonitor(null, data); }
org.ldk.structs.MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, update_id); }
if (update_id_hu_conv != null) { update_id_hu_conv.ptrs_to.add(this); };
- Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv);
+ ChannelMonitorUpdateStatus ret = arg.persist_new_channel(channel_id_hu_conv, data_hu_conv, update_id_hu_conv);
Reference.reachabilityFence(arg);
- long result = ret == null ? 0 : ret.clone_ptr();
- return result;
+ return ret;
}
- @Override public long update_persisted_channel(long channel_id, long update, long data, long update_id) {
+ @Override public ChannelMonitorUpdateStatus update_persisted_channel(long channel_id, long update, long data, long update_id) {
org.ldk.structs.OutPoint channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.OutPoint(null, channel_id); }
if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.add(this); };
org.ldk.structs.ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, update); }
org.ldk.structs.ChannelMonitor data_hu_conv = null; if (data < 0 || data > 4096) { data_hu_conv = new org.ldk.structs.ChannelMonitor(null, data); }
org.ldk.structs.MonitorUpdateId update_id_hu_conv = null; if (update_id < 0 || update_id > 4096) { update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, update_id); }
if (update_id_hu_conv != null) { update_id_hu_conv.ptrs_to.add(this); };
- Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv);
+ ChannelMonitorUpdateStatus ret = arg.update_persisted_channel(channel_id_hu_conv, update_hu_conv, data_hu_conv, update_id_hu_conv);
Reference.reachabilityFence(arg);
- long result = ret == null ? 0 : ret.clone_ptr();
- return result;
+ return ret;
}
});
return impl_holder.held;
* and the stored channel data). Note that you **must** persist every new monitor to disk.
*
* The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
- * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ * if you return [`ChannelMonitorUpdateStatus::InProgress`].
*
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
- * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+ * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
*
* [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
* [`Writeable::write`]: crate::util::ser::Writeable::write
*/
- public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id) {
- long ret = bindings.Persist_persist_new_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr);
+ public ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id) {
+ ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(channel_id);
Reference.reachabilityFence(data);
Reference.reachabilityFence(update_id);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(channel_id); };
if (this != null) { this.ptrs_to.add(data); };
if (this != null) { this.ptrs_to.add(update_id); };
- return ret_hu_conv;
+ return ret;
}
/**
* whereas updates are small and `O(1)`.
*
* The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
- * if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ * if you return [`ChannelMonitorUpdateStatus::InProgress`].
*
* See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
* [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
- * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+ * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
*
* [`Writeable::write`]: crate::util::ser::Writeable::write
*
* Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
*/
- public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint channel_id, @Nullable ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id) {
- long ret = bindings.Persist_update_persisted_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, update == null ? 0 : update.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr);
+ public ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_id, @Nullable ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id) {
+ ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, update == null ? 0 : update.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(channel_id);
Reference.reachabilityFence(update);
Reference.reachabilityFence(data);
Reference.reachabilityFence(update_id);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(channel_id); };
if (this != null) { this.ptrs_to.add(update); };
if (this != null) { this.ptrs_to.add(data); };
if (this != null) { this.ptrs_to.add(update_id); };
- return ret_hu_conv;
+ return ret;
}
}
return ret_hu_conv;
}
+ /**
+ * Checks if two Pings contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(Ping b) {
+ boolean ret = bindings.Ping_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Ping)) return false;
+ return this.eq((Ping)o);
+ }
/**
* Serialize the Ping object into a byte array which can be read by Ping_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two Pongs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(Pong b) {
+ boolean ret = bindings.Pong_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Pong)) return false;
+ return this.eq((Pong)o);
+ }
/**
* Serialize the Pong object into a byte array which can be read by Pong_read
*/
* Creates a `PositiveTimestamp` from a [`SystemTime`] with a corresponding Unix timestamp in
* the range `0..=MAX_TIMESTAMP`.
*
+ * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
+ *
* Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
*/
public static Result_PositiveTimestampCreationErrorZ from_system_time(long time) {
* Creates a `PositiveTimestamp` from a [`Duration`] since the Unix epoch in the range
* `0..=MAX_TIMESTAMP`.
*
+ * Note that the subsecond part is dropped as it is not representable in BOLT 11 invoices.
+ *
* Otherwise, returns a [`CreationError::TimestampOutOfBounds`].
*/
public static Result_PositiveTimestampCreationErrorZ from_duration_since_epoch(long duration) {
/**
* [`Score`] implementation using channel success probability distributions.
*
- * Based on *Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
- * and Stefan Richter [[1]]. Given the uncertainty of channel liquidity balances, probability
- * distributions are defined based on knowledge learned from successful and unsuccessful attempts.
- * Then the negative `log10` of the success probability is used to determine the cost of routing a
- * specific HTLC amount through a channel.
+ * Channels are tracked with upper and lower liquidity bounds - when an HTLC fails at a channel,
+ * we learn that the upper-bound on the available liquidity is lower than the amount of the HTLC.
+ * When a payment is forwarded through a channel (but fails later in the route), we learn the
+ * lower-bound on the channel's available liquidity must be at least the value of the HTLC.
*
- * Knowledge about channel liquidity balances takes the form of upper and lower bounds on the
- * possible liquidity. Certainty of the bounds is decreased over time using a decay function. See
- * [`ProbabilisticScoringParameters`] for details.
+ * These bounds are then used to determine a success probability using the formula from
+ * Optimally Reliable & Cheap Payment Flows on the Lightning Network* by Rene Pickhardt
+ * and Stefan Richter [[1]] (i.e. `(upper_bound - payment_amount) / (upper_bound - lower_bound)`).
*
- * Since the scorer aims to learn the current channel liquidity balances, it works best for nodes
- * with high payment volume or that actively probe the [`NetworkGraph`]. Nodes with low payment
- * volume are more likely to experience failed payment paths, which would need to be retried.
+ * This probability is combined with the [`liquidity_penalty_multiplier_msat`] and
+ * [`liquidity_penalty_amount_multiplier_msat`] parameters to calculate a concrete penalty in
+ * milli-satoshis. The penalties, when added across all hops, have the property of being linear in
+ * terms of the entire path's success probability. This allows the router to directly compare
+ * penalties for different paths. See the documentation of those parameters for the exact formulas.
+ *
+ * The liquidity bounds are decayed by halving them every [`liquidity_offset_half_life`].
+ *
+ * Further, we track the history of our upper and lower liquidity bounds for each channel,
+ * allowing us to assign a second penalty (using [`historical_liquidity_penalty_multiplier_msat`]
+ * and [`historical_liquidity_penalty_amount_multiplier_msat`]) based on the same probability
+ * formula, but using the history of a channel rather than our latest estimates for the liquidity
+ * bounds.
*
* # Note
*
* behavior.
*
* [1]: https://arxiv.org/abs/2107.05322
+ * [`liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_multiplier_msat
+ * [`liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::liquidity_penalty_amount_multiplier_msat
+ * [`liquidity_offset_half_life`]: ProbabilisticScoringParameters::liquidity_offset_half_life
+ * [`historical_liquidity_penalty_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_multiplier_msat
+ * [`historical_liquidity_penalty_amount_multiplier_msat`]: ProbabilisticScoringParameters::historical_liquidity_penalty_amount_multiplier_msat
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class ProbabilisticScorer extends CommonBase {
/**
* A multiplier used in conjunction with the negative `log10` of the channel's success
- * probability for a payment to determine the liquidity penalty.
+ * probability for a payment, as determined by our latest estimates of the channel's
+ * liquidity, to determine the liquidity penalty.
*
* The penalty is based in part on the knowledge learned from prior successful and unsuccessful
* payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
* uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
* result in a `u64::max_value` penalty, however.
*
- * Default value: 40,000 msat
+ * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
+ *
+ * Default value: 30,000 msat
*
* [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
*/
/**
* A multiplier used in conjunction with the negative `log10` of the channel's success
- * probability for a payment to determine the liquidity penalty.
+ * probability for a payment, as determined by our latest estimates of the channel's
+ * liquidity, to determine the liquidity penalty.
*
* The penalty is based in part on the knowledge learned from prior successful and unsuccessful
* payments. This knowledge is decayed over time based on [`liquidity_offset_half_life`]. The
* uncertainty bounds of the channel liquidity balance. Amounts above the upper bound will
* result in a `u64::max_value` penalty, however.
*
- * Default value: 40,000 msat
+ * `-log10(success_probability) * liquidity_penalty_multiplier_msat`
+ *
+ * Default value: 30,000 msat
*
* [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
*/
}
/**
- * The time required to elapse before any knowledge learned about channel liquidity balances is
- * cut in half.
+ * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
+ * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
+ * the available liquidity is halved and the upper-bound moves half-way to the channel's total
+ * capacity.
*
- * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
- * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
- * the certainty of the channel liquidity balance.
+ * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
+ * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
+ * struct documentation for more info on the way the liquidity bounds are used.
*
- * Default value: 1 hour
+ * For example, if the channel's capacity is 1 million sats, and the current upper and lower
+ * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
+ * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
+ *
+ * Default value: 6 hours
*
* # Note
*
}
/**
- * The time required to elapse before any knowledge learned about channel liquidity balances is
- * cut in half.
+ * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
+ * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
+ * the available liquidity is halved and the upper-bound moves half-way to the channel's total
+ * capacity.
+ *
+ * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
+ * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
+ * struct documentation for more info on the way the liquidity bounds are used.
*
- * The bounds are defined in terms of offsets and are initially zero. Increasing the offsets
- * gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases
- * the certainty of the channel liquidity balance.
+ * For example, if the channel's capacity is 1 million sats, and the current upper and lower
+ * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
+ * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
*
- * Default value: 1 hour
+ * Default value: 6 hours
*
* # Note
*
/**
* A multiplier used in conjunction with a payment amount and the negative `log10` of the
- * channel's success probability for the payment to determine the amount penalty.
+ * channel's success probability for the payment, as determined by our latest estimates of the
+ * channel's liquidity, to determine the amount penalty.
*
* The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
* fees plus penalty) for large payments. The penalty is computed as the product of this
* probabilities, the multiplier will have a decreasing effect as the negative `log10` will
* fall below `1`.
*
- * Default value: 256 msat
+ * Default value: 192 msat
*/
public long get_liquidity_penalty_amount_multiplier_msat() {
long ret = bindings.ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(this.ptr);
/**
* A multiplier used in conjunction with a payment amount and the negative `log10` of the
- * channel's success probability for the payment to determine the amount penalty.
+ * channel's success probability for the payment, as determined by our latest estimates of the
+ * channel's liquidity, to determine the amount penalty.
*
* The purpose of the amount penalty is to avoid having fees dominate the channel cost (i.e.,
* fees plus penalty) for large payments. The penalty is computed as the product of this
* probabilities, the multiplier will have a decreasing effect as the negative `log10` will
* fall below `1`.
*
- * Default value: 256 msat
+ * Default value: 192 msat
*/
public void set_liquidity_penalty_amount_multiplier_msat(long val) {
bindings.ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(this.ptr, val);
Reference.reachabilityFence(val);
}
+ /**
+ * A multiplier used in conjunction with the negative `log10` of the channel's success
+ * probability for the payment, as determined based on the history of our estimates of the
+ * channel's available liquidity, to determine a penalty.
+ *
+ * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
+ * only our latest estimate for the current liquidity available in the channel, it estimates
+ * success probability based on the estimated liquidity available in the channel through
+ * history. Specifically, every time we update our liquidity bounds on a given channel, we
+ * track which of several buckets those bounds fall into, exponentially decaying the
+ * probability of each bucket as new samples are added.
+ *
+ * Default value: 10,000 msat
+ *
+ * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
+ */
+ public long get_historical_liquidity_penalty_multiplier_msat() {
+ long ret = bindings.ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * A multiplier used in conjunction with the negative `log10` of the channel's success
+ * probability for the payment, as determined based on the history of our estimates of the
+ * channel's available liquidity, to determine a penalty.
+ *
+ * This penalty is similar to [`liquidity_penalty_multiplier_msat`], however, instead of using
+ * only our latest estimate for the current liquidity available in the channel, it estimates
+ * success probability based on the estimated liquidity available in the channel through
+ * history. Specifically, every time we update our liquidity bounds on a given channel, we
+ * track which of several buckets those bounds fall into, exponentially decaying the
+ * probability of each bucket as new samples are added.
+ *
+ * Default value: 10,000 msat
+ *
+ * [`liquidity_penalty_multiplier_msat`]: Self::liquidity_penalty_multiplier_msat
+ */
+ public void set_historical_liquidity_penalty_multiplier_msat(long val) {
+ bindings.ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * A multiplier used in conjunction with the payment amount and the negative `log10` of the
+ * channel's success probability for the payment, as determined based on the history of our
+ * estimates of the channel's available liquidity, to determine a penalty.
+ *
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
+ * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
+ * of the payment amount, weighted by the negative `log10` of the success probability.
+ *
+ * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
+ * of using only our latest estimate for the current liquidity available in the channel, it
+ * estimates success probability based on the estimated liquidity available in the channel
+ * through history. Specifically, every time we update our liquidity bounds on a given
+ * channel, we track which of several buckets those bounds fall into, exponentially decaying
+ * the probability of each bucket as new samples are added.
+ *
+ * Default value: 64 msat
+ *
+ * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
+ */
+ public long get_historical_liquidity_penalty_amount_multiplier_msat() {
+ long ret = bindings.ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * A multiplier used in conjunction with the payment amount and the negative `log10` of the
+ * channel's success probability for the payment, as determined based on the history of our
+ * estimates of the channel's available liquidity, to determine a penalty.
+ *
+ * The purpose of the amount penalty is to avoid having fees dominate the channel cost for
+ * large payments. The penalty is computed as the product of this multiplier and the `2^20`ths
+ * of the payment amount, weighted by the negative `log10` of the success probability.
+ *
+ * This penalty is similar to [`liquidity_penalty_amount_multiplier_msat`], however, instead
+ * of using only our latest estimate for the current liquidity available in the channel, it
+ * estimates success probability based on the estimated liquidity available in the channel
+ * through history. Specifically, every time we update our liquidity bounds on a given
+ * channel, we track which of several buckets those bounds fall into, exponentially decaying
+ * the probability of each bucket as new samples are added.
+ *
+ * Default value: 64 msat
+ *
+ * [`liquidity_penalty_amount_multiplier_msat`]: Self::liquidity_penalty_amount_multiplier_msat
+ */
+ public void set_historical_liquidity_penalty_amount_multiplier_msat(long val) {
+ bindings.ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
+ /**
+ * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
+ * tracking can simply live on with increasingly stale data. Instead, when a channel has not
+ * seen a liquidity estimate update for this amount of time, the historical datapoints are
+ * decayed by half.
+ *
+ * Note that after 16 or more half lives all historical data will be completely gone.
+ *
+ * Default value: 14 days
+ */
+ public long get_historical_no_updates_half_life() {
+ long ret = bindings.ProbabilisticScoringParameters_get_historical_no_updates_half_life(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
+ * tracking can simply live on with increasingly stale data. Instead, when a channel has not
+ * seen a liquidity estimate update for this amount of time, the historical datapoints are
+ * decayed by half.
+ *
+ * Note that after 16 or more half lives all historical data will be completely gone.
+ *
+ * Default value: 14 days
+ */
+ public void set_historical_no_updates_half_life(long val) {
+ bindings.ProbabilisticScoringParameters_set_historical_no_updates_half_life(this.ptr, val);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
+ }
+
/**
* This penalty is applied when `htlc_maximum_msat` is equal to or larger than half of the
* channel's capacity, which makes us prefer nodes with a smaller `htlc_maximum_msat`. We
return ret_hu_conv;
}
+ /**
+ * Checks if two QueryChannelRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(QueryChannelRange b) {
+ boolean ret = bindings.QueryChannelRange_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof QueryChannelRange)) return false;
+ return this.eq((QueryChannelRange)o);
+ }
/**
* \n\t * Calculates the overflow safe ending block height for the query.\n\t * Overflow returns `0xffffffff`, otherwise returns `first_blocknum + number_of_blocks`\n\t
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two QueryShortChannelIdss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(QueryShortChannelIds b) {
+ boolean ret = bindings.QueryShortChannelIds_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof QueryShortChannelIds)) return false;
+ return this.eq((QueryShortChannelIds)o);
+ }
/**
* Read a QueryShortChannelIds from a byte array, created by QueryShortChannelIds_write
*/
/**
- * Rapid Gossip Sync struct
+ * The main Rapid Gossip Sync object.
+ *
* See [crate-level documentation] for usage.
*
* [crate-level documentation]: crate
}
/**
- * Instantiate a new [`RapidGossipSync`] instance
+ * Instantiate a new [`RapidGossipSync`] instance.
*/
public static RapidGossipSync of(NetworkGraph network_graph) {
long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr);
}
/**
- * Sync gossip data from a file
+ * Update network graph from binary data.
* Returns the last sync timestamp to be used the next time rapid sync data is queried.
*
- * `network_graph`: The network graph to apply the updates to
+ * `network_graph`: network graph to be updated
*
- * `sync_path`: Path to the file where the gossip update data is located
+ * `update_data`: `&[u8]` binary stream that comprises the update data
*/
- public Result_u32GraphSyncErrorZ sync_network_graph_with_file_path(java.lang.String sync_path) {
- long ret = bindings.RapidGossipSync_sync_network_graph_with_file_path(this.ptr, sync_path);
+ public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) {
+ long ret = bindings.RapidGossipSync_update_network_graph(this.ptr, update_data);
Reference.reachabilityFence(this);
- Reference.reachabilityFence(sync_path);
+ Reference.reachabilityFence(update_data);
if (ret >= 0 && ret <= 4096) { return null; }
Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}
/**
- * Returns whether a rapid gossip sync has completed at least once
+ * Returns whether a rapid gossip sync has completed at least once.
*/
public boolean is_initial_sync_complete() {
boolean ret = bindings.RapidGossipSync_is_initial_sync_complete(this.ptr);
return ret;
}
- /**
- * Update network graph from binary data.
- * Returns the last sync timestamp to be used the next time rapid sync data is queried.
- *
- * `network_graph`: network graph to be updated
- *
- * `update_data`: `&[u8]` binary stream that comprises the update data
- */
- public Result_u32GraphSyncErrorZ update_network_graph(byte[] update_data) {
- long ret = bindings.RapidGossipSync_update_network_graph(this.ptr, update_data);
- Reference.reachabilityFence(this);
- Reference.reachabilityFence(update_data);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_u32GraphSyncErrorZ ret_hu_conv = Result_u32GraphSyncErrorZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
}
return ret_hu_conv;
}
+ /**
+ * Checks if two ReplyChannelRanges contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ReplyChannelRange b) {
+ boolean ret = bindings.ReplyChannelRange_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ReplyChannelRange)) return false;
+ return this.eq((ReplyChannelRange)o);
+ }
/**
* Read a ReplyChannelRange from a byte array, created by ReplyChannelRange_write
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ReplyShortChannelIdsEnds contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ReplyShortChannelIdsEnd b) {
+ boolean ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ReplyShortChannelIdsEnd)) return false;
+ return this.eq((ReplyShortChannelIdsEnd)o);
+ }
/**
* Serialize the ReplyShortChannelIdsEnd object into a byte array which can be read by ReplyShortChannelIdsEnd_read
*/
private Result_AcceptChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_AcceptChannelDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_AcceptChannelDecodeErrorZ in the error state.
*/
public static Result_AcceptChannelDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_AnnouncementSignaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state.
*/
public static Result_AnnouncementSignaturesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_BlindedHopDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_BlindedHopDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_BlindedHopDecodeErrorZ in the error state.
*/
public static Result_BlindedHopDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_BlindedHopDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_BlindedHopDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_BlindedRouteDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_BlindedRouteDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_BlindedRouteDecodeErrorZ in the error state.
*/
public static Result_BlindedRouteDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_BlindedRouteDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_BlindedRouteDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BlindedRouteDecodeErrorZ ret_hu_conv = Result_BlindedRouteDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_BuiltCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state.
*/
public static Result_BuiltCommitmentTransactionDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state.
*/
public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state.
*/
public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_COption_ClosureReasonZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state.
*/
public static Result_COption_ClosureReasonZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_ClosureReasonZDecodeErrorZ ret_hu_conv = Result_COption_ClosureReasonZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_COption_CustomOnionMessageContentsZDecodeErrorZ extends CommonBase {
+ private Result_COption_CustomOnionMessageContentsZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(ptr); } super.finalize();
+ }
+
+ static Result_COption_CustomOnionMessageContentsZDecodeErrorZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(ptr)) {
+ return new Result_COption_CustomOnionMessageContentsZDecodeErrorZ_OK(null, ptr);
+ } else {
+ return new Result_COption_CustomOnionMessageContentsZDecodeErrorZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_COption_CustomOnionMessageContentsZDecodeErrorZ_OK extends Result_COption_CustomOnionMessageContentsZDecodeErrorZ {
+ public final Option_CustomOnionMessageContentsZ res;
+ private Result_COption_CustomOnionMessageContentsZDecodeErrorZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long res = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(ptr);
+ org.ldk.structs.Option_CustomOnionMessageContentsZ res_hu_conv = org.ldk.structs.Option_CustomOnionMessageContentsZ.constr_from_ptr(res);
+ if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); };
+ this.res = res_hu_conv;
+ }
+ }
+
+ public static final class Result_COption_CustomOnionMessageContentsZDecodeErrorZ_Err extends Result_COption_CustomOnionMessageContentsZDecodeErrorZ {
+ public final DecodeError err;
+ private Result_COption_CustomOnionMessageContentsZDecodeErrorZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ long err = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(ptr);
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
+ if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
+ this.err = err_hu_conv;
+ }
+ }
+
+ /**
+ * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state.
+ */
+ public static Result_COption_CustomOnionMessageContentsZDecodeErrorZ ok(Option_CustomOnionMessageContentsZ o) {
+ long ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o.ptr);
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_CustomOnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state.
+ */
+ public static Result_COption_CustomOnionMessageContentsZDecodeErrorZ err(DecodeError e) {
+ long ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e.ptr);
+ Reference.reachabilityFence(e);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_CustomOnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_COption_CustomOnionMessageContentsZDecodeErrorZ clone() {
+ long ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_COption_CustomOnionMessageContentsZDecodeErrorZ ret_hu_conv = Result_COption_CustomOnionMessageContentsZDecodeErrorZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
private Result_COption_EventZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_COption_EventZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_COption_EventZDecodeErrorZ in the error state.
*/
public static Result_COption_EventZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_COption_EventZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_COption_EventZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_EventZDecodeErrorZ ret_hu_conv = Result_COption_EventZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_COption_HTLCDestinationZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state.
*/
public static Result_COption_HTLCDestinationZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_COption_HTLCDestinationZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_COption_HTLCDestinationZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_HTLCDestinationZDecodeErrorZ ret_hu_conv = Result_COption_HTLCDestinationZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_COption_MonitorEventZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_COption_MonitorEventZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state.
*/
public static Result_COption_MonitorEventZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_MonitorEventZDecodeErrorZ ret_hu_conv = Result_COption_MonitorEventZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_COption_NetworkUpdateZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state.
*/
public static Result_COption_NetworkUpdateZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_NetworkUpdateZDecodeErrorZ ret_hu_conv = Result_COption_NetworkUpdateZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_COption_TypeZDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_COption_TypeZDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_COption_TypeZDecodeErrorZ in the error state.
*/
public static Result_COption_TypeZDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_COption_TypeZDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_COption_TypeZDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_COption_TypeZDecodeErrorZ ret_hu_conv = Result_COption_TypeZDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelAnnouncementDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state.
*/
public static Result_ChannelAnnouncementDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelConfigDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelConfigDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelConfigDecodeErrorZ in the error state.
*/
public static Result_ChannelConfigDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelCounterpartyDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelCounterpartyDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state.
*/
public static Result_ChannelCounterpartyDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelCounterpartyDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelCounterpartyDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelDetailsDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelDetailsDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state.
*/
public static Result_ChannelDetailsDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelDetailsDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelDetailsDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelFeaturesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state.
*/
public static Result_ChannelFeaturesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelInfoDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelInfoDecodeErrorZ in the error state.
*/
public static Result_ChannelInfoDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelMonitorUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state.
*/
public static Result_ChannelMonitorUpdateDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelPublicKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelPublicKeysDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state.
*/
public static Result_ChannelPublicKeysDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelReadyDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelReadyDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelReadyDecodeErrorZ in the error state.
*/
public static Result_ChannelReadyDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelReadyDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelReadyDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelReestablishDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelReestablishDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state.
*/
public static Result_ChannelReestablishDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state.
*/
public static Result_ChannelTransactionParametersDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelTypeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state.
*/
public static Result_ChannelTypeFeaturesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelUpdateDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state.
*/
public static Result_ChannelUpdateDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ChannelUpdateInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state.
*/
public static Result_ChannelUpdateInfoDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ClosingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ClosingSignedDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ClosingSignedDecodeErrorZ in the error state.
*/
public static Result_ClosingSignedDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ClosingSignedFeeRangeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state.
*/
public static Result_ClosingSignedFeeRangeDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_CommitmentSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_CommitmentSignedDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state.
*/
public static Result_CommitmentSignedDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_CommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_CommitmentTransactionDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state.
*/
public static Result_CommitmentTransactionDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_CounterpartyChannelTransactionParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state.
*/
public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_CounterpartyCommitmentSecretsDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state.
*/
public static Result_CounterpartyCommitmentSecretsDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_CounterpartyForwardingInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state.
*/
public static Result_CounterpartyForwardingInfoDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_DelayedPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state.
*/
public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ErrorMessageDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ErrorMessageDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ErrorMessageDecodeErrorZ in the error state.
*/
public static Result_ErrorMessageDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_FixedPenaltyScorerDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state.
*/
public static Result_FixedPenaltyScorerDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_FundingCreatedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_FundingCreatedDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_FundingCreatedDecodeErrorZ in the error state.
*/
public static Result_FundingCreatedDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_FundingSignedDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_FundingSignedDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_FundingSignedDecodeErrorZ in the error state.
*/
public static Result_FundingSignedDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_GossipTimestampFilterDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_GossipTimestampFilterDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state.
*/
public static Result_GossipTimestampFilterDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_HTLCOutputInCommitmentDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state.
*/
public static Result_HTLCOutputInCommitmentDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_HTLCUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_HTLCUpdateDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state.
*/
public static Result_HTLCUpdateDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_HolderCommitmentTransactionDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state.
*/
public static Result_HolderCommitmentTransactionDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_InFlightHtlcsDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_InFlightHtlcsDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state.
*/
public static Result_InFlightHtlcsDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_InMemorySignerDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_InMemorySignerDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_InMemorySignerDecodeErrorZ in the error state.
*/
public static Result_InMemorySignerDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_InitDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_InitDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_InitDecodeErrorZ in the error state.
*/
public static Result_InitDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_InitDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_InitDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_InitFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_InitFeaturesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_InitFeaturesDecodeErrorZ in the error state.
*/
public static Result_InitFeaturesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_InvoiceFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_InvoiceFeaturesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state.
*/
public static Result_InvoiceFeaturesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NetAddressDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NetAddressDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NetAddressDecodeErrorZ in the error state.
*/
public static Result_NetAddressDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NetAddressDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NetAddressDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NetworkGraphDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NetworkGraphDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NetworkGraphDecodeErrorZ in the error state.
*/
public static Result_NetworkGraphDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NodeAliasDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NodeAliasDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NodeAliasDecodeErrorZ in the error state.
*/
public static Result_NodeAliasDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NodeAliasDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NodeAliasDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NodeAnnouncementDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state.
*/
public static Result_NodeAnnouncementDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NodeAnnouncementInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state.
*/
public static Result_NodeAnnouncementInfoDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NodeFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NodeFeaturesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state.
*/
public static Result_NodeFeaturesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NodeIdDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NodeIdDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NodeIdDecodeErrorZ in the error state.
*/
public static Result_NodeIdDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NodeIdDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NodeIdDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_NodeInfoDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_NodeInfoDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_NodeInfoDecodeErrorZ in the error state.
*/
public static Result_NodeInfoDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
+++ /dev/null
-package org.ldk.structs;
-
-import org.ldk.impl.bindings;
-import org.ldk.enums.*;
-import org.ldk.util.*;
-import java.util.Arrays;
-import java.lang.ref.Reference;
-import javax.annotation.Nullable;
-
-public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
- private Result_NoneChannelMonitorUpdateErrZ(Object _dummy, long ptr) { super(ptr); }
- protected void finalize() throws Throwable {
- if (ptr != 0) { bindings.CResult_NoneChannelMonitorUpdateErrZ_free(ptr); } super.finalize();
- }
-
- static Result_NoneChannelMonitorUpdateErrZ constr_from_ptr(long ptr) {
- if (bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(ptr)) {
- return new Result_NoneChannelMonitorUpdateErrZ_OK(null, ptr);
- } else {
- return new Result_NoneChannelMonitorUpdateErrZ_Err(null, ptr);
- }
- }
- public static final class Result_NoneChannelMonitorUpdateErrZ_OK extends Result_NoneChannelMonitorUpdateErrZ {
- private Result_NoneChannelMonitorUpdateErrZ_OK(Object _dummy, long ptr) {
- super(_dummy, ptr);
- }
- }
-
- public static final class Result_NoneChannelMonitorUpdateErrZ_Err extends Result_NoneChannelMonitorUpdateErrZ {
- public final ChannelMonitorUpdateErr err;
- private Result_NoneChannelMonitorUpdateErrZ_Err(Object _dummy, long ptr) {
- super(_dummy, ptr);
- this.err = bindings.CResult_NoneChannelMonitorUpdateErrZ_get_err(ptr);
- }
- }
-
- /**
- * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the success state.
- */
- public static Result_NoneChannelMonitorUpdateErrZ ok() {
- long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
- */
- public static Result_NoneChannelMonitorUpdateErrZ err(org.ldk.enums.ChannelMonitorUpdateErr e) {
- long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e);
- Reference.reachabilityFence(e);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
- /**
- * Checks if the given object is currently in the success state
- */
- public boolean is_ok() {
- boolean ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_is_ok(this.ptr);
- Reference.reachabilityFence(this);
- return ret;
- }
-
- long clone_ptr() {
- long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(this.ptr);
- Reference.reachabilityFence(this);
- return ret;
- }
-
- /**
- * Creates a new CResult_NoneChannelMonitorUpdateErrZ which has the same data as `orig`
- * but with all dynamically-allocated buffers duplicated in new buffers.
- */
- public Result_NoneChannelMonitorUpdateErrZ clone() {
- long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr);
- Reference.reachabilityFence(this);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
- return ret_hu_conv;
- }
-
-}
private Result_OnionMessageDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_OnionMessageDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_OnionMessageDecodeErrorZ in the error state.
*/
public static Result_OnionMessageDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_OnionMessageDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_OnionMessageDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_OpenChannelDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_OpenChannelDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_OpenChannelDecodeErrorZ in the error state.
*/
public static Result_OpenChannelDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_OutPointDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_OutPointDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_OutPointDecodeErrorZ in the error state.
*/
public static Result_OutPointDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_OutPointDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_OutPointDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_PaymentParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_PaymentParametersDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_PaymentParametersDecodeErrorZ in the error state.
*/
public static Result_PaymentParametersDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_PaymentParametersDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_PaymentParametersDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_PaymentPurposeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_PaymentPurposeDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state.
*/
public static Result_PaymentPurposeDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PaymentPurposeDecodeErrorZ ret_hu_conv = Result_PaymentPurposeDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_PhantomRouteHintsDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_PhantomRouteHintsDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state.
*/
public static Result_PhantomRouteHintsDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_PhantomRouteHintsDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_PhantomRouteHintsDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_PingDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_PingDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_PingDecodeErrorZ in the error state.
*/
public static Result_PingDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_PingDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_PingDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_PongDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_PongDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_PongDecodeErrorZ in the error state.
*/
public static Result_PongDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_PongDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_PongDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ProbabilisticScorerDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ProbabilisticScorerDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state.
*/
public static Result_ProbabilisticScorerDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ProbabilisticScorerDecodeErrorZ ret_hu_conv = Result_ProbabilisticScorerDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
--- /dev/null
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+import java.lang.ref.Reference;
+import javax.annotation.Nullable;
+
+public class Result_PublicKeyNoneZ extends CommonBase {
+ private Result_PublicKeyNoneZ(Object _dummy, long ptr) { super(ptr); }
+ protected void finalize() throws Throwable {
+ if (ptr != 0) { bindings.CResult_PublicKeyNoneZ_free(ptr); } super.finalize();
+ }
+
+ static Result_PublicKeyNoneZ constr_from_ptr(long ptr) {
+ if (bindings.CResult_PublicKeyNoneZ_is_ok(ptr)) {
+ return new Result_PublicKeyNoneZ_OK(null, ptr);
+ } else {
+ return new Result_PublicKeyNoneZ_Err(null, ptr);
+ }
+ }
+ public static final class Result_PublicKeyNoneZ_OK extends Result_PublicKeyNoneZ {
+ public final byte[] res;
+ private Result_PublicKeyNoneZ_OK(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ this.res = bindings.CResult_PublicKeyNoneZ_get_ok(ptr);
+ }
+ }
+
+ public static final class Result_PublicKeyNoneZ_Err extends Result_PublicKeyNoneZ {
+ private Result_PublicKeyNoneZ_Err(Object _dummy, long ptr) {
+ super(_dummy, ptr);
+ }
+ }
+
+ /**
+ * Creates a new CResult_PublicKeyNoneZ in the success state.
+ */
+ public static Result_PublicKeyNoneZ ok(byte[] o) {
+ long ret = bindings.CResult_PublicKeyNoneZ_ok(InternalUtils.check_arr_len(o, 33));
+ Reference.reachabilityFence(o);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Creates a new CResult_PublicKeyNoneZ in the error state.
+ */
+ public static Result_PublicKeyNoneZ err() {
+ long ret = bindings.CResult_PublicKeyNoneZ_err();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+ /**
+ * Checks if the given object is currently in the success state
+ */
+ public boolean is_ok() {
+ boolean ret = bindings.CResult_PublicKeyNoneZ_is_ok(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ long clone_ptr() {
+ long ret = bindings.CResult_PublicKeyNoneZ_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
+ /**
+ * Creates a new CResult_PublicKeyNoneZ which has the same data as `orig`
+ * but with all dynamically-allocated buffers duplicated in new buffers.
+ */
+ public Result_PublicKeyNoneZ clone() {
+ long ret = bindings.CResult_PublicKeyNoneZ_clone(this.ptr);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_PublicKeyNoneZ ret_hu_conv = Result_PublicKeyNoneZ.constr_from_ptr(ret);
+ return ret_hu_conv;
+ }
+
+}
private Result_QueryChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_QueryChannelRangeDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state.
*/
public static Result_QueryChannelRangeDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_QueryShortChannelIdsDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state.
*/
public static Result_QueryShortChannelIdsDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ReplyChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ReplyChannelRangeDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state.
*/
public static Result_ReplyChannelRangeDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state.
*/
public static Result_ReplyShortChannelIdsEndDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RevokeAndACKDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RevokeAndACKDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state.
*/
public static Result_RevokeAndACKDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RouteDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RouteDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RouteDecodeErrorZ in the error state.
*/
public static Result_RouteDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RouteDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RouteDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RouteHintDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RouteHintDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RouteHintDecodeErrorZ in the error state.
*/
public static Result_RouteHintDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RouteHintDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RouteHintDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RouteHintHopDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RouteHintHopDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RouteHintHopDecodeErrorZ in the error state.
*/
public static Result_RouteHintHopDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RouteHintHopDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RouteHintHopDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RouteHopDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RouteHopDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RouteHopDecodeErrorZ in the error state.
*/
public static Result_RouteHopDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RouteHopDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RouteHopDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RouteParametersDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RouteParametersDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RouteParametersDecodeErrorZ in the error state.
*/
public static Result_RouteParametersDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RouteParametersDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RouteParametersDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_RoutingFeesDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_RoutingFeesDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_RoutingFeesDecodeErrorZ in the error state.
*/
public static Result_RoutingFeesDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ShutdownDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ShutdownDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ShutdownDecodeErrorZ in the error state.
*/
public static Result_ShutdownDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ShutdownDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ShutdownDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_ShutdownScriptDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_ShutdownScriptDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state.
*/
public static Result_ShutdownScriptDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_SignDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_SignDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_SignDecodeErrorZ in the error state.
*/
public static Result_SignDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_SignDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state.
*/
public static Result_SpendableOutputDescriptorDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_StaticPaymentOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state.
*/
public static Result_StaticPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_TxCreationKeysDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_TxCreationKeysDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state.
*/
public static Result_TxCreationKeysDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state.
*/
public static Result_UnsignedChannelAnnouncementDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UnsignedChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state.
*/
public static Result_UnsignedChannelUpdateDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state.
*/
public static Result_UnsignedNodeAnnouncementDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UpdateAddHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UpdateAddHTLCDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state.
*/
public static Result_UpdateAddHTLCDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UpdateFailHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UpdateFailHTLCDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state.
*/
public static Result_UpdateFailHTLCDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UpdateFailMalformedHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state.
*/
public static Result_UpdateFailMalformedHTLCDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UpdateFeeDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UpdateFeeDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UpdateFeeDecodeErrorZ in the error state.
*/
public static Result_UpdateFeeDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_UpdateFulfillHTLCDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state.
*/
public static Result_UpdateFulfillHTLCDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
private Result_WarningMessageDecodeErrorZ_Err(Object _dummy, long ptr) {
super(_dummy, ptr);
long err = bindings.CResult_WarningMessageDecodeErrorZ_get_err(ptr);
- org.ldk.structs.DecodeError err_hu_conv = null; if (err < 0 || err > 4096) { err_hu_conv = new org.ldk.structs.DecodeError(null, err); }
+ org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err);
if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); };
this.err = err_hu_conv;
}
* Creates a new CResult_WarningMessageDecodeErrorZ in the error state.
*/
public static Result_WarningMessageDecodeErrorZ err(DecodeError e) {
- long ret = bindings.CResult_WarningMessageDecodeErrorZ_err(e == null ? 0 : e.ptr);
+ long ret = bindings.CResult_WarningMessageDecodeErrorZ_err(e.ptr);
Reference.reachabilityFence(e);
if (ret >= 0 && ret <= 4096) { return null; }
Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret);
- if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(e); };
return ret_hu_conv;
}
return ret_hu_conv;
}
+ /**
+ * Checks if two RevokeAndACKs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(RevokeAndACK b) {
+ boolean ret = bindings.RevokeAndACK_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof RevokeAndACK)) return false;
+ return this.eq((RevokeAndACK)o);
+ }
/**
* Serialize the RevokeAndACK object into a byte array which can be read by RevokeAndACK_read
*/
org.ldk.structs.RouteParameters route_params_hu_conv = null; if (route_params < 0 || route_params > 4096) { route_params_hu_conv = new org.ldk.structs.RouteParameters(null, route_params); }
int first_hops_conv_16_len = first_hops.length;
ChannelDetails[] first_hops_conv_16_arr = new ChannelDetails[first_hops_conv_16_len];
- for (int q = 0; q < first_hops_conv_16_len; q++) {
- long first_hops_conv_16 = first_hops[q];
- org.ldk.structs.ChannelDetails first_hops_conv_16_hu_conv = null; if (first_hops_conv_16 < 0 || first_hops_conv_16 > 4096) { first_hops_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, first_hops_conv_16); }
- if (first_hops_conv_16_hu_conv != null) { first_hops_conv_16_hu_conv.ptrs_to.add(this); };
- first_hops_conv_16_arr[q] = first_hops_conv_16_hu_conv;
+ if (first_hops != null) {
+ for (int q = 0; q < first_hops_conv_16_len; q++) {
+ long first_hops_conv_16 = first_hops[q];
+ org.ldk.structs.ChannelDetails first_hops_conv_16_hu_conv = null; if (first_hops_conv_16 < 0 || first_hops_conv_16 > 4096) { first_hops_conv_16_hu_conv = new org.ldk.structs.ChannelDetails(null, first_hops_conv_16); }
+ if (first_hops_conv_16_hu_conv != null) { first_hops_conv_16_hu_conv.ptrs_to.add(this); };
+ first_hops_conv_16_arr[q] = first_hops_conv_16_hu_conv;
+ }
}
org.ldk.structs.InFlightHtlcs inflight_htlcs_hu_conv = null; if (inflight_htlcs < 0 || inflight_htlcs > 4096) { inflight_htlcs_hu_conv = new org.ldk.structs.InFlightHtlcs(null, inflight_htlcs); }
if (inflight_htlcs_hu_conv != null) { inflight_htlcs_hu_conv.ptrs_to.add(this); };
if (ret >= 0 && ret <= 4096) { return null; }
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(route_params); };
- for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; };
+ if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; } };
if (this != null) { this.ptrs_to.add(inflight_htlcs); };
// Due to rust's strict-ownership memory model, in some cases we need to "move"
// an object to pass exclusive ownership to the function being called.
* Called when a connection is established with a peer. This can be used to
* perform routing table synchronization using a strategy defined by the
* implementor.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
*/
- void peer_connected(byte[] their_node_id, Init init);
+ Result_NoneNoneZ peer_connected(byte[] their_node_id, Init init);
/**
* Handles the reply of a query we initiated to learn about channels
* for a given range of blocks. We can expect to receive one or more
long result = ret == null ? 0 : ret.clone_ptr();
return result;
}
- @Override public void peer_connected(byte[] their_node_id, long init) {
+ @Override public long peer_connected(byte[] their_node_id, long init) {
org.ldk.structs.Init init_hu_conv = null; if (init < 0 || init > 4096) { init_hu_conv = new org.ldk.structs.Init(null, init); }
- arg.peer_connected(their_node_id, init_hu_conv);
+ Result_NoneNoneZ ret = arg.peer_connected(their_node_id, init_hu_conv);
Reference.reachabilityFence(arg);
+ long result = ret == null ? 0 : ret.clone_ptr();
+ return result;
}
@Override public long handle_reply_channel_range(byte[] their_node_id, long msg) {
org.ldk.structs.ReplyChannelRange msg_hu_conv = null; if (msg < 0 || msg > 4096) { msg_hu_conv = new org.ldk.structs.ReplyChannelRange(null, msg); }
* Called when a connection is established with a peer. This can be used to
* perform routing table synchronization using a strategy defined by the
* implementor.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
*/
- public void peer_connected(byte[] their_node_id, Init init) {
- bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr);
+ public Result_NoneNoneZ peer_connected(byte[] their_node_id, Init init) {
+ long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(their_node_id);
Reference.reachabilityFence(init);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(init); };
+ return ret_hu_conv;
}
/**
/**
* Errors that may occur when [sending an onion message].
*
- * [sending an onion message]: OnionMessenger::send_onion_message
+ * [sending an onion message]: OnionMessenger::send_custom_onion_message
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class SendError extends CommonBase {
if (raw_val.getClass() == bindings.LDKSendError.InvalidFirstHop.class) {
return new InvalidFirstHop(ptr, (bindings.LDKSendError.InvalidFirstHop)raw_val);
}
+ if (raw_val.getClass() == bindings.LDKSendError.InvalidMessage.class) {
+ return new InvalidMessage(ptr, (bindings.LDKSendError.InvalidMessage)raw_val);
+ }
if (raw_val.getClass() == bindings.LDKSendError.BufferFull.class) {
return new BufferFull(ptr, (bindings.LDKSendError.BufferFull)raw_val);
}
super(null, ptr);
}
}
+ /**
+ * Onion message contents must have a TLV type >= 64.
+ */
+ public final static class InvalidMessage extends SendError {
+ private InvalidMessage(long ptr, bindings.LDKSendError.InvalidMessage obj) {
+ super(null, ptr);
+ }
+ }
/**
* Our next-hop peer's buffer was full or our total outbound buffer was full.
*/
return ret_hu_conv;
}
+ /**
+ * Utility method to constructs a new InvalidMessage-variant SendError
+ */
+ public static SendError invalid_message() {
+ long ret = bindings.SendError_invalid_message();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret);
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
/**
* Utility method to constructs a new BufferFull-variant SendError
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two SendErrors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(SendError b) {
+ boolean ret = bindings.SendError_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof SendError)) return false;
+ return this.eq((SendError)o);
+ }
}
return ret_hu_conv;
}
+ /**
+ * Checks if two Shutdowns contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(Shutdown b) {
+ boolean ret = bindings.Shutdown_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof Shutdown)) return false;
+ return this.eq((Shutdown)o);
+ }
/**
* Serialize the Shutdown object into a byte array which can be read by Shutdown_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two ShutdownScripts contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(ShutdownScript b) {
+ boolean ret = bindings.ShutdownScript_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof ShutdownScript)) return false;
+ return this.eq((ShutdownScript)o);
+ }
/**
* Serialize the ShutdownScript object into a byte array which can be read by ShutdownScript_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two SpendableOutputDescriptors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ */
+ public boolean eq(SpendableOutputDescriptor b) {
+ boolean ret = bindings.SpendableOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof SpendableOutputDescriptor)) return false;
+ return this.eq((SpendableOutputDescriptor)o);
+ }
/**
* Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two StaticPaymentOutputDescriptors contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(StaticPaymentOutputDescriptor b) {
+ boolean ret = bindings.StaticPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof StaticPaymentOutputDescriptor)) return false;
+ return this.eq((StaticPaymentOutputDescriptor)o);
+ }
/**
* Serialize the StaticPaymentOutputDescriptor object into a byte array which can be read by StaticPaymentOutputDescriptor_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two TxCreationKeyss contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(TxCreationKeys b) {
+ boolean ret = bindings.TxCreationKeys_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof TxCreationKeys)) return false;
+ return this.eq((TxCreationKeys)o);
+ }
long clone_ptr() {
long ret = bindings.TxCreationKeys_clone_ptr(this.ptr);
Reference.reachabilityFence(this);
return ret_hu_conv;
}
+ /**
+ * Checks if two UnsignedChannelAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UnsignedChannelAnnouncement b) {
+ boolean ret = bindings.UnsignedChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UnsignedChannelAnnouncement)) return false;
+ return this.eq((UnsignedChannelAnnouncement)o);
+ }
/**
* Serialize the UnsignedChannelAnnouncement object into a byte array which can be read by UnsignedChannelAnnouncement_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UnsignedChannelUpdates contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UnsignedChannelUpdate b) {
+ boolean ret = bindings.UnsignedChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UnsignedChannelUpdate)) return false;
+ return this.eq((UnsignedChannelUpdate)o);
+ }
/**
* Serialize the UnsignedChannelUpdate object into a byte array which can be read by UnsignedChannelUpdate_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UnsignedNodeAnnouncements contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UnsignedNodeAnnouncement b) {
+ boolean ret = bindings.UnsignedNodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UnsignedNodeAnnouncement)) return false;
+ return this.eq((UnsignedNodeAnnouncement)o);
+ }
/**
* Serialize the UnsignedNodeAnnouncement object into a byte array which can be read by UnsignedNodeAnnouncement_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UpdateAddHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UpdateAddHTLC b) {
+ boolean ret = bindings.UpdateAddHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UpdateAddHTLC)) return false;
+ return this.eq((UpdateAddHTLC)o);
+ }
/**
* Serialize the UpdateAddHTLC object into a byte array which can be read by UpdateAddHTLC_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UpdateFailHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UpdateFailHTLC b) {
+ boolean ret = bindings.UpdateFailHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UpdateFailHTLC)) return false;
+ return this.eq((UpdateFailHTLC)o);
+ }
/**
* Serialize the UpdateFailHTLC object into a byte array which can be read by UpdateFailHTLC_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UpdateFailMalformedHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UpdateFailMalformedHTLC b) {
+ boolean ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UpdateFailMalformedHTLC)) return false;
+ return this.eq((UpdateFailMalformedHTLC)o);
+ }
/**
* Serialize the UpdateFailMalformedHTLC object into a byte array which can be read by UpdateFailMalformedHTLC_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UpdateFees contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UpdateFee b) {
+ boolean ret = bindings.UpdateFee_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UpdateFee)) return false;
+ return this.eq((UpdateFee)o);
+ }
/**
* Serialize the UpdateFee object into a byte array which can be read by UpdateFee_read
*/
return ret_hu_conv;
}
+ /**
+ * Checks if two UpdateFulfillHTLCs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(UpdateFulfillHTLC b) {
+ boolean ret = bindings.UpdateFulfillHTLC_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof UpdateFulfillHTLC)) return false;
+ return this.eq((UpdateFulfillHTLC)o);
+ }
/**
* Serialize the UpdateFulfillHTLC object into a byte array which can be read by UpdateFulfillHTLC_read
*/
return ret_hu_conv;
}
+ /**
+ * Fetches the set of [`NodeFeatures`] flags which are provided by or required by
+ * [`ChannelManager`].
+ */
+ public static NodeFeatures provided_node_features() {
+ long ret = bindings.provided_node_features();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.NodeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeFeatures(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Fetches the set of [`ChannelFeatures`] flags which are provided by or required by
+ * [`ChannelManager`].
+ */
+ public static ChannelFeatures provided_channel_features() {
+ long ret = bindings.provided_channel_features();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
+ /**
+ * Fetches the set of [`InitFeatures`] flags which are provided by or required by
+ * [`ChannelManager`].
+ */
+ public static InitFeatures provided_init_features() {
+ long ret = bindings.provided_init_features();
+ if (ret >= 0 && ret <= 4096) { return null; }
+ org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); }
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); };
+ return ret_hu_conv;
+ }
+
/**
* Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
*/
Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(route_params); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(network_graph); };
- for (ChannelDetails first_hops_conv_16: first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); }; };
+ if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(first_hops_conv_16); }; } };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); };
return ret_hu_conv;
*
* 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(Option_u64Z amt_msat, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, org.ldk.enums.Currency network) {
- 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, keys_manager == null ? 0 : keys_manager.ptr, network);
+ public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(Option_u64Z amt_msat, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network) {
+ 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, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(payment_hash);
Reference.reachabilityFence(description);
Reference.reachabilityFence(invoice_expiry_delta_secs);
Reference.reachabilityFence(phantom_route_hints);
Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(logger);
Reference.reachabilityFence(network);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
for (PhantomRouteHints phantom_route_hints_conv_19: phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(phantom_route_hints_conv_19); }; };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
return ret_hu_conv;
}
*
* 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(Option_u64Z amt_msat, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, org.ldk.enums.Currency network) {
- 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, keys_manager == null ? 0 : keys_manager.ptr, network);
+ public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(Option_u64Z amt_msat, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network) {
+ 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, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(payment_hash);
Reference.reachabilityFence(invoice_expiry_delta_secs);
Reference.reachabilityFence(description_hash);
Reference.reachabilityFence(phantom_route_hints);
Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(logger);
Reference.reachabilityFence(network);
if (ret >= 0 && ret <= 4096) { return null; }
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(description_hash); };
for (PhantomRouteHints phantom_route_hints_conv_19: phantom_route_hints) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(phantom_route_hints_conv_19); }; };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
return ret_hu_conv;
}
* `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
* in excess of the current time.
*/
- public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs) {
- long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs);
+ public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs) {
+ long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(logger);
Reference.reachabilityFence(network);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(description);
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
return ret_hu_conv;
}
* `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for
* in excess of the current time.
*/
- public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, int invoice_expiry_delta_secs) {
- long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs);
+ public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(ChannelManager channelmanager, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, int invoice_expiry_delta_secs) {
+ long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(logger);
Reference.reachabilityFence(network);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(description_hash);
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(description_hash); };
return ret_hu_conv;
}
* This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
* 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(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs) {
- long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs);
+ public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs) {
+ long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(logger);
Reference.reachabilityFence(network);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(description_hash);
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(description_hash); };
return ret_hu_conv;
}
* This version can be used in a `no_std` environment, where [`std::time::SystemTime`] is not
* available and the current time is supplied by the caller.
*/
- public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs) {
- long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs);
+ public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(ChannelManager channelmanager, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs) {
+ long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs);
Reference.reachabilityFence(channelmanager);
Reference.reachabilityFence(keys_manager);
+ Reference.reachabilityFence(logger);
Reference.reachabilityFence(network);
Reference.reachabilityFence(amt_msat);
Reference.reachabilityFence(description);
Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); };
if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); };
+ if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); };
return ret_hu_conv;
}
return ret_hu_conv;
}
+ /**
+ * Checks if two WarningMessages contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(WarningMessage b) {
+ boolean ret = bindings.WarningMessage_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof WarningMessage)) return false;
+ return this.eq((WarningMessage)o);
+ }
/**
* Serialize the WarningMessage object into a byte array which can be read by WarningMessage_read
*/
* If an implementation maintains multiple instances of a channel's monitor (e.g., by storing
* backup copies), then it must ensure that updates are applied across all instances. Otherwise, it
* could result in a revoked transaction being broadcast, allowing the counterparty to claim all
- * funds in the channel. See [`ChannelMonitorUpdateErr`] for more details about how to handle
+ * funds in the channel. See [`ChannelMonitorUpdateStatus`] for more details about how to handle
* multiple instances.
*
- * [`PermanentFailure`]: ChannelMonitorUpdateErr::PermanentFailure
+ * [`PermanentFailure`]: ChannelMonitorUpdateStatus::PermanentFailure
*/
@SuppressWarnings("unchecked") // We correctly assign various generic arrays
public class Watch extends CommonBase {
* with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
* calling [`block_connected`] and [`block_disconnected`] on the monitor.
*
- * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
+ * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
* the given `funding_txo` has previously been registered via `watch_channel`.
*
* [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
* [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
* [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
*/
- Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor);
+ ChannelMonitorUpdateStatus watch_channel(OutPoint funding_txo, ChannelMonitor monitor);
/**
* Updates a channel identified by `funding_txo` by applying `update` to its monitor.
*
* Implementations must call [`update_monitor`] with the given update. See
- * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
+ * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
*
* [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
*/
- Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update);
+ ChannelMonitorUpdateStatus update_channel(OutPoint funding_txo, ChannelMonitorUpdate update);
/**
* Returns any monitor events since the last call. Subsequent calls must only return new
* events.
* to disk.
*
* For details on asynchronous [`ChannelMonitor`] updating and returning
- * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
*/
ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] release_pending_monitor_events();
}
public static Watch new_impl(WatchInterface arg) {
final LDKWatchHolder impl_holder = new LDKWatchHolder();
impl_holder.held = new Watch(new bindings.LDKWatch() {
- @Override public long watch_channel(long funding_txo, long monitor) {
+ @Override public ChannelMonitorUpdateStatus watch_channel(long funding_txo, long monitor) {
org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); }
if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.add(this); };
org.ldk.structs.ChannelMonitor monitor_hu_conv = null; if (monitor < 0 || monitor > 4096) { monitor_hu_conv = new org.ldk.structs.ChannelMonitor(null, monitor); }
if (monitor_hu_conv != null) { monitor_hu_conv.ptrs_to.add(this); };
- Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv);
+ ChannelMonitorUpdateStatus ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv);
Reference.reachabilityFence(arg);
- long result = ret == null ? 0 : ret.clone_ptr();
- return result;
+ return ret;
}
- @Override public long update_channel(long funding_txo, long update) {
+ @Override public ChannelMonitorUpdateStatus update_channel(long funding_txo, long update) {
org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); }
if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.add(this); };
org.ldk.structs.ChannelMonitorUpdate update_hu_conv = null; if (update < 0 || update > 4096) { update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, update); }
if (update_hu_conv != null) { update_hu_conv.ptrs_to.add(this); };
- Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv);
+ ChannelMonitorUpdateStatus ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv);
Reference.reachabilityFence(arg);
- long result = ret == null ? 0 : ret.clone_ptr();
- return result;
+ return ret;
}
@Override public long[] release_pending_monitor_events() {
ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] ret = arg.release_pending_monitor_events();
* with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
* calling [`block_connected`] and [`block_disconnected`] on the monitor.
*
- * Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
+ * Note: this interface MUST error with [`ChannelMonitorUpdateStatus::PermanentFailure`] if
* the given `funding_txo` has previously been registered via `watch_channel`.
*
* [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
* [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
* [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
*/
- public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) {
- long ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, monitor == null ? 0 : monitor.ptr);
+ public ChannelMonitorUpdateStatus watch_channel(OutPoint funding_txo, ChannelMonitor monitor) {
+ ChannelMonitorUpdateStatus ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, monitor == null ? 0 : monitor.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(funding_txo);
Reference.reachabilityFence(monitor);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(funding_txo); };
if (this != null) { this.ptrs_to.add(monitor); };
- return ret_hu_conv;
+ return ret;
}
/**
* Updates a channel identified by `funding_txo` by applying `update` to its monitor.
*
* Implementations must call [`update_monitor`] with the given update. See
- * [`ChannelMonitorUpdateErr`] for invariants around returning an error.
+ * [`ChannelMonitorUpdateStatus`] for invariants around returning an error.
*
* [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor
*/
- public Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) {
- long ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, update == null ? 0 : update.ptr);
+ public ChannelMonitorUpdateStatus update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) {
+ ChannelMonitorUpdateStatus ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, update == null ? 0 : update.ptr);
Reference.reachabilityFence(this);
Reference.reachabilityFence(funding_txo);
Reference.reachabilityFence(update);
- if (ret >= 0 && ret <= 4096) { return null; }
- Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
if (this != null) { this.ptrs_to.add(funding_txo); };
if (this != null) { this.ptrs_to.add(update); };
- return ret_hu_conv;
+ return ret;
}
/**
* to disk.
*
* For details on asynchronous [`ChannelMonitor`] updating and returning
- * [`MonitorEvent::UpdateCompleted`] here, see [`ChannelMonitorUpdateErr::TemporaryFailure`].
+ * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
*/
public ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] release_pending_monitor_events() {
long[] ret = bindings.Watch_release_pending_monitor_events(this.ptr);
return ret_hu_conv;
}
+ /**
+ * Checks if two WatchedOutputs contain equal inner contents.
+ * This ignores pointers and is_owned flags and looks at the values in fields.
+ * Two objects with NULL inner values will be considered "equal" here.
+ */
+ public boolean eq(WatchedOutput b) {
+ boolean ret = bindings.WatchedOutput_eq(this.ptr, b == null ? 0 : b.ptr);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(b);
+ if (this != null) { this.ptrs_to.add(b); };
+ return ret;
+ }
+
+ @Override public boolean equals(Object o) {
+ if (!(o instanceof WatchedOutput)) return false;
+ return this.eq((WatchedOutput)o);
+ }
/**
* Checks if two WatchedOutputs contain equal inner contents.
*/
}
}
-static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass clz) {
+static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_java(JNIEnv *env, jclass clz) {
jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
- (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust threw an exception.");
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust threw an exception.");
}
switch (ord) {
- case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
- case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
+ case 0: return LDKChannelMonitorUpdateStatus_Completed;
+ case 1: return LDKChannelMonitorUpdateStatus_InProgress;
+ case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
}
- (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust returned an invalid value.");
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust returned an invalid value.");
abort(); // Unreachable, but will let the compiler know we don't return here
}
-static jclass ChannelMonitorUpdateErr_class = NULL;
-static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
-static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = NULL;
-JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateErr_init (JNIEnv *env, jclass clz) {
- ChannelMonitorUpdateErr_class = (*env)->NewGlobalRef(env, clz);
- CHECK(ChannelMonitorUpdateErr_class != NULL);
- ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/enums/ChannelMonitorUpdateErr;");
- CHECK(ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure != NULL);
- ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateErr;");
- CHECK(ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure != NULL);
-}
-static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
+static jclass ChannelMonitorUpdateStatus_class = NULL;
+static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = NULL;
+static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = NULL;
+static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateStatus_init (JNIEnv *env, jclass clz) {
+ ChannelMonitorUpdateStatus_class = (*env)->NewGlobalRef(env, clz);
+ CHECK(ChannelMonitorUpdateStatus_class != NULL);
+ ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_Completed", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
+ CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed != NULL);
+ ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_InProgress", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
+ CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress != NULL);
+ ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
+ CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure != NULL);
+}
+static inline jclass LDKChannelMonitorUpdateStatus_to_java(JNIEnv *env, LDKChannelMonitorUpdateStatus val) {
switch (val) {
- case LDKChannelMonitorUpdateErr_TemporaryFailure:
- return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateErr_class, ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure);
- case LDKChannelMonitorUpdateErr_PermanentFailure:
- return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateErr_class, ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure);
+ case LDKChannelMonitorUpdateStatus_Completed:
+ return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed);
+ case LDKChannelMonitorUpdateStatus_InProgress:
+ return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress);
+ case LDKChannelMonitorUpdateStatus_PermanentFailure:
+ return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure);
default: abort();
}
}
CResult_BlindedRouteNoneZ_get_err(owner_conv);
}
+static jclass LDKDecodeError_UnknownVersion_class = NULL;
+static jmethodID LDKDecodeError_UnknownVersion_meth = NULL;
+static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL;
+static jmethodID LDKDecodeError_UnknownRequiredFeature_meth = NULL;
+static jclass LDKDecodeError_InvalidValue_class = NULL;
+static jmethodID LDKDecodeError_InvalidValue_meth = NULL;
+static jclass LDKDecodeError_ShortRead_class = NULL;
+static jmethodID LDKDecodeError_ShortRead_meth = NULL;
+static jclass LDKDecodeError_BadLengthDescriptor_class = NULL;
+static jmethodID LDKDecodeError_BadLengthDescriptor_meth = NULL;
+static jclass LDKDecodeError_Io_class = NULL;
+static jmethodID LDKDecodeError_Io_meth = NULL;
+static jclass LDKDecodeError_UnsupportedCompression_class = NULL;
+static jmethodID LDKDecodeError_UnsupportedCompression_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDecodeError_init (JNIEnv *env, jclass clz) {
+ LDKDecodeError_UnknownVersion_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownVersion"));
+ CHECK(LDKDecodeError_UnknownVersion_class != NULL);
+ LDKDecodeError_UnknownVersion_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownVersion_class, "<init>", "()V");
+ CHECK(LDKDecodeError_UnknownVersion_meth != NULL);
+ LDKDecodeError_UnknownRequiredFeature_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownRequiredFeature"));
+ CHECK(LDKDecodeError_UnknownRequiredFeature_class != NULL);
+ LDKDecodeError_UnknownRequiredFeature_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownRequiredFeature_class, "<init>", "()V");
+ CHECK(LDKDecodeError_UnknownRequiredFeature_meth != NULL);
+ LDKDecodeError_InvalidValue_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$InvalidValue"));
+ CHECK(LDKDecodeError_InvalidValue_class != NULL);
+ LDKDecodeError_InvalidValue_meth = (*env)->GetMethodID(env, LDKDecodeError_InvalidValue_class, "<init>", "()V");
+ CHECK(LDKDecodeError_InvalidValue_meth != NULL);
+ LDKDecodeError_ShortRead_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$ShortRead"));
+ CHECK(LDKDecodeError_ShortRead_class != NULL);
+ LDKDecodeError_ShortRead_meth = (*env)->GetMethodID(env, LDKDecodeError_ShortRead_class, "<init>", "()V");
+ CHECK(LDKDecodeError_ShortRead_meth != NULL);
+ LDKDecodeError_BadLengthDescriptor_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$BadLengthDescriptor"));
+ CHECK(LDKDecodeError_BadLengthDescriptor_class != NULL);
+ LDKDecodeError_BadLengthDescriptor_meth = (*env)->GetMethodID(env, LDKDecodeError_BadLengthDescriptor_class, "<init>", "()V");
+ CHECK(LDKDecodeError_BadLengthDescriptor_meth != NULL);
+ LDKDecodeError_Io_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$Io"));
+ CHECK(LDKDecodeError_Io_class != NULL);
+ LDKDecodeError_Io_meth = (*env)->GetMethodID(env, LDKDecodeError_Io_class, "<init>", "(Lorg/ldk/enums/IOError;)V");
+ CHECK(LDKDecodeError_Io_meth != NULL);
+ LDKDecodeError_UnsupportedCompression_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnsupportedCompression"));
+ CHECK(LDKDecodeError_UnsupportedCompression_class != NULL);
+ LDKDecodeError_UnsupportedCompression_meth = (*env)->GetMethodID(env, LDKDecodeError_UnsupportedCompression_class, "<init>", "()V");
+ CHECK(LDKDecodeError_UnsupportedCompression_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKDecodeError_UnknownVersion: {
+ return (*env)->NewObject(env, LDKDecodeError_UnknownVersion_class, LDKDecodeError_UnknownVersion_meth);
+ }
+ case LDKDecodeError_UnknownRequiredFeature: {
+ return (*env)->NewObject(env, LDKDecodeError_UnknownRequiredFeature_class, LDKDecodeError_UnknownRequiredFeature_meth);
+ }
+ case LDKDecodeError_InvalidValue: {
+ return (*env)->NewObject(env, LDKDecodeError_InvalidValue_class, LDKDecodeError_InvalidValue_meth);
+ }
+ case LDKDecodeError_ShortRead: {
+ return (*env)->NewObject(env, LDKDecodeError_ShortRead_class, LDKDecodeError_ShortRead_meth);
+ }
+ case LDKDecodeError_BadLengthDescriptor: {
+ return (*env)->NewObject(env, LDKDecodeError_BadLengthDescriptor_class, LDKDecodeError_BadLengthDescriptor_meth);
+ }
+ case LDKDecodeError_Io: {
+ jclass io_conv = LDKIOError_to_java(env, obj->io);
+ return (*env)->NewObject(env, LDKDecodeError_Io_class, LDKDecodeError_Io_meth, io_conv);
+ }
+ case LDKDecodeError_UnsupportedCompression: {
+ return (*env)->NewObject(env, LDKDecodeError_UnsupportedCompression_class, LDKDecodeError_UnsupportedCompression_meth);
+ }
+ default: abort();
+ }
+}
static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
LDKBlindedRoute ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
return ret;
}
-static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
- CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
-}
-
-static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
-}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
- return ret_conv;
-}
-
static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
-static jclass LDKMonitorEvent_UpdateCompleted_class = NULL;
-static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL;
+static jclass LDKMonitorEvent_Completed_class = NULL;
+static jmethodID LDKMonitorEvent_Completed_meth = NULL;
static jclass LDKMonitorEvent_UpdateFailed_class = NULL;
static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
- LDKMonitorEvent_UpdateCompleted_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted"));
- CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL);
- LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "<init>", "(JJ)V");
- CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL);
+ LDKMonitorEvent_Completed_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$Completed"));
+ CHECK(LDKMonitorEvent_Completed_class != NULL);
+ LDKMonitorEvent_Completed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_Completed_class, "<init>", "(JJ)V");
+ CHECK(LDKMonitorEvent_Completed_meth != NULL);
LDKMonitorEvent_UpdateFailed_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
}
- case LDKMonitorEvent_UpdateCompleted: {
- LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ case LDKMonitorEvent_Completed: {
+ LDKOutPoint funding_txo_var = obj->completed.funding_txo;
int64_t funding_txo_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
- int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
- return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv);
+ int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
+ return (*env)->NewObject(env, LDKMonitorEvent_Completed_class, LDKMonitorEvent_Completed_meth, funding_txo_ref, monitor_update_id_conv);
}
case LDKMonitorEvent_UpdateFailed: {
LDKOutPoint update_failed_var = obj->update_failed;
}
static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
CResult_SecretKeyNoneZ_get_err(owner_conv);
}
+static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form);
+ return ret_arr;
+}
+
+static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
+ CResult_PublicKeyNoneZ_get_err(owner_conv);
+}
+
static jclass LDKCOption_ScalarZ_Some_class = NULL;
static jmethodID LDKCOption_ScalarZ_Some_meth = NULL;
static jclass LDKCOption_ScalarZ_None_class = NULL;
jmethodID sign_justice_revoked_htlc_meth;
jmethodID sign_counterparty_htlc_transaction_meth;
jmethodID sign_closing_transaction_meth;
+ jmethodID sign_holder_anchor_input_meth;
jmethodID sign_channel_announcement_meth;
jmethodID ready_channel_meth;
} LDKBaseSign_JCalls;
}
return ret_conv;
}
+LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKBaseSign_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
+ LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKTransaction anchor_tx_var = anchor_tx;
+ int8_tArray anchor_tx_arr = (*env)->NewByteArray(env, anchor_tx_var.datalen);
+ (*env)->SetByteArrayRegion(env, anchor_tx_arr, 0, anchor_tx_var.datalen, anchor_tx_var.data);
+ Transaction_free(anchor_tx_var);
+ int64_t input_conv = input;
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_anchor_input_meth, anchor_tx_arr, input_conv);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to sign_holder_anchor_input in LDKBaseSign from rust threw an exception.");
+ }
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
JNIEnv *env;
CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
CHECK(calls->sign_closing_transaction_meth != NULL);
+ calls->sign_holder_anchor_input_meth = (*env)->GetMethodID(env, c, "sign_holder_anchor_input", "([BJ)J");
+ CHECK(calls->sign_holder_anchor_input_meth != NULL);
calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
CHECK(calls->sign_channel_announcement_meth != NULL);
calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V");
.sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
.sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
.sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
+ .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall,
.sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
.ready_channel = ready_channel_LDKBaseSign_jcall,
.free = LDKBaseSign_JCalls_free,
return tag_ptr(ret_conv, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1anchor_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray anchor_tx, int64_t input) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKTransaction anchor_tx_ref;
+ anchor_tx_ref.datalen = (*env)->GetArrayLength(env, anchor_tx);
+ anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, anchor_tx, 0, anchor_tx_ref.datalen, anchor_tx_ref.data);
+ anchor_tx_ref.data_is_owned = true;
+ LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
+ *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
}
static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_SignDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
static jmethodID LDKAPIError_RouteError_meth = NULL;
static jclass LDKAPIError_ChannelUnavailable_class = NULL;
static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
-static jclass LDKAPIError_MonitorUpdateFailed_class = NULL;
-static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL;
+static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL;
+static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL;
static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL;
static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
- LDKAPIError_MonitorUpdateFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed"));
- CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL);
- LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
- CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL);
+ LDKAPIError_MonitorUpdateInProgress_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress"));
+ CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL);
+ LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "<init>", "()V");
+ CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL);
LDKAPIError_IncompatibleShutdownScript_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv);
}
- case LDKAPIError_MonitorUpdateFailed: {
- return (*env)->NewObject(env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth);
+ case LDKAPIError_MonitorUpdateInProgress: {
+ return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth);
}
case LDKAPIError_IncompatibleShutdownScript: {
LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
}
static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
+LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
update_ref = tag_ptr(update_var.inner, update_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
+ calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->watch_channel_meth != NULL);
- calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
+ calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->update_channel_meth != NULL);
calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J");
CHECK(calls->release_pending_monitor_events_meth != NULL);
*res_ptr = LDKWatch_init(env, clz, o);
return tag_ptr(res_ptr, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
monitor_conv.is_owned = ptr_is_owned(monitor);
CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
monitor_conv = ChannelMonitor_clone(&monitor_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
+ return ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
update_conv.is_owned = ptr_is_owned(update);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
update_conv = ChannelMonitorUpdate_clone(&update_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv));
+ return ret_conv;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
JavaVM *vm;
jweak o;
jmethodID get_node_secret_meth;
+ jmethodID get_node_id_meth;
jmethodID ecdh_meth;
jmethodID get_destination_script_meth;
jmethodID get_shutdown_scriptpubkey_meth;
}
return ret_conv;
}
+LDKCResult_PublicKeyNoneZ get_node_id_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
+ LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jclass recipient_conv = LDKRecipient_to_java(env, recipient);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_id_meth, recipient_conv);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to get_node_id in LDKKeysInterface from rust threw an exception.");
+ }
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
calls->o = (*env)->NewWeakGlobalRef(env, o);
calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "(Lorg/ldk/enums/Recipient;)J");
CHECK(calls->get_node_secret_meth != NULL);
+ calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J");
+ CHECK(calls->get_node_id_meth != NULL);
calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J");
CHECK(calls->ecdh_meth != NULL);
calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B");
LDKKeysInterface ret = {
.this_arg = (void*) calls,
.get_node_secret = get_node_secret_LDKKeysInterface_jcall,
+ .get_node_id = get_node_id_LDKKeysInterface_jcall,
.ecdh = ecdh_LDKKeysInterface_jcall,
.get_destination_script = get_destination_script_LDKKeysInterface_jcall,
.get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
return tag_ptr(ret_conv, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1ecdh(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient, int8_tArray other_key, int64_t tweak) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
}
static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
return ret;
}
+typedef struct LDKCustomOnionMessageContents_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID tlv_type_meth;
+ jmethodID write_meth;
+} LDKCustomOnionMessageContents_JCalls;
+static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ FREE(j_calls);
+ }
+}
+uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->tlv_type_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to tlv_type in LDKCustomOnionMessageContents from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret;
+}
+LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to write in LDKCustomOnionMessageContents from rust threw an exception.");
+ }
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = (*env)->GetArrayLength(env, ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_ref;
+}
+static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J");
+ CHECK(calls->tlv_type_meth != NULL);
+ calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
+ CHECK(calls->write_meth != NULL);
+
+ LDKCustomOnionMessageContents ret = {
+ .this_arg = (void*) calls,
+ .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
+ .write = write_LDKCustomOnionMessageContents_jcall,
+ .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
+ .free = LDKCustomOnionMessageContents_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *res_ptr = LDKCustomOnionMessageContents_init(env, clz, o);
+ return tag_ptr(res_ptr, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
+ int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
+ return ret_conv;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+static jclass LDKCOption_CustomOnionMessageContentsZ_Some_class = NULL;
+static jmethodID LDKCOption_CustomOnionMessageContentsZ_Some_meth = NULL;
+static jclass LDKCOption_CustomOnionMessageContentsZ_None_class = NULL;
+static jmethodID LDKCOption_CustomOnionMessageContentsZ_None_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CustomOnionMessageContentsZ_init (JNIEnv *env, jclass clz) {
+ LDKCOption_CustomOnionMessageContentsZ_Some_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$Some"));
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_class != NULL);
+ LDKCOption_CustomOnionMessageContentsZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, "<init>", "(J)V");
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_meth != NULL);
+ LDKCOption_CustomOnionMessageContentsZ_None_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$None"));
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_None_class != NULL);
+ LDKCOption_CustomOnionMessageContentsZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_None_class, "<init>", "()V");
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_None_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_CustomOnionMessageContentsZ_Some: {
+ LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *some_ret = CustomOnionMessageContents_clone(&obj->some);
+ return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, LDKCOption_CustomOnionMessageContentsZ_Some_meth, tag_ptr(some_ret, true));
+ }
+ case LDKCOption_CustomOnionMessageContentsZ_None: {
+ return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_None_class, LDKCOption_CustomOnionMessageContentsZ_None_meth);
+ }
+ default: abort();
+ }
+}
+static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
static jclass LDKCOption_NetAddressZ_Some_class = NULL;
static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL;
static jclass LDKCOption_NetAddressZ_None_class = NULL;
static jmethodID LDKSendError_TooFewBlindedHops_meth = NULL;
static jclass LDKSendError_InvalidFirstHop_class = NULL;
static jmethodID LDKSendError_InvalidFirstHop_meth = NULL;
+static jclass LDKSendError_InvalidMessage_class = NULL;
+static jmethodID LDKSendError_InvalidMessage_meth = NULL;
static jclass LDKSendError_BufferFull_class = NULL;
static jmethodID LDKSendError_BufferFull_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) {
CHECK(LDKSendError_InvalidFirstHop_class != NULL);
LDKSendError_InvalidFirstHop_meth = (*env)->GetMethodID(env, LDKSendError_InvalidFirstHop_class, "<init>", "()V");
CHECK(LDKSendError_InvalidFirstHop_meth != NULL);
+ LDKSendError_InvalidMessage_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidMessage"));
+ CHECK(LDKSendError_InvalidMessage_class != NULL);
+ LDKSendError_InvalidMessage_meth = (*env)->GetMethodID(env, LDKSendError_InvalidMessage_class, "<init>", "()V");
+ CHECK(LDKSendError_InvalidMessage_meth != NULL);
LDKSendError_BufferFull_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BufferFull"));
CHECK(LDKSendError_BufferFull_class != NULL);
case LDKSendError_InvalidFirstHop: {
return (*env)->NewObject(env, LDKSendError_InvalidFirstHop_class, LDKSendError_InvalidFirstHop_meth);
}
+ case LDKSendError_InvalidMessage: {
+ return (*env)->NewObject(env, LDKSendError_InvalidMessage_class, LDKSendError_InvalidMessage_meth);
+ }
case LDKSendError_BufferFull: {
return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth);
}
LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
switch(obj->tag) {
case LDKGraphSyncError_DecodeError: {
- LDKDecodeError decode_error_var = obj->decode_error;
- int64_t decode_error_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(decode_error_var);
- decode_error_ref = tag_ptr(decode_error_var.inner, false);
+ int64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref);
}
case LDKGraphSyncError_LightningError: {
}
static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
+LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
+LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)J");
+ calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->persist_new_channel_meth != NULL);
- calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)J");
+ calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->update_persisted_channel_meth != NULL);
LDKPersist ret = {
*res_ptr = LDKPersist_init(env, clz, o);
return tag_ptr(res_ptr, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
update_id_conv.is_owned = ptr_is_owned(update_id);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
update_id_conv = MonitorUpdateId_clone(&update_id_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv));
+ return ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
update_id_conv.is_owned = ptr_is_owned(update_id);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
update_id_conv = MonitorUpdateId_clone(&update_id_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv));
+ return ret_conv;
}
typedef struct LDKChannelMessageHandler_JCalls {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
}
-void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
+LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
}
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
+ return ret_conv;
}
void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
CHECK(calls->handle_announcement_signatures_meth != NULL);
calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
CHECK(calls->peer_disconnected_meth != NULL);
- calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
+ calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
CHECK(calls->peer_connected_meth != NULL);
calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
CHECK(calls->handle_channel_reestablish_meth != NULL);
(this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ return tag_ptr(ret_conv, true);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
}
return ret_conv;
}
-void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
init_ref = tag_ptr(init_var.inner, init_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKRoutingMessageHandler from rust threw an exception.");
}
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
+ return ret_conv;
}
LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
CHECK(calls->get_next_channel_announcement_meth != NULL);
calls->get_next_node_announcement_meth = (*env)->GetMethodID(env, c, "get_next_node_announcement", "([B)J");
CHECK(calls->get_next_node_announcement_meth != NULL);
- calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
+ calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
CHECK(calls->peer_connected_meth != NULL);
calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J");
CHECK(calls->handle_reply_channel_range_meth != NULL);
return ret_ref;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
init_conv.is_owned = ptr_is_owned(init);
CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
init_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
}
-void peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
init_ref = tag_ptr(init_var.inner, init_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKOnionMessageHandler from rust threw an exception.");
}
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
+ return ret_conv;
}
void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
calls->o = (*env)->NewWeakGlobalRef(env, o);
calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V");
CHECK(calls->handle_onion_message_meth != NULL);
- calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
+ calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
CHECK(calls->peer_connected_meth != NULL);
calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
CHECK(calls->peer_disconnected_meth != NULL);
(this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
init_conv.is_owned = ptr_is_owned(init);
CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
init_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ return tag_ptr(ret_conv, true);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
return ret_arr;
}
+typedef struct LDKCustomOnionMessageHandler_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID handle_custom_message_meth;
+ jmethodID read_custom_message_meth;
+} LDKCustomOnionMessageHandler_JCalls;
+static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ FREE(j_calls);
+ }
+}
+void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *msg_ret = msg;
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ (*env)->CallVoidMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true));
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+}
+LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ int64_t message_type_conv = message_type;
+ LDKu8slice buffer_var = buffer;
+ int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
+ (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_custom_message_meth, message_type_conv, buffer_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to read_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
+ }
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
+static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)V");
+ CHECK(calls->handle_custom_message_meth != NULL);
+ calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J");
+ CHECK(calls->read_custom_message_meth != NULL);
+
+ LDKCustomOnionMessageHandler ret = {
+ .this_arg = (void*) calls,
+ .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
+ .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
+ .free = LDKCustomOnionMessageHandler_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
+ *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o);
+ return tag_ptr(res_ptr, true);
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
+ void* msg_ptr = untag_ptr(msg);
+ CHECK_ACCESS(msg_ptr);
+ LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
+ if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
+ }
+ (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1read_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message_type, int8_tArray buffer) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
+ LDKu8slice buffer_ref;
+ buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
+ buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
+ (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
+ return tag_ptr(ret_conv, true);
+}
+
typedef struct LDKSocketDescriptor_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
*ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
*ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
*ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
*ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
*ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
*ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
*ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
*ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
*ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
*ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
*ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
*ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
*ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
*ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
*ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
*ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
*ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
*ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
*ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
CVec_TxidZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
- return tag_ptr(ret_conv, true);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) {
- LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
- return ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
LDKCVec_MonitorEventZ _res_constr;
_res_constr.datalen = (*env)->GetArrayLength(env, _res);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
*ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
*ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
*ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
*ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
*ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
*ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
*ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
*ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
*ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
*ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
*ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
*ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
*ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
*ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKPublicKey o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 33);
+ (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_err();
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_PublicKeyNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) {
void* o_ptr = untag_ptr(o);
CHECK_ACCESS(o_ptr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
*ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
*ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
*ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
*ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
*ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
*ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
*ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
*ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
*ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
*ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
*ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
+ if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
+ }
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) {
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_none();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_CustomOnionMessageContentsZ_free(_res_conv);
+}
+
+static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_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_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
+ o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) {
void* o_ptr = untag_ptr(o);
CHECK_ACCESS(o_ptr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
*ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
*ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
*ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
*ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
*ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
*ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
*ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
*ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
*ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
*ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
*ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
*ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
*ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
*ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
*ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
*ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
*ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
*ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
*ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
*ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
*ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
*ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
*ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
*ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
*ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
*ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
*ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
*ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
*ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
*ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
+ LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
+ jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
+ LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
+ jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1in_1progress(JNIEnv *env, jclass clz) {
LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
- *ret_copy = APIError_monitor_update_failed();
+ *ret_copy = APIError_monitor_update_in_progress();
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_APIError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
+ LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
+ jboolean ret_conv = APIError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKBigSize this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hostname_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHostname a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHostname b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Hostname_1len(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKHostname this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelConfig a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelConfig b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
LDKChannelConfig ret_var = ChannelConfig_default();
int64_t ret_ref = 0;
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BestBlock_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKBestBlock a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKBestBlock b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) {
LDKNetwork network_conv = LDKNetwork_from_java(env, network);
LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
Confirm_free(this_ptr_conv);
}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv));
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_clone(orig_conv));
+ return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1completed(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_completed());
return ret_conv;
}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) {
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure());
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1in_1progress(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_in_progress());
return ret_conv;
}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) {
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure());
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1permanent_1failure(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_permanent_failure());
+ return ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
+ LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
+ jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
return ret_conv;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKWatchedOutput a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKWatchedOutput b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) {
LDKWatchedOutput o_conv;
o_conv.inner = untag_ptr(o);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = untag_ptr(funding_txo);
funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
funding_txo_conv = OutPoint_clone(&funding_txo_conv);
LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
+ LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
+ jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHTLCUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHTLCUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKHTLCUpdate obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKDelayedPaymentOutputDescriptor a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKDelayedPaymentOutputDescriptor b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKDelayedPaymentOutputDescriptor obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKStaticPaymentOutputDescriptor a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKStaticPaymentOutputDescriptor b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKStaticPaymentOutputDescriptor obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
+ LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
+ jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
return tag_ptr(ret_ret, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1node_1features(JNIEnv *env, jclass clz) {
+ LDKNodeFeatures ret_var = provided_node_features();
+ int64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1channel_1features(JNIEnv *env, jclass clz) {
+ LDKChannelFeatures ret_var = provided_channel_features();
+ int64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1init_1features(JNIEnv *env, jclass clz) {
+ LDKInitFeatures ret_var = provided_init_features();
+ int64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKCounterpartyForwardingInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKDecodeError this_obj_conv;
- this_obj_conv.inner = untag_ptr(this_obj);
- this_obj_conv.is_owned = ptr_is_owned(this_obj);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- DecodeError_free(this_obj_conv);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ DecodeError_free(this_ptr_conv);
}
static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
- LDKDecodeError ret_var = DecodeError_clone(arg);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_clone(arg);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKDecodeError arg_conv;
- arg_conv.inner = untag_ptr(arg);
- arg_conv.is_owned = ptr_is_owned(arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- arg_conv.is_owned = false;
- int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
+ LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
+ int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
return ret_conv;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKDecodeError orig_conv;
- orig_conv.inner = untag_ptr(orig);
- orig_conv.is_owned = ptr_is_owned(orig);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- orig_conv.is_owned = false;
- LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_clone(orig_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1version(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unknown_version();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1required_1feature(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unknown_required_feature();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1invalid_1value(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_invalid_value();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1short_1read(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_short_read();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1bad_1length_1descriptor(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_bad_length_descriptor();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1io(JNIEnv *env, jclass clz, jclass a) {
+ LDKIOError a_conv = LDKIOError_from_java(env, a);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_io(a_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unsupported_1compression(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unsupported_compression();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DecodeError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
+ LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
+ jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInit this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Init_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKInit a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKInit b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Init_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKErrorMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKErrorMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKErrorMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKWarningMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WarningMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKWarningMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKWarningMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKPing this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Ping_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKPing a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKPing b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKPong this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Pong_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKPong a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKPong b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKOpenChannel this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OpenChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKOpenChannel a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOpenChannel b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKAcceptChannel this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKAcceptChannel a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKAcceptChannel b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFundingCreated this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingCreated_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKFundingCreated a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKFundingCreated b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFundingSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKFundingSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKFundingSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelReady this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReady_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelReady a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelReady b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKShutdown this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Shutdown_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKShutdown a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKShutdown b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKClosingSignedFeeRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosingSignedFeeRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingSignedFeeRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKClosingSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosingSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateAddHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateAddHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateAddHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKOnionMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OnionMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKOnionMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOnionMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFulfillHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFulfillHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFulfillHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFailHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFailHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFailHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFailMalformedHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFailMalformedHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFailMalformedHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKCommitmentSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKCommitmentSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKCommitmentSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRevokeAndACK this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKRevokeAndACK a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKRevokeAndACK b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFee this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFee a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFee b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKDataLossProtect this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKDataLossProtect a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKDataLossProtect b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelReestablish this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelReestablish a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelReestablish b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKAnnouncementSignatures this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKAnnouncementSignatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKAnnouncementSignatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetAddress_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
+ LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
+ jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUnsignedNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedNodeAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKNodeAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUnsignedChannelAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUnsignedChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedChannelAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUnsignedChannelUpdate this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUnsignedChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedChannelUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelUpdate this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKQueryChannelRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKQueryChannelRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKQueryChannelRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKReplyChannelRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKReplyChannelRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKReplyChannelRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKQueryShortChannelIds this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKQueryShortChannelIds a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKQueryShortChannelIds b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKReplyShortChannelIdsEnd this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKReplyShortChannelIdsEnd a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKReplyShortChannelIdsEnd b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKGossipTimestampFilter this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKGossipTimestampFilter a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKGossipTimestampFilter b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKCommitmentUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKCommitmentUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return tag_ptr(ret_ret, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKIgnoringMessageHandler this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
+ *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
PeerManager_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int64_t current_time, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int32_t current_time, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) {
LDKMessageHandler message_handler_conv;
message_handler_conv.inner = untag_ptr(message_handler);
message_handler_conv.is_owned = ptr_is_owned(message_handler);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKTxCreationKeys a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKTxCreationKeys b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
int64_t ret_ref = 0;
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelPublicKeys a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelPublicKeys b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKChannelPublicKeys obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHTLCOutputInCommitment a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHTLCOutputInCommitment b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKHTLCOutputInCommitment obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_conv;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosingTransaction a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingTransaction b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
ChannelTypeFeatures_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known_1channel_1features(JNIEnv *env, jclass clz) {
- LDKInitFeatures ret_var = InitFeatures_known_channel_features();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known_1channel_1features(JNIEnv *env, jclass clz) {
- LDKNodeFeatures ret_var = NodeFeatures_known_channel_features();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_empty();
int64_t ret_ref = 0;
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) {
- LDKInitFeatures ret_var = InitFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) {
- LDKNodeFeatures ret_var = NodeFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKNodeFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) {
- LDKChannelFeatures ret_var = ChannelFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChannelFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) {
- LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInvoiceFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) {
- LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChannelTypeFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKShutdownScript a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKShutdownScript b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInvalidShutdownScript this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
+ LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
+ jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelUpdateInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelUpdateInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKChannelUpdateInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) {
LDKChannelInfo this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeAnnouncementInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAnnouncementInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeAnnouncementInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeAlias a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAlias b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeAlias obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKPublicKey _node_id_ref;
- CHECK((*env)->GetArrayLength(env, _node_id) == 33);
- (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form);
- NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
+ LDKPublicKey node_id_ref;
+ CHECK((*env)->GetArrayLength(env, node_id) == 33);
+ (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+ NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- NetworkGraph_remove_stale_channels(&this_arg_conv);
+ NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+ NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKProbabilisticScoringParameters this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_invalid_message();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) {
LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
*ret_copy = SendError_buffer_full();
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t logger) {
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
+ LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
+ jboolean ret_conv = SendError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ CustomOnionMessageHandler_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t logger, int64_t custom_handler) {
void* keys_manager_ptr = untag_ptr(keys_manager);
CHECK_ACCESS(keys_manager_ptr);
LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv);
+ void* custom_handler_ptr = untag_ptr(custom_handler);
+ CHECK_ACCESS(custom_handler_ptr);
+ LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
+ if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
+ }
+ LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv, custom_handler_conv);
int64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t reply_path) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t msg, int64_t reply_path) {
LDKOnionMessenger this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_ACCESS(destination_ptr);
LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
// WARNING: we may need a move here but no clone is available for LDKDestination
+ void* msg_ptr = untag_ptr(msg);
+ CHECK_ACCESS(msg_ptr);
+ LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
+ if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
+ }
LDKBlindedRoute reply_path_conv;
reply_path_conv.inner = untag_ptr(reply_path);
reply_path_conv.is_owned = ptr_is_owned(reply_path);
CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
reply_path_conv.is_owned = false;
LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
- *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, reply_path_conv);
+ *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv);
return tag_ptr(ret_conv, true);
}
return tag_ptr(ret_ret, true);
}
+static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
+ LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *ret_ret = CustomOnionMessageContents_clone(arg);
+ return tag_ptr(ret_ret, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ void* arg_ptr = untag_ptr(arg);
+ if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
+ LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
+ int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ void* orig_ptr = untag_ptr(orig);
+ if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
+ LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
+ LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *ret_ret = CustomOnionMessageContents_clone(orig_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ CustomOnionMessageContents_free(this_ptr_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFilesystemPersister this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
+ LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
+ jboolean ret_conv = ParseError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
+ LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
+ jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInvoice this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, int64_t logger, jclass network) {
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, network_conv);
+ *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, logger_conv, network_conv);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, int64_t logger, jclass network) {
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, network_conv);
+ *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, logger_conv, network_conv);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
LDKStr description_conv = java_to_owned_str(env, description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
description_hash_conv = Sha256_clone(&description_hash_conv);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
description_hash_conv = Sha256_clone(&description_hash_conv);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
LDKStr description_conv = java_to_owned_str(env, description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path(JNIEnv *env, jclass clz, int64_t this_arg, jstring sync_path) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) {
LDKRapidGossipSync this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKStr sync_path_conv = java_to_owned_str(env, sync_path);
+ LDKu8slice update_data_ref;
+ update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
+ update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
- *ret_conv = RapidGossipSync_sync_network_graph_with_file_path(&this_arg_conv, sync_path_conv);
+ *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
+ (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
return tag_ptr(ret_conv, true);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) {
- LDKDecodeError a_conv;
- a_conv.inner = untag_ptr(a);
- a_conv.is_owned = ptr_is_owned(a);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
- a_conv = DecodeError_clone(&a_conv);
+ void* a_ptr = untag_ptr(a);
+ CHECK_ACCESS(a_ptr);
+ LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
+ a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
*ret_copy = GraphSyncError_decode_error(a_conv);
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) {
- LDKRapidGossipSync this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKu8slice update_data_ref;
- update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
- update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
- LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
- *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
- (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
- return tag_ptr(ret_conv, true);
-}
-
}
}
-static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass clz) {
+static inline LDKChannelMonitorUpdateStatus LDKChannelMonitorUpdateStatus_from_java(JNIEnv *env, jclass clz) {
jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
- (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust threw an exception.");
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust threw an exception.");
}
switch (ord) {
- case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
- case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
+ case 0: return LDKChannelMonitorUpdateStatus_Completed;
+ case 1: return LDKChannelMonitorUpdateStatus_InProgress;
+ case 2: return LDKChannelMonitorUpdateStatus_PermanentFailure;
}
- (*env)->FatalError(env, "A call to ChannelMonitorUpdateErr.ordinal() from rust returned an invalid value.");
+ (*env)->FatalError(env, "A call to ChannelMonitorUpdateStatus.ordinal() from rust returned an invalid value.");
abort(); // Unreachable, but will let the compiler know we don't return here
}
-static jclass ChannelMonitorUpdateErr_class = NULL;
-static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
-static jfieldID ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = NULL;
-JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateErr_init (JNIEnv *env, jclass clz) {
- ChannelMonitorUpdateErr_class = (*env)->NewGlobalRef(env, clz);
- CHECK(ChannelMonitorUpdateErr_class != NULL);
- ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/enums/ChannelMonitorUpdateErr;");
- CHECK(ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure != NULL);
- ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateErr;");
- CHECK(ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure != NULL);
-}
-static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
+static jclass ChannelMonitorUpdateStatus_class = NULL;
+static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = NULL;
+static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = NULL;
+static jfieldID ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateStatus_init (JNIEnv *env, jclass clz) {
+ ChannelMonitorUpdateStatus_class = (*env)->NewGlobalRef(env, clz);
+ CHECK(ChannelMonitorUpdateStatus_class != NULL);
+ ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_Completed", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
+ CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed != NULL);
+ ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_InProgress", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
+ CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress != NULL);
+ ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure = (*env)->GetStaticFieldID(env, ChannelMonitorUpdateStatus_class, "LDKChannelMonitorUpdateStatus_PermanentFailure", "Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
+ CHECK(ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure != NULL);
+}
+static inline jclass LDKChannelMonitorUpdateStatus_to_java(JNIEnv *env, LDKChannelMonitorUpdateStatus val) {
switch (val) {
- case LDKChannelMonitorUpdateErr_TemporaryFailure:
- return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateErr_class, ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure);
- case LDKChannelMonitorUpdateErr_PermanentFailure:
- return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateErr_class, ChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure);
+ case LDKChannelMonitorUpdateStatus_Completed:
+ return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_Completed);
+ case LDKChannelMonitorUpdateStatus_InProgress:
+ return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_InProgress);
+ case LDKChannelMonitorUpdateStatus_PermanentFailure:
+ return (*env)->GetStaticObjectField(env, ChannelMonitorUpdateStatus_class, ChannelMonitorUpdateStatus_LDKChannelMonitorUpdateStatus_PermanentFailure);
default: abort();
}
}
CResult_BlindedRouteNoneZ_get_err(owner_conv);
}
+static jclass LDKDecodeError_UnknownVersion_class = NULL;
+static jmethodID LDKDecodeError_UnknownVersion_meth = NULL;
+static jclass LDKDecodeError_UnknownRequiredFeature_class = NULL;
+static jmethodID LDKDecodeError_UnknownRequiredFeature_meth = NULL;
+static jclass LDKDecodeError_InvalidValue_class = NULL;
+static jmethodID LDKDecodeError_InvalidValue_meth = NULL;
+static jclass LDKDecodeError_ShortRead_class = NULL;
+static jmethodID LDKDecodeError_ShortRead_meth = NULL;
+static jclass LDKDecodeError_BadLengthDescriptor_class = NULL;
+static jmethodID LDKDecodeError_BadLengthDescriptor_meth = NULL;
+static jclass LDKDecodeError_Io_class = NULL;
+static jmethodID LDKDecodeError_Io_meth = NULL;
+static jclass LDKDecodeError_UnsupportedCompression_class = NULL;
+static jmethodID LDKDecodeError_UnsupportedCompression_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDecodeError_init (JNIEnv *env, jclass clz) {
+ LDKDecodeError_UnknownVersion_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownVersion"));
+ CHECK(LDKDecodeError_UnknownVersion_class != NULL);
+ LDKDecodeError_UnknownVersion_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownVersion_class, "<init>", "()V");
+ CHECK(LDKDecodeError_UnknownVersion_meth != NULL);
+ LDKDecodeError_UnknownRequiredFeature_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnknownRequiredFeature"));
+ CHECK(LDKDecodeError_UnknownRequiredFeature_class != NULL);
+ LDKDecodeError_UnknownRequiredFeature_meth = (*env)->GetMethodID(env, LDKDecodeError_UnknownRequiredFeature_class, "<init>", "()V");
+ CHECK(LDKDecodeError_UnknownRequiredFeature_meth != NULL);
+ LDKDecodeError_InvalidValue_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$InvalidValue"));
+ CHECK(LDKDecodeError_InvalidValue_class != NULL);
+ LDKDecodeError_InvalidValue_meth = (*env)->GetMethodID(env, LDKDecodeError_InvalidValue_class, "<init>", "()V");
+ CHECK(LDKDecodeError_InvalidValue_meth != NULL);
+ LDKDecodeError_ShortRead_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$ShortRead"));
+ CHECK(LDKDecodeError_ShortRead_class != NULL);
+ LDKDecodeError_ShortRead_meth = (*env)->GetMethodID(env, LDKDecodeError_ShortRead_class, "<init>", "()V");
+ CHECK(LDKDecodeError_ShortRead_meth != NULL);
+ LDKDecodeError_BadLengthDescriptor_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$BadLengthDescriptor"));
+ CHECK(LDKDecodeError_BadLengthDescriptor_class != NULL);
+ LDKDecodeError_BadLengthDescriptor_meth = (*env)->GetMethodID(env, LDKDecodeError_BadLengthDescriptor_class, "<init>", "()V");
+ CHECK(LDKDecodeError_BadLengthDescriptor_meth != NULL);
+ LDKDecodeError_Io_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$Io"));
+ CHECK(LDKDecodeError_Io_class != NULL);
+ LDKDecodeError_Io_meth = (*env)->GetMethodID(env, LDKDecodeError_Io_class, "<init>", "(Lorg/ldk/enums/IOError;)V");
+ CHECK(LDKDecodeError_Io_meth != NULL);
+ LDKDecodeError_UnsupportedCompression_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDecodeError$UnsupportedCompression"));
+ CHECK(LDKDecodeError_UnsupportedCompression_class != NULL);
+ LDKDecodeError_UnsupportedCompression_meth = (*env)->GetMethodID(env, LDKDecodeError_UnsupportedCompression_class, "<init>", "()V");
+ CHECK(LDKDecodeError_UnsupportedCompression_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKDecodeError *obj = (LDKDecodeError*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKDecodeError_UnknownVersion: {
+ return (*env)->NewObject(env, LDKDecodeError_UnknownVersion_class, LDKDecodeError_UnknownVersion_meth);
+ }
+ case LDKDecodeError_UnknownRequiredFeature: {
+ return (*env)->NewObject(env, LDKDecodeError_UnknownRequiredFeature_class, LDKDecodeError_UnknownRequiredFeature_meth);
+ }
+ case LDKDecodeError_InvalidValue: {
+ return (*env)->NewObject(env, LDKDecodeError_InvalidValue_class, LDKDecodeError_InvalidValue_meth);
+ }
+ case LDKDecodeError_ShortRead: {
+ return (*env)->NewObject(env, LDKDecodeError_ShortRead_class, LDKDecodeError_ShortRead_meth);
+ }
+ case LDKDecodeError_BadLengthDescriptor: {
+ return (*env)->NewObject(env, LDKDecodeError_BadLengthDescriptor_class, LDKDecodeError_BadLengthDescriptor_meth);
+ }
+ case LDKDecodeError_Io: {
+ jclass io_conv = LDKIOError_to_java(env, obj->io);
+ return (*env)->NewObject(env, LDKDecodeError_Io_class, LDKDecodeError_Io_meth, io_conv);
+ }
+ case LDKDecodeError_UnsupportedCompression: {
+ return (*env)->NewObject(env, LDKDecodeError_UnsupportedCompression_class, LDKDecodeError_UnsupportedCompression_meth);
+ }
+ default: abort();
+ }
+}
static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
LDKBlindedRoute ret = *owner->contents.result;
ret.is_owned = false;
}
static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
return ret;
}
-static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
-CHECK(owner->result_ok);
- return *owner->contents.result;
-}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
- CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
-}
-
-static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
-CHECK(!owner->result_ok);
- return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
-}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
- return ret_conv;
-}
-
static jclass LDKMonitorEvent_HTLCEvent_class = NULL;
static jmethodID LDKMonitorEvent_HTLCEvent_meth = NULL;
static jclass LDKMonitorEvent_CommitmentTxConfirmed_class = NULL;
static jmethodID LDKMonitorEvent_CommitmentTxConfirmed_meth = NULL;
-static jclass LDKMonitorEvent_UpdateCompleted_class = NULL;
-static jmethodID LDKMonitorEvent_UpdateCompleted_meth = NULL;
+static jclass LDKMonitorEvent_Completed_class = NULL;
+static jmethodID LDKMonitorEvent_Completed_meth = NULL;
static jclass LDKMonitorEvent_UpdateFailed_class = NULL;
static jmethodID LDKMonitorEvent_UpdateFailed_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMonitorEvent_init (JNIEnv *env, jclass clz) {
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_class != NULL);
LDKMonitorEvent_CommitmentTxConfirmed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_CommitmentTxConfirmed_class, "<init>", "(J)V");
CHECK(LDKMonitorEvent_CommitmentTxConfirmed_meth != NULL);
- LDKMonitorEvent_UpdateCompleted_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateCompleted"));
- CHECK(LDKMonitorEvent_UpdateCompleted_class != NULL);
- LDKMonitorEvent_UpdateCompleted_meth = (*env)->GetMethodID(env, LDKMonitorEvent_UpdateCompleted_class, "<init>", "(JJ)V");
- CHECK(LDKMonitorEvent_UpdateCompleted_meth != NULL);
+ LDKMonitorEvent_Completed_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$Completed"));
+ CHECK(LDKMonitorEvent_Completed_class != NULL);
+ LDKMonitorEvent_Completed_meth = (*env)->GetMethodID(env, LDKMonitorEvent_Completed_class, "<init>", "(JJ)V");
+ CHECK(LDKMonitorEvent_Completed_meth != NULL);
LDKMonitorEvent_UpdateFailed_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKMonitorEvent$UpdateFailed"));
CHECK(LDKMonitorEvent_UpdateFailed_class != NULL);
commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
return (*env)->NewObject(env, LDKMonitorEvent_CommitmentTxConfirmed_class, LDKMonitorEvent_CommitmentTxConfirmed_meth, commitment_tx_confirmed_ref);
}
- case LDKMonitorEvent_UpdateCompleted: {
- LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
+ case LDKMonitorEvent_Completed: {
+ LDKOutPoint funding_txo_var = obj->completed.funding_txo;
int64_t funding_txo_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
- int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
- return (*env)->NewObject(env, LDKMonitorEvent_UpdateCompleted_class, LDKMonitorEvent_UpdateCompleted_meth, funding_txo_ref, monitor_update_id_conv);
+ int64_t monitor_update_id_conv = obj->completed.monitor_update_id;
+ return (*env)->NewObject(env, LDKMonitorEvent_Completed_class, LDKMonitorEvent_Completed_meth, funding_txo_ref, monitor_update_id_conv);
}
case LDKMonitorEvent_UpdateFailed: {
LDKOutPoint update_failed_var = obj->update_failed;
}
static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
CResult_SecretKeyNoneZ_get_err(owner_conv);
}
+static inline struct LDKPublicKey CResult_PublicKeyNoneZ_get_ok(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return *owner->contents.result;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, 33);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyNoneZ_get_ok(owner_conv).compressed_form);
+ return ret_arr;
+}
+
+static inline void CResult_PublicKeyNoneZ_get_err(LDKCResult_PublicKeyNoneZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return *owner->contents.err;
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_PublicKeyNoneZ* owner_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(owner);
+ CResult_PublicKeyNoneZ_get_err(owner_conv);
+}
+
static jclass LDKCOption_ScalarZ_Some_class = NULL;
static jmethodID LDKCOption_ScalarZ_Some_meth = NULL;
static jclass LDKCOption_ScalarZ_None_class = NULL;
jmethodID sign_justice_revoked_htlc_meth;
jmethodID sign_counterparty_htlc_transaction_meth;
jmethodID sign_closing_transaction_meth;
+ jmethodID sign_holder_anchor_input_meth;
jmethodID sign_channel_announcement_meth;
jmethodID ready_channel_meth;
} LDKBaseSign_JCalls;
}
return ret_conv;
}
+LDKCResult_SignatureNoneZ sign_holder_anchor_input_LDKBaseSign_jcall(const void* this_arg, LDKTransaction anchor_tx, uintptr_t input) {
+ LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKTransaction anchor_tx_var = anchor_tx;
+ int8_tArray anchor_tx_arr = (*env)->NewByteArray(env, anchor_tx_var.datalen);
+ (*env)->SetByteArrayRegion(env, anchor_tx_arr, 0, anchor_tx_var.datalen, anchor_tx_var.data);
+ Transaction_free(anchor_tx_var);
+ int64_t input_conv = input;
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->sign_holder_anchor_input_meth, anchor_tx_arr, input_conv);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to sign_holder_anchor_input in LDKBaseSign from rust threw an exception.");
+ }
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
JNIEnv *env;
CHECK(calls->sign_counterparty_htlc_transaction_meth != NULL);
calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
CHECK(calls->sign_closing_transaction_meth != NULL);
+ calls->sign_holder_anchor_input_meth = (*env)->GetMethodID(env, c, "sign_holder_anchor_input", "([BJ)J");
+ CHECK(calls->sign_holder_anchor_input_meth != NULL);
calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
CHECK(calls->sign_channel_announcement_meth != NULL);
calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V");
.sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
.sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
.sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
+ .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall,
.sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
.ready_channel = ready_channel_LDKBaseSign_jcall,
.free = LDKBaseSign_JCalls_free,
return tag_ptr(ret_conv, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1anchor_1input(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray anchor_tx, int64_t input) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
+ LDKTransaction anchor_tx_ref;
+ anchor_tx_ref.datalen = (*env)->GetArrayLength(env, anchor_tx);
+ anchor_tx_ref.data = MALLOC(anchor_tx_ref.datalen, "LDKTransaction Bytes");
+ (*env)->GetByteArrayRegion(env, anchor_tx, 0, anchor_tx_ref.datalen, anchor_tx_ref.data);
+ anchor_tx_ref.data_is_owned = true;
+ LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
+ *ret_conv = (this_arg_conv->sign_holder_anchor_input)(this_arg_conv->this_arg, anchor_tx_ref, input);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
}
static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_SignDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
static jmethodID LDKAPIError_RouteError_meth = NULL;
static jclass LDKAPIError_ChannelUnavailable_class = NULL;
static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
-static jclass LDKAPIError_MonitorUpdateFailed_class = NULL;
-static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL;
+static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL;
+static jmethodID LDKAPIError_MonitorUpdateInProgress_meth = NULL;
static jclass LDKAPIError_IncompatibleShutdownScript_class = NULL;
static jmethodID LDKAPIError_IncompatibleShutdownScript_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv *env, jclass clz) {
CHECK(LDKAPIError_ChannelUnavailable_class != NULL);
LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(Ljava/lang/String;)V");
CHECK(LDKAPIError_ChannelUnavailable_meth != NULL);
- LDKAPIError_MonitorUpdateFailed_class =
- (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed"));
- CHECK(LDKAPIError_MonitorUpdateFailed_class != NULL);
- LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
- CHECK(LDKAPIError_MonitorUpdateFailed_meth != NULL);
+ LDKAPIError_MonitorUpdateInProgress_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$MonitorUpdateInProgress"));
+ CHECK(LDKAPIError_MonitorUpdateInProgress_class != NULL);
+ LDKAPIError_MonitorUpdateInProgress_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateInProgress_class, "<init>", "()V");
+ CHECK(LDKAPIError_MonitorUpdateInProgress_meth != NULL);
LDKAPIError_IncompatibleShutdownScript_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$IncompatibleShutdownScript"));
CHECK(LDKAPIError_IncompatibleShutdownScript_class != NULL);
jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len);
return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_conv);
}
- case LDKAPIError_MonitorUpdateFailed: {
- return (*env)->NewObject(env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth);
+ case LDKAPIError_MonitorUpdateInProgress: {
+ return (*env)->NewObject(env, LDKAPIError_MonitorUpdateInProgress_class, LDKAPIError_MonitorUpdateInProgress_meth);
}
case LDKAPIError_IncompatibleShutdownScript: {
LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
}
static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
+LDKChannelMonitorUpdateStatus watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to watch_channel in LDKWatch from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
+LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
update_ref = tag_ptr(update_var.inner, update_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_channel in LDKWatch from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
+ calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->watch_channel_meth != NULL);
- calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
+ calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->update_channel_meth != NULL);
calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()[J");
CHECK(calls->release_pending_monitor_events_meth != NULL);
*res_ptr = LDKWatch_init(env, clz, o);
return tag_ptr(res_ptr, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
monitor_conv.is_owned = ptr_is_owned(monitor);
CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
monitor_conv = ChannelMonitor_clone(&monitor_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv));
+ return ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t update) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
update_conv.is_owned = ptr_is_owned(update);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
update_conv = ChannelMonitorUpdate_clone(&update_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv));
+ return ret_conv;
}
JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_1monitor_1events(JNIEnv *env, jclass clz, int64_t this_arg) {
JavaVM *vm;
jweak o;
jmethodID get_node_secret_meth;
+ jmethodID get_node_id_meth;
jmethodID ecdh_meth;
jmethodID get_destination_script_meth;
jmethodID get_shutdown_scriptpubkey_meth;
}
return ret_conv;
}
+LDKCResult_PublicKeyNoneZ get_node_id_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
+ LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jclass recipient_conv = LDKRecipient_to_java(env, recipient);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_node_id_meth, recipient_conv);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to get_node_id in LDKKeysInterface from rust threw an exception.");
+ }
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_PublicKeyNoneZ ret_conv = *(LDKCResult_PublicKeyNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
LDKCResult_SharedSecretNoneZ ecdh_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient, LDKPublicKey other_key, LDKCOption_ScalarZ tweak) {
LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
JNIEnv *env;
calls->o = (*env)->NewWeakGlobalRef(env, o);
calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "(Lorg/ldk/enums/Recipient;)J");
CHECK(calls->get_node_secret_meth != NULL);
+ calls->get_node_id_meth = (*env)->GetMethodID(env, c, "get_node_id", "(Lorg/ldk/enums/Recipient;)J");
+ CHECK(calls->get_node_id_meth != NULL);
calls->ecdh_meth = (*env)->GetMethodID(env, c, "ecdh", "(Lorg/ldk/enums/Recipient;[BJ)J");
CHECK(calls->ecdh_meth != NULL);
calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()[B");
LDKKeysInterface ret = {
.this_arg = (void*) calls,
.get_node_secret = get_node_secret_LDKKeysInterface_jcall,
+ .get_node_id = get_node_id_LDKKeysInterface_jcall,
.ecdh = ecdh_LDKKeysInterface_jcall,
.get_destination_script = get_destination_script_LDKKeysInterface_jcall,
.get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
return tag_ptr(ret_conv, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
+ LDKRecipient recipient_conv = LDKRecipient_from_java(env, recipient);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = (this_arg_conv->get_node_id)(this_arg_conv->this_arg, recipient_conv);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1ecdh(JNIEnv *env, jclass clz, int64_t this_arg, jclass recipient, int8_tArray other_key, int64_t tweak) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
}
static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
return ret;
}
+typedef struct LDKCustomOnionMessageContents_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID tlv_type_meth;
+ jmethodID write_meth;
+} LDKCustomOnionMessageContents_JCalls;
+static void LDKCustomOnionMessageContents_JCalls_free(void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ FREE(j_calls);
+ }
+}
+uint64_t tlv_type_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->tlv_type_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to tlv_type in LDKCustomOnionMessageContents from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret;
+}
+LDKCVec_u8Z write_LDKCustomOnionMessageContents_jcall(const void* this_arg) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to write in LDKCustomOnionMessageContents from rust threw an exception.");
+ }
+ LDKCVec_u8Z ret_ref;
+ ret_ref.datalen = (*env)->GetArrayLength(env, ret);
+ ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
+ (*env)->GetByteArrayRegion(env, ret, 0, ret_ref.datalen, ret_ref.data);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_ref;
+}
+static void LDKCustomOnionMessageContents_JCalls_cloned(LDKCustomOnionMessageContents* new_obj) {
+ LDKCustomOnionMessageContents_JCalls *j_calls = (LDKCustomOnionMessageContents_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKCustomOnionMessageContents LDKCustomOnionMessageContents_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKCustomOnionMessageContents_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageContents_JCalls), "LDKCustomOnionMessageContents_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->tlv_type_meth = (*env)->GetMethodID(env, c, "tlv_type", "()J");
+ CHECK(calls->tlv_type_meth != NULL);
+ calls->write_meth = (*env)->GetMethodID(env, c, "write", "()[B");
+ CHECK(calls->write_meth != NULL);
+
+ LDKCustomOnionMessageContents ret = {
+ .this_arg = (void*) calls,
+ .tlv_type = tlv_type_LDKCustomOnionMessageContents_jcall,
+ .write = write_LDKCustomOnionMessageContents_jcall,
+ .cloned = LDKCustomOnionMessageContents_JCalls_cloned,
+ .free = LDKCustomOnionMessageContents_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKCustomOnionMessageContents *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *res_ptr = LDKCustomOnionMessageContents_init(env, clz, o);
+ return tag_ptr(res_ptr, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
+ int64_t ret_conv = (this_arg_conv->tlv_type)(this_arg_conv->this_arg);
+ return ret_conv;
+}
+
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageContents* this_arg_conv = (LDKCustomOnionMessageContents*)this_arg_ptr;
+ LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
+ int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+ (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+ CVec_u8Z_free(ret_var);
+ return ret_arr;
+}
+
+static jclass LDKCOption_CustomOnionMessageContentsZ_Some_class = NULL;
+static jmethodID LDKCOption_CustomOnionMessageContentsZ_Some_meth = NULL;
+static jclass LDKCOption_CustomOnionMessageContentsZ_None_class = NULL;
+static jmethodID LDKCOption_CustomOnionMessageContentsZ_None_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CustomOnionMessageContentsZ_init (JNIEnv *env, jclass clz) {
+ LDKCOption_CustomOnionMessageContentsZ_Some_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$Some"));
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_class != NULL);
+ LDKCOption_CustomOnionMessageContentsZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, "<init>", "(J)V");
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_Some_meth != NULL);
+ LDKCOption_CustomOnionMessageContentsZ_None_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_CustomOnionMessageContentsZ$None"));
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_None_class != NULL);
+ LDKCOption_CustomOnionMessageContentsZ_None_meth = (*env)->GetMethodID(env, LDKCOption_CustomOnionMessageContentsZ_None_class, "<init>", "()V");
+ CHECK(LDKCOption_CustomOnionMessageContentsZ_None_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+ LDKCOption_CustomOnionMessageContentsZ *obj = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(ptr);
+ switch(obj->tag) {
+ case LDKCOption_CustomOnionMessageContentsZ_Some: {
+ LDKCustomOnionMessageContents* some_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *some_ret = CustomOnionMessageContents_clone(&obj->some);
+ return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_Some_class, LDKCOption_CustomOnionMessageContentsZ_Some_meth, tag_ptr(some_ret, true));
+ }
+ case LDKCOption_CustomOnionMessageContentsZ_None: {
+ return (*env)->NewObject(env, LDKCOption_CustomOnionMessageContentsZ_None_class, LDKCOption_CustomOnionMessageContentsZ_None_meth);
+ }
+ default: abort();
+ }
+}
+static inline struct LDKCOption_CustomOnionMessageContentsZ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(owner->result_ok);
+ return COption_CustomOnionMessageContentsZ_clone(&*owner->contents.result);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+static inline struct LDKDecodeError CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR owner){
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* owner_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(owner);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
static jclass LDKCOption_NetAddressZ_Some_class = NULL;
static jmethodID LDKCOption_NetAddressZ_Some_meth = NULL;
static jclass LDKCOption_NetAddressZ_None_class = NULL;
static jmethodID LDKSendError_TooFewBlindedHops_meth = NULL;
static jclass LDKSendError_InvalidFirstHop_class = NULL;
static jmethodID LDKSendError_InvalidFirstHop_meth = NULL;
+static jclass LDKSendError_InvalidMessage_class = NULL;
+static jmethodID LDKSendError_InvalidMessage_meth = NULL;
static jclass LDKSendError_BufferFull_class = NULL;
static jmethodID LDKSendError_BufferFull_meth = NULL;
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) {
CHECK(LDKSendError_InvalidFirstHop_class != NULL);
LDKSendError_InvalidFirstHop_meth = (*env)->GetMethodID(env, LDKSendError_InvalidFirstHop_class, "<init>", "()V");
CHECK(LDKSendError_InvalidFirstHop_meth != NULL);
+ LDKSendError_InvalidMessage_class =
+ (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$InvalidMessage"));
+ CHECK(LDKSendError_InvalidMessage_class != NULL);
+ LDKSendError_InvalidMessage_meth = (*env)->GetMethodID(env, LDKSendError_InvalidMessage_class, "<init>", "()V");
+ CHECK(LDKSendError_InvalidMessage_meth != NULL);
LDKSendError_BufferFull_class =
(*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BufferFull"));
CHECK(LDKSendError_BufferFull_class != NULL);
case LDKSendError_InvalidFirstHop: {
return (*env)->NewObject(env, LDKSendError_InvalidFirstHop_class, LDKSendError_InvalidFirstHop_meth);
}
+ case LDKSendError_InvalidMessage: {
+ return (*env)->NewObject(env, LDKSendError_InvalidMessage_class, LDKSendError_InvalidMessage_meth);
+ }
case LDKSendError_BufferFull: {
return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth);
}
LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr);
switch(obj->tag) {
case LDKGraphSyncError_DecodeError: {
- LDKDecodeError decode_error_var = obj->decode_error;
- int64_t decode_error_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(decode_error_var);
- decode_error_ref = tag_ptr(decode_error_var.inner, false);
+ int64_t decode_error_ref = tag_ptr(&obj->decode_error, false);
return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref);
}
case LDKGraphSyncError_LightningError: {
}
static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_InitDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_OnionMessageDecodeErrorZ_get_err(LDKCResult_OnionMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_OnionMessageDecodeErrorZ* owner_conv = (LDKCResult_OnionMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_OnionMessageDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PingDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_PongDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
}
static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
- LDKDecodeError ret = *owner->contents.err;
- ret.is_owned = false;
- return ret;
+CHECK(!owner->result_ok);
+ return DecodeError_clone(&*owner->contents.err);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) {
LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
- LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
FREE(j_calls);
}
}
-LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
+LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->persist_new_channel_meth, channel_id_ref, data_ref, update_id_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to persist_new_channel in LDKPersist from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
return ret_conv;
}
-LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
+LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
+ jclass ret = (*env)->CallObjectMethod(env, obj, j_calls->update_persisted_channel_meth, channel_id_ref, update_ref, data_ref, update_id_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to update_persisted_channel in LDKPersist from rust threw an exception.");
}
- void* ret_ptr = untag_ptr(ret);
- CHECK_ACCESS(ret_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
- FREE(untag_ptr(ret));
+ LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_java(env, ret);
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
atomic_init(&calls->refcnt, 1);
DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
calls->o = (*env)->NewWeakGlobalRef(env, o);
- calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)J");
+ calls->persist_new_channel_meth = (*env)->GetMethodID(env, c, "persist_new_channel", "(JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->persist_new_channel_meth != NULL);
- calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)J");
+ calls->update_persisted_channel_meth = (*env)->GetMethodID(env, c, "update_persisted_channel", "(JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;");
CHECK(calls->update_persisted_channel_meth != NULL);
LDKPersist ret = {
*res_ptr = LDKPersist_init(env, clz, o);
return tag_ptr(res_ptr, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t data, int64_t update_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
update_id_conv.is_owned = ptr_is_owned(update_id);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
update_id_conv = MonitorUpdateId_clone(&update_id_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv));
+ return ret_conv;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_t update_id) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
update_id_conv.is_owned = ptr_is_owned(update_id);
CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
update_id_conv = MonitorUpdateId_clone(&update_id_conv);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
- return tag_ptr(ret_conv, true);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv));
+ return ret_conv;
}
typedef struct LDKChannelMessageHandler_JCalls {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
}
-void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
+LDKCResult_NoneNoneZ peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, msg_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKChannelMessageHandler from rust threw an exception.");
}
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
+ return ret_conv;
}
void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
CHECK(calls->handle_announcement_signatures_meth != NULL);
calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
CHECK(calls->peer_disconnected_meth != NULL);
- calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
+ calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
CHECK(calls->peer_connected_meth != NULL);
calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "([BJ)V");
CHECK(calls->handle_channel_reestablish_meth != NULL);
(this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
msg_conv.is_owned = ptr_is_owned(msg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
msg_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
+ return tag_ptr(ret_conv, true);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1channel_1reestablish(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
}
return ret_conv;
}
-void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+LDKCResult_NoneNoneZ peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
init_ref = tag_ptr(init_var.inner, init_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKRoutingMessageHandler from rust threw an exception.");
}
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
+ return ret_conv;
}
LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
CHECK(calls->get_next_channel_announcement_meth != NULL);
calls->get_next_node_announcement_meth = (*env)->GetMethodID(env, c, "get_next_node_announcement", "([B)J");
CHECK(calls->get_next_node_announcement_meth != NULL);
- calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
+ calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
CHECK(calls->peer_connected_meth != NULL);
calls->handle_reply_channel_range_meth = (*env)->GetMethodID(env, c, "handle_reply_channel_range", "([BJ)J");
CHECK(calls->handle_reply_channel_range_meth != NULL);
return ret_ref;
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
init_conv.is_owned = ptr_is_owned(init);
CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
init_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1reply_1channel_1range(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t msg) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
}
-void peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
+LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
JNIEnv *env;
jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
init_ref = tag_ptr(init_var.inner, init_var.is_owned);
jobject obj = (*env)->NewLocalRef(env, j_calls->o);
CHECK(obj != NULL);
- (*env)->CallVoidMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->peer_connected_meth, their_node_id_arr, init_ref);
if (UNLIKELY((*env)->ExceptionCheck(env))) {
(*env)->ExceptionDescribe(env);
(*env)->FatalError(env, "A call to peer_connected in LDKOnionMessageHandler from rust threw an exception.");
}
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
if (get_jenv_res == JNI_EDETACHED) {
DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
}
+ return ret_conv;
}
void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg;
calls->o = (*env)->NewWeakGlobalRef(env, o);
calls->handle_onion_message_meth = (*env)->GetMethodID(env, c, "handle_onion_message", "([BJ)V");
CHECK(calls->handle_onion_message_meth != NULL);
- calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)V");
+ calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "([BJ)J");
CHECK(calls->peer_connected_meth != NULL);
calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "([BZ)V");
CHECK(calls->peer_disconnected_meth != NULL);
(this_arg_conv->handle_onion_message)(this_arg_conv->this_arg, peer_node_id_ref, &msg_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t init) {
void* this_arg_ptr = untag_ptr(this_arg);
if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
LDKOnionMessageHandler* this_arg_conv = (LDKOnionMessageHandler*)this_arg_ptr;
init_conv.is_owned = ptr_is_owned(init);
CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
init_conv.is_owned = false;
- (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
+ *ret_conv = (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
+ return tag_ptr(ret_conv, true);
}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1disconnected(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, jboolean no_connection_possible) {
return ret_arr;
}
+typedef struct LDKCustomOnionMessageHandler_JCalls {
+ atomic_size_t refcnt;
+ JavaVM *vm;
+ jweak o;
+ jmethodID handle_custom_message_meth;
+ jmethodID read_custom_message_meth;
+} LDKCustomOnionMessageHandler_JCalls;
+static void LDKCustomOnionMessageHandler_JCalls_free(void* this_arg) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ (*env)->DeleteWeakGlobalRef(env, j_calls->o);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ FREE(j_calls);
+ }
+}
+void handle_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, LDKCustomOnionMessageContents msg) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ LDKCustomOnionMessageContents* msg_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *msg_ret = msg;
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ (*env)->CallVoidMethod(env, obj, j_calls->handle_custom_message_meth, tag_ptr(msg_ret, true));
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to handle_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
+ }
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+}
+LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message_LDKCustomOnionMessageHandler_jcall(const void* this_arg, uint64_t message_type, LDKu8slice buffer) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg;
+ JNIEnv *env;
+ jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6);
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK);
+ } else {
+ DO_ASSERT(get_jenv_res == JNI_OK);
+ }
+ int64_t message_type_conv = message_type;
+ LDKu8slice buffer_var = buffer;
+ int8_tArray buffer_arr = (*env)->NewByteArray(env, buffer_var.datalen);
+ (*env)->SetByteArrayRegion(env, buffer_arr, 0, buffer_var.datalen, buffer_var.data);
+ jobject obj = (*env)->NewLocalRef(env, j_calls->o);
+ CHECK(obj != NULL);
+ uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->read_custom_message_meth, message_type_conv, buffer_arr);
+ if (UNLIKELY((*env)->ExceptionCheck(env))) {
+ (*env)->ExceptionDescribe(env);
+ (*env)->FatalError(env, "A call to read_custom_message in LDKCustomOnionMessageHandler from rust threw an exception.");
+ }
+ void* ret_ptr = untag_ptr(ret);
+ CHECK_ACCESS(ret_ptr);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(ret_ptr);
+ FREE(untag_ptr(ret));
+ if (get_jenv_res == JNI_EDETACHED) {
+ DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
+ }
+ return ret_conv;
+}
+static void LDKCustomOnionMessageHandler_JCalls_cloned(LDKCustomOnionMessageHandler* new_obj) {
+ LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) new_obj->this_arg;
+ atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
+}
+static inline LDKCustomOnionMessageHandler LDKCustomOnionMessageHandler_init (JNIEnv *env, jclass clz, jobject o) {
+ jclass c = (*env)->GetObjectClass(env, o);
+ CHECK(c != NULL);
+ LDKCustomOnionMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomOnionMessageHandler_JCalls), "LDKCustomOnionMessageHandler_JCalls");
+ atomic_init(&calls->refcnt, 1);
+ DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
+ calls->o = (*env)->NewWeakGlobalRef(env, o);
+ calls->handle_custom_message_meth = (*env)->GetMethodID(env, c, "handle_custom_message", "(J)V");
+ CHECK(calls->handle_custom_message_meth != NULL);
+ calls->read_custom_message_meth = (*env)->GetMethodID(env, c, "read_custom_message", "(J[B)J");
+ CHECK(calls->read_custom_message_meth != NULL);
+
+ LDKCustomOnionMessageHandler ret = {
+ .this_arg = (void*) calls,
+ .handle_custom_message = handle_custom_message_LDKCustomOnionMessageHandler_jcall,
+ .read_custom_message = read_custom_message_LDKCustomOnionMessageHandler_jcall,
+ .free = LDKCustomOnionMessageHandler_JCalls_free,
+ };
+ return ret;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_1new(JNIEnv *env, jclass clz, jobject o) {
+ LDKCustomOnionMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
+ *res_ptr = LDKCustomOnionMessageHandler_init(env, clz, o);
+ return tag_ptr(res_ptr, true);
+}
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
+ void* msg_ptr = untag_ptr(msg);
+ CHECK_ACCESS(msg_ptr);
+ LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
+ if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
+ }
+ (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1read_1custom_1message(JNIEnv *env, jclass clz, int64_t this_arg, int64_t message_type, int8_tArray buffer) {
+ void* this_arg_ptr = untag_ptr(this_arg);
+ if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
+ LDKCustomOnionMessageHandler* this_arg_conv = (LDKCustomOnionMessageHandler*)this_arg_ptr;
+ LDKu8slice buffer_ref;
+ buffer_ref.datalen = (*env)->GetArrayLength(env, buffer);
+ buffer_ref.data = (*env)->GetByteArrayElements (env, buffer, NULL);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = (this_arg_conv->read_custom_message)(this_arg_conv->this_arg, message_type, buffer_ref);
+ (*env)->ReleaseByteArrayElements(env, buffer, (int8_t*)buffer_ref.data, 0);
+ return tag_ptr(ret_conv, true);
+}
+
typedef struct LDKSocketDescriptor_JCalls {
atomic_size_t refcnt;
JavaVM *vm;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ");
*ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ");
*ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
*ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
*ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
*ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
*ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
*ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTransactionParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
*ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HolderCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BuiltCommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentTransactionDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
*ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
*ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
*ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
*ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
*ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
*ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
*ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
*ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
*ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1ClosureReasonZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
*ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
*ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1EventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
*ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
CVec_TxidZ_free(_res_constr);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv *env, jclass clz) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
- return tag_ptr(ret_conv, true);
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv *env, jclass clz, jclass e) {
- LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_java(env, e);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
- return tag_ptr(ret_conv, true);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
- jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
- return ret_conv;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
- if (!ptr_is_owned(_res)) return;
- void* _res_ptr = untag_ptr(_res);
- CHECK_ACCESS(_res_ptr);
- LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
- FREE(untag_ptr(_res));
- CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
-}
-
-static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
- return tag_ptr(ret_conv, true);
-}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
- int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
- return ret_conv;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
- return tag_ptr(ret_conv, true);
-}
-
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
LDKCVec_MonitorEventZ _res_constr;
_res_constr.datalen = (*env)->GetArrayLength(env, _res);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FixedPenaltyScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
*ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ProbabilisticScorerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
*ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
*ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
*ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
*ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
*ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
*ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeIdDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
*ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1NetworkUpdateZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
*ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
*ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
*ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RoutingFeesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
*ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
*ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAliasDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
*ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
*ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetworkGraphDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
*ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DelayedPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StaticPaymentOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SpendableOutputDescriptorDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
*ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return tag_ptr(ret_conv, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) {
+ LDKPublicKey o_ref;
+ CHECK((*env)->GetArrayLength(env, o) == 33);
+ (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_ok(o_ref);
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err(JNIEnv *env, jclass clz) {
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_err();
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_PublicKeyNoneZ* o_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_PublicKeyNoneZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_PublicKeyNoneZ _res_conv = *(LDKCResult_PublicKeyNoneZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_PublicKeyNoneZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_PublicKeyNoneZ_clone_ptr(LDKCResult_PublicKeyNoneZ *NONNULL_PTR arg) {
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_PublicKeyNoneZ* arg_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_PublicKeyNoneZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_PublicKeyNoneZ* orig_conv = (LDKCResult_PublicKeyNoneZ*)untag_ptr(orig);
+ LDKCResult_PublicKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyNoneZ), "LDKCResult_PublicKeyNoneZ");
+ *ret_conv = CResult_PublicKeyNoneZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1ScalarZ_1some(JNIEnv *env, jclass clz, int64_t o) {
void* o_ptr = untag_ptr(o);
CHECK_ACCESS(o_ptr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
*ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InMemorySignerDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
*ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyForwardingInfoDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
*ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelCounterpartyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
*ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelDetailsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
*ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PhantomRouteHintsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
*ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelManagerZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelConfigDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
*ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OutPointDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
*ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1TypeZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
*ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ");
*ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
*ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
*ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
*ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
*ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCustomOnionMessageContents o_conv = *(LDKCustomOnionMessageContents*)(o_ptr);
+ if (o_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&o_conv);
+ }
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_some(o_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) {
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_none();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ COption_CustomOnionMessageContentsZ_free(_res_conv);
+}
+
+static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) {
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg);
+ int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig);
+ LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ");
+ *ret_copy = COption_CustomOnionMessageContentsZ_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_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ void* o_ptr = untag_ptr(o);
+ CHECK_ACCESS(o_ptr);
+ LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr);
+ o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o));
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv);
+ return tag_ptr(ret_conv, true);
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o);
+ jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+ if (!ptr_is_owned(_res)) return;
+ void* _res_ptr = untag_ptr(_res);
+ CHECK_ACCESS(_res_ptr);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr);
+ FREE(untag_ptr(_res));
+ CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv);
+}
+
+static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg);
+ return tag_ptr(ret_conv, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg);
+ int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig);
+ LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ");
+ *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv);
+ return tag_ptr(ret_conv, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) {
void* o_ptr = untag_ptr(o);
CHECK_ACCESS(o_ptr);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NetAddressDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
*ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AcceptChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
*ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1AnnouncementSignaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
*ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReestablishDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
*ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
*ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ClosingSignedFeeRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
*ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CommitmentSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
*ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingCreatedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
*ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1FundingSignedDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
*ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelReadyDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
*ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InitDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
*ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OpenChannelDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
*ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RevokeAndACKDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
*ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
*ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFailMalformedHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFeeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
*ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateFulfillHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UpdateAddHTLCDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
*ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OnionMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_OnionMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OnionMessageDecodeErrorZ), "LDKCResult_OnionMessageDecodeErrorZ");
*ret_conv = CResult_OnionMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PingDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
*ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PongDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
*ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
*ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
*ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
*ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelUpdateDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
*ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ErrorMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
*ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1WarningMessageDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
*ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1UnsignedNodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
*ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NodeAnnouncementDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
*ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryShortChannelIdsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
*ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyShortChannelIdsEndDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
*ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1QueryChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
*ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ReplyChannelRangeDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
*ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1GossipTimestampFilterDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) {
- LDKDecodeError e_conv;
- e_conv.inner = untag_ptr(e);
- e_conv.is_owned = ptr_is_owned(e);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
- e_conv = DecodeError_clone(&e_conv);
+ void* e_ptr = untag_ptr(e);
+ CHECK_ACCESS(e_ptr);
+ LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr);
+ e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e));
LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
*ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
return tag_ptr(ret_conv, true);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a);
+ LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b);
+ jboolean ret_conv = ClosureReason_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ClosureReason_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHTLCDestination* a_conv = (LDKHTLCDestination*)untag_ptr(a);
+ LDKHTLCDestination* b_conv = (LDKHTLCDestination*)untag_ptr(b);
+ jboolean ret_conv = HTLCDestination_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1in_1progress(JNIEnv *env, jclass clz) {
LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
- *ret_copy = APIError_monitor_update_failed();
+ *ret_copy = APIError_monitor_update_in_progress();
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_APIError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a);
+ LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b);
+ jboolean ret_conv = APIError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BigSize_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKBigSize this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hostname_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHostname a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHostname b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Hostname_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_t JNICALL Java_org_ldk_impl_bindings_Hostname_1len(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKHostname this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelConfig a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelConfig b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv *env, jclass clz) {
LDKChannelConfig ret_var = ChannelConfig_default();
int64_t ret_ref = 0;
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BestBlock_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKBestBlock a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKBestBlock b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BestBlock_1from_1genesis(JNIEnv *env, jclass clz, jclass network) {
LDKNetwork network_conv = LDKNetwork_from_java(env, network);
LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
Confirm_free(this_ptr_conv);
}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_clone(orig_conv));
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig);
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_clone(orig_conv));
+ return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1completed(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_completed());
return ret_conv;
}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) {
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure());
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1in_1progress(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_in_progress());
return ret_conv;
}
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) {
- jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure());
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1permanent_1failure(JNIEnv *env, jclass clz) {
+ jclass ret_conv = LDKChannelMonitorUpdateStatus_to_java(env, ChannelMonitorUpdateStatus_permanent_failure());
+ return ret_conv;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a);
+ LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b);
+ jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv);
return ret_conv;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKWatchedOutput a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKWatchedOutput b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1hash(JNIEnv *env, jclass clz, int64_t o) {
LDKWatchedOutput o_conv;
o_conv.inner = untag_ptr(o);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1completed(JNIEnv *env, jclass clz, int64_t funding_txo, int64_t monitor_update_id) {
LDKOutPoint funding_txo_conv;
funding_txo_conv.inner = untag_ptr(funding_txo);
funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
funding_txo_conv = OutPoint_clone(&funding_txo_conv);
LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
- *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
+ *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id);
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a);
+ LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b);
+ jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHTLCUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHTLCUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKHTLCUpdate obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKDelayedPaymentOutputDescriptor a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKDelayedPaymentOutputDescriptor b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = DelayedPaymentOutputDescriptor_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKDelayedPaymentOutputDescriptor obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKStaticPaymentOutputDescriptor a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKStaticPaymentOutputDescriptor b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = StaticPaymentOutputDescriptor_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKStaticPaymentOutputDescriptor obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKSpendableOutputDescriptor* a_conv = (LDKSpendableOutputDescriptor*)untag_ptr(a);
+ LDKSpendableOutputDescriptor* b_conv = (LDKSpendableOutputDescriptor*)untag_ptr(b);
+ jboolean ret_conv = SpendableOutputDescriptor_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
return tag_ptr(ret_ret, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1node_1features(JNIEnv *env, jclass clz) {
+ LDKNodeFeatures ret_var = provided_node_features();
+ int64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1channel_1features(JNIEnv *env, jclass clz) {
+ LDKChannelFeatures ret_var = provided_channel_features();
+ int64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_provided_1init_1features(JNIEnv *env, jclass clz) {
+ LDKInitFeatures ret_var = provided_init_features();
+ int64_t ret_ref = 0;
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
+ ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ return ret_ref;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CounterpartyForwardingInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKCounterpartyForwardingInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
- LDKDecodeError this_obj_conv;
- this_obj_conv.inner = untag_ptr(this_obj);
- this_obj_conv.is_owned = ptr_is_owned(this_obj);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
- DecodeError_free(this_obj_conv);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ DecodeError_free(this_ptr_conv);
}
static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
- LDKDecodeError ret_var = DecodeError_clone(arg);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_clone(arg);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
- LDKDecodeError arg_conv;
- arg_conv.inner = untag_ptr(arg);
- arg_conv.is_owned = ptr_is_owned(arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
- arg_conv.is_owned = false;
- int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
+ LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg);
+ int64_t ret_conv = DecodeError_clone_ptr(arg_conv);
return ret_conv;
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
- LDKDecodeError orig_conv;
- orig_conv.inner = untag_ptr(orig);
- orig_conv.is_owned = ptr_is_owned(orig);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
- orig_conv.is_owned = false;
- LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
+ LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_clone(orig_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1version(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unknown_version();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1required_1feature(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unknown_required_feature();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1invalid_1value(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_invalid_value();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1short_1read(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_short_read();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1bad_1length_1descriptor(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_bad_length_descriptor();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1io(JNIEnv *env, jclass clz, jclass a) {
+ LDKIOError a_conv = LDKIOError_from_java(env, a);
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_io(a_conv);
+ int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DecodeError_1unsupported_1compression(JNIEnv *env, jclass clz) {
+ LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
+ *ret_copy = DecodeError_unsupported_compression();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DecodeError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a);
+ LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b);
+ jboolean ret_conv = DecodeError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInit this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Init_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKInit a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKInit b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Init_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKErrorMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKErrorMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKErrorMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_WarningMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKWarningMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WarningMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKWarningMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKWarningMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKPing this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Ping_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKPing a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKPing b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Ping_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKPong this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Pong_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKPong a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKPong b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Pong_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKOpenChannel this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OpenChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKOpenChannel a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOpenChannel b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKAcceptChannel this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKAcceptChannel a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKAcceptChannel b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = AcceptChannel_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFundingCreated this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingCreated_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKFundingCreated a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKFundingCreated b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = FundingCreated_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFundingSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKFundingSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKFundingSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = FundingSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReady_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelReady this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReady_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelReady a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelReady b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelReady_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKShutdown this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Shutdown_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKShutdown a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKShutdown b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = Shutdown_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKClosingSignedFeeRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosingSignedFeeRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingSignedFeeRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingSignedFeeRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKClosingSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosingSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateAddHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateAddHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateAddHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateAddHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessage_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKOnionMessage this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OnionMessage_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKOnionMessage a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKOnionMessage b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = OnionMessage_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFulfillHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFulfillHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFulfillHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFulfillHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFailHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFailHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFailHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFailHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFailMalformedHTLC this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFailMalformedHTLC a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFailMalformedHTLC b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFailMalformedHTLC_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKCommitmentSigned this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKCommitmentSigned a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKCommitmentSigned b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = CommitmentSigned_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKRevokeAndACK this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKRevokeAndACK a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKRevokeAndACK b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = RevokeAndACK_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUpdateFee this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFee_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUpdateFee a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUpdateFee b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UpdateFee_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKDataLossProtect this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKDataLossProtect a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKDataLossProtect b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = DataLossProtect_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelReestablish this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelReestablish a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelReestablish b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelReestablish_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKAnnouncementSignatures this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKAnnouncementSignatures a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKAnnouncementSignatures b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = AnnouncementSignatures_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetAddress_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNetAddress* a_conv = (LDKNetAddress*)untag_ptr(a);
+ LDKNetAddress* b_conv = (LDKNetAddress*)untag_ptr(b);
+ jboolean ret_conv = NetAddress_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUnsignedNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedNodeAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedNodeAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKNodeAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUnsignedChannelAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUnsignedChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedChannelAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedChannelAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelAnnouncement this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelAnnouncement a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelAnnouncement b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelAnnouncement_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKUnsignedChannelUpdate this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKUnsignedChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKUnsignedChannelUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = UnsignedChannelUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKChannelUpdate this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKQueryChannelRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKQueryChannelRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKQueryChannelRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = QueryChannelRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKReplyChannelRange this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKReplyChannelRange a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKReplyChannelRange b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ReplyChannelRange_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKQueryShortChannelIds this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKQueryShortChannelIds a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKQueryShortChannelIds b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = QueryShortChannelIds_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKReplyShortChannelIdsEnd this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKReplyShortChannelIdsEnd a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKReplyShortChannelIdsEnd b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ReplyShortChannelIdsEnd_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKGossipTimestampFilter this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKGossipTimestampFilter a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKGossipTimestampFilter b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = GossipTimestampFilter_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKCommitmentUpdate a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKCommitmentUpdate b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = CommitmentUpdate_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return tag_ptr(ret_ret, true);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) {
+ LDKIgnoringMessageHandler this_arg_conv;
+ this_arg_conv.inner = untag_ptr(this_arg);
+ this_arg_conv.is_owned = ptr_is_owned(this_arg);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
+ this_arg_conv.is_owned = false;
+ LDKCustomOnionMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageHandler), "LDKCustomOnionMessageHandler");
+ *ret_ret = IgnoringMessageHandler_as_CustomOnionMessageHandler(&this_arg_conv);
+ return tag_ptr(ret_ret, true);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomMessageReader(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKIgnoringMessageHandler this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
PeerManager_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int64_t current_time, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *env, jclass clz, int64_t message_handler, int8_tArray our_node_secret, int32_t current_time, int8_tArray ephemeral_random_data, int64_t logger, int64_t custom_message_handler) {
LDKMessageHandler message_handler_conv;
message_handler_conv.inner = untag_ptr(message_handler);
message_handler_conv.is_owned = ptr_is_owned(message_handler);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKTxCreationKeys a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKTxCreationKeys b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = TxCreationKeys_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
int64_t ret_ref = 0;
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelPublicKeys a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelPublicKeys b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelPublicKeys_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKChannelPublicKeys obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKHTLCOutputInCommitment a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKHTLCOutputInCommitment b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = HTLCOutputInCommitment_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKHTLCOutputInCommitment obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_conv;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKClosingTransaction a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKClosingTransaction b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ClosingTransaction_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1new(JNIEnv *env, jclass clz, int64_t to_holder_value_sat, int64_t to_counterparty_value_sat, int8_tArray to_holder_script, int8_tArray to_counterparty_script, int64_t funding_outpoint) {
LDKCVec_u8Z to_holder_script_ref;
to_holder_script_ref.datalen = (*env)->GetArrayLength(env, to_holder_script);
ChannelTypeFeatures_free(this_obj_conv);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known_1channel_1features(JNIEnv *env, jclass clz) {
- LDKInitFeatures ret_var = InitFeatures_known_channel_features();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known_1channel_1features(JNIEnv *env, jclass clz) {
- LDKNodeFeatures ret_var = NodeFeatures_known_channel_features();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty(JNIEnv *env, jclass clz) {
LDKInitFeatures ret_var = InitFeatures_empty();
int64_t ret_ref = 0;
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known(JNIEnv *env, jclass clz) {
- LDKInitFeatures ret_var = InitFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InitFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInitFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known(JNIEnv *env, jclass clz) {
- LDKNodeFeatures ret_var = NodeFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKNodeFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known(JNIEnv *env, jclass clz) {
- LDKChannelFeatures ret_var = ChannelFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChannelFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known(JNIEnv *env, jclass clz) {
- LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKInvoiceFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known(JNIEnv *env, jclass clz) {
- LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
- int64_t ret_ref = 0;
- CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
- ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
- return ret_ref;
-}
-
JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKChannelTypeFeatures this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKShutdownScript a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKShutdownScript b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ShutdownScript_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvalidShutdownScript_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInvalidShutdownScript this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNetworkUpdate* a_conv = (LDKNetworkUpdate*)untag_ptr(a);
+ LDKNetworkUpdate* b_conv = (LDKNetworkUpdate*)untag_ptr(b);
+ jboolean ret_conv = NetworkUpdate_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelUpdateInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelUpdateInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelUpdateInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKChannelUpdateInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKChannelInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKChannelInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = ChannelInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1directional_1info(JNIEnv *env, jclass clz, int64_t this_arg, int8_t channel_flags) {
LDKChannelInfo this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeAnnouncementInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAnnouncementInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAnnouncementInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeAnnouncementInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeAlias a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeAlias b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeAlias_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeAlias_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeAlias obj_conv;
obj_conv.inner = untag_ptr(obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKNodeInfo a_conv;
+ a_conv.inner = untag_ptr(a);
+ a_conv.is_owned = ptr_is_owned(a);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
+ a_conv.is_owned = false;
+ LDKNodeInfo b_conv;
+ b_conv.inner = untag_ptr(b);
+ b_conv.is_owned = ptr_is_owned(b);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
+ b_conv.is_owned = false;
+ jboolean ret_conv = NodeInfo_eq(&a_conv, &b_conv);
+ return ret_conv;
+}
+
JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv *env, jclass clz, int64_t obj) {
LDKNodeInfo obj_conv;
obj_conv.inner = untag_ptr(obj);
NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray node_id) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKPublicKey _node_id_ref;
- CHECK((*env)->GetArrayLength(env, _node_id) == 33);
- (*env)->GetByteArrayRegion(env, _node_id, 0, 33, _node_id_ref.compressed_form);
- NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
+ LDKPublicKey node_id_ref;
+ CHECK((*env)->GetArrayLength(env, node_id) == 33);
+ (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+ NetworkGraph_node_failed_permanent(&this_arg_conv, node_id_ref);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels(JNIEnv *env, jclass clz, int64_t this_arg) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking(JNIEnv *env, jclass clz, int64_t this_arg) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- NetworkGraph_remove_stale_channels(&this_arg_conv);
+ NetworkGraph_remove_stale_channels_and_tracking(&this_arg_conv);
}
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time(JNIEnv *env, jclass clz, int64_t this_arg, int64_t current_time_unix) {
LDKNetworkGraph this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
+ NetworkGraph_remove_stale_channels_and_tracking_with_time(&this_arg_conv, current_time_unix);
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ int64_t ret_conv = ProbabilisticScoringParameters_get_historical_no_updates_half_life(&this_ptr_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1no_1updates_1half_1life(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) {
+ LDKProbabilisticScoringParameters this_ptr_conv;
+ this_ptr_conv.inner = untag_ptr(this_ptr);
+ this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
+ CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
+ this_ptr_conv.is_owned = false;
+ ProbabilisticScoringParameters_set_historical_no_updates_half_life(&this_ptr_conv, val);
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1anti_1probing_1penalty_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) {
LDKProbabilisticScoringParameters this_ptr_conv;
this_ptr_conv.inner = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message(JNIEnv *env, jclass clz) {
+ LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
+ *ret_copy = SendError_invalid_message();
+ int64_t ret_ref = tag_ptr(ret_copy, true);
+ return ret_ref;
+}
+
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNIEnv *env, jclass clz) {
LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError");
*ret_copy = SendError_buffer_full();
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t logger) {
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKSendError* a_conv = (LDKSendError*)untag_ptr(a);
+ LDKSendError* b_conv = (LDKSendError*)untag_ptr(b);
+ jboolean ret_conv = SendError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomOnionMessageHandler this_ptr_conv = *(LDKCustomOnionMessageHandler*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ CustomOnionMessageHandler_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv *env, jclass clz, int64_t keys_manager, int64_t logger, int64_t custom_handler) {
void* keys_manager_ptr = untag_ptr(keys_manager);
CHECK_ACCESS(keys_manager_ptr);
LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKLogger_JCalls_cloned(&logger_conv);
}
- LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv);
+ void* custom_handler_ptr = untag_ptr(custom_handler);
+ CHECK_ACCESS(custom_handler_ptr);
+ LDKCustomOnionMessageHandler custom_handler_conv = *(LDKCustomOnionMessageHandler*)(custom_handler_ptr);
+ if (custom_handler_conv.free == LDKCustomOnionMessageHandler_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageHandler_JCalls_cloned(&custom_handler_conv);
+ }
+ LDKOnionMessenger ret_var = OnionMessenger_new(keys_manager_conv, logger_conv, custom_handler_conv);
int64_t ret_ref = 0;
CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t reply_path) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t msg, int64_t reply_path) {
LDKOnionMessenger this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_ACCESS(destination_ptr);
LDKDestination destination_conv = *(LDKDestination*)(destination_ptr);
// WARNING: we may need a move here but no clone is available for LDKDestination
+ void* msg_ptr = untag_ptr(msg);
+ CHECK_ACCESS(msg_ptr);
+ LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr);
+ if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv);
+ }
LDKBlindedRoute reply_path_conv;
reply_path_conv.inner = untag_ptr(reply_path);
reply_path_conv.is_owned = ptr_is_owned(reply_path);
CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv);
reply_path_conv.is_owned = false;
LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ");
- *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, reply_path_conv);
+ *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv);
return tag_ptr(ret_conv, true);
}
return tag_ptr(ret_ret, true);
}
+static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) {
+ LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *ret_ret = CustomOnionMessageContents_clone(arg);
+ return tag_ptr(ret_ret, true);
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) {
+ void* arg_ptr = untag_ptr(arg);
+ if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
+ LDKCustomOnionMessageContents* arg_conv = (LDKCustomOnionMessageContents*)arg_ptr;
+ int64_t ret_conv = CustomOnionMessageContents_clone_ptr(arg_conv);
+ return ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+ void* orig_ptr = untag_ptr(orig);
+ if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
+ LDKCustomOnionMessageContents* orig_conv = (LDKCustomOnionMessageContents*)orig_ptr;
+ LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents");
+ *ret_ret = CustomOnionMessageContents_clone(orig_conv);
+ return tag_ptr(ret_ret, true);
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+ if (!ptr_is_owned(this_ptr)) return;
+ void* this_ptr_ptr = untag_ptr(this_ptr);
+ CHECK_ACCESS(this_ptr_ptr);
+ LDKCustomOnionMessageContents this_ptr_conv = *(LDKCustomOnionMessageContents*)(this_ptr_ptr);
+ FREE(untag_ptr(this_ptr));
+ CustomOnionMessageContents_free(this_ptr_conv);
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKFilesystemPersister this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKParseError* a_conv = (LDKParseError*)untag_ptr(a);
+ LDKParseError* b_conv = (LDKParseError*)untag_ptr(b);
+ jboolean ret_conv = ParseError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
if (!ptr_is_owned(this_ptr)) return;
void* this_ptr_ptr = untag_ptr(this_ptr);
return ret_ref;
}
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
+ LDKParseOrSemanticError* a_conv = (LDKParseOrSemanticError*)untag_ptr(a);
+ LDKParseOrSemanticError* b_conv = (LDKParseOrSemanticError*)untag_ptr(b);
+ jboolean ret_conv = ParseOrSemanticError_eq(a_conv, b_conv);
+ return ret_conv;
+}
+
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Invoice_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
LDKInvoice this_obj_conv;
this_obj_conv.inner = untag_ptr(this_obj);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, jstring description, int32_t invoice_expiry_delta_secs, int64_tArray phantom_route_hints, int64_t keys_manager, int64_t logger, jclass network) {
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, network_conv);
+ *ret_conv = create_phantom_invoice(amt_msat_conv, payment_hash_ref, description_conv, invoice_expiry_delta_secs, phantom_route_hints_constr, keys_manager_conv, logger_conv, network_conv);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, jclass network) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t amt_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t description_hash, int64_tArray phantom_route_hints, int64_t keys_manager, int64_t logger, jclass network) {
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, network_conv);
+ *ret_conv = create_phantom_invoice_with_description_hash(amt_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, description_hash_conv, phantom_route_hints_constr, keys_manager_conv, logger_conv, network_conv);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
LDKStr description_conv = java_to_owned_str(env, description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
description_hash_conv = Sha256_clone(&description_hash_conv);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_with_description_hash(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, int64_t description_hash, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
description_hash_conv = Sha256_clone(&description_hash_conv);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_hash_conv, duration_since_epoch, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs) {
LDKChannelManager channelmanager_conv;
channelmanager_conv.inner = untag_ptr(channelmanager);
channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
// If this_arg is a JCalls struct, then we need to increment the refcnt in it.
LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
}
+ void* logger_ptr = untag_ptr(logger);
+ CHECK_ACCESS(logger_ptr);
+ LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
+ if (logger_conv.free == LDKLogger_JCalls_free) {
+ // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+ LDKLogger_JCalls_cloned(&logger_conv);
+ }
LDKCurrency network_conv = LDKCurrency_from_java(env, network);
void* amt_msat_ptr = untag_ptr(amt_msat);
CHECK_ACCESS(amt_msat_ptr);
amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
LDKStr description_conv = java_to_owned_str(env, description);
LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
- *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
+ *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs);
return tag_ptr(ret_conv, true);
}
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path(JNIEnv *env, jclass clz, int64_t this_arg, jstring sync_path) {
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) {
LDKRapidGossipSync this_arg_conv;
this_arg_conv.inner = untag_ptr(this_arg);
this_arg_conv.is_owned = ptr_is_owned(this_arg);
CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
this_arg_conv.is_owned = false;
- LDKStr sync_path_conv = java_to_owned_str(env, sync_path);
+ LDKu8slice update_data_ref;
+ update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
+ update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
- *ret_conv = RapidGossipSync_sync_network_graph_with_file_path(&this_arg_conv, sync_path_conv);
+ *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
+ (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
return tag_ptr(ret_conv, true);
}
}
JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1decode_1error(JNIEnv *env, jclass clz, int64_t a) {
- LDKDecodeError a_conv;
- a_conv.inner = untag_ptr(a);
- a_conv.is_owned = ptr_is_owned(a);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
- a_conv = DecodeError_clone(&a_conv);
+ void* a_ptr = untag_ptr(a);
+ CHECK_ACCESS(a_ptr);
+ LDKDecodeError a_conv = *(LDKDecodeError*)(a_ptr);
+ a_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(a));
LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError");
*ret_copy = GraphSyncError_decode_error(a_conv);
int64_t ret_ref = tag_ptr(ret_copy, true);
return ret_ref;
}
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray update_data) {
- LDKRapidGossipSync this_arg_conv;
- this_arg_conv.inner = untag_ptr(this_arg);
- this_arg_conv.is_owned = ptr_is_owned(this_arg);
- CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
- this_arg_conv.is_owned = false;
- LDKu8slice update_data_ref;
- update_data_ref.datalen = (*env)->GetArrayLength(env, update_data);
- update_data_ref.data = (*env)->GetByteArrayElements (env, update_data, NULL);
- LDKCResult_u32GraphSyncErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u32GraphSyncErrorZ), "LDKCResult_u32GraphSyncErrorZ");
- *ret_conv = RapidGossipSync_update_network_graph(&this_arg_conv, update_data_ref);
- (*env)->ReleaseByteArrayElements(env, update_data, (int8_t*)update_data_ref.data, 0);
- return tag_ptr(ret_conv, true);
-}
-
+++ /dev/null
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_ldk_enums_ChannelMonitorUpdateErr */
-
-#ifndef _Included_org_ldk_enums_ChannelMonitorUpdateErr
-#define _Included_org_ldk_enums_ChannelMonitorUpdateErr
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_ldk_enums_ChannelMonitorUpdateErr
- * Method: init
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateErr_init
- (JNIEnv *, jclass);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_enums_ChannelMonitorUpdateStatus */
+
+#ifndef _Included_org_ldk_enums_ChannelMonitorUpdateStatus
+#define _Included_org_ldk_enums_ChannelMonitorUpdateStatus
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_enums_ChannelMonitorUpdateStatus
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_enums_ChannelMonitorUpdateStatus_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_enums_Recipient */
+
+#ifndef _Included_org_ldk_enums_Recipient
+#define _Included_org_ldk_enums_Recipient
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_enums_Recipient
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_enums_Recipient_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKDecodeError_ref_from_ptr
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKDecodeError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CResult_BlindedRouteDecodeErrorZ_get_ok
JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_get_ok
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_get_err
- * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateErr;
- */
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1get_1err
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: LDKMonitorEvent_ref_from_ptr
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1get_1err
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_get_ok
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_get_err
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCOption_ScalarZ_ref_from_ptr
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1closing_1transaction
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: BaseSign_sign_holder_anchor_input
+ * Signature: (J[BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1holder_1anchor_1input
+ (JNIEnv *, jclass, jlong, jbyteArray, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: BaseSign_sign_channel_announcement
/*
* Class: org_ldk_impl_bindings
* Method: Watch_watch_channel
- * Signature: (JJJ)J
+ * Signature: (JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel
(JNIEnv *, jclass, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
* Method: Watch_update_channel
- * Signature: (JJJ)J
+ * Signature: (JJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Watch_1update_1channel
(JNIEnv *, jclass, jlong, jlong, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret
(JNIEnv *, jclass, jlong, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: KeysInterface_get_node_id
+ * Signature: (JLorg/ldk/enums/Recipient;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1id
+ (JNIEnv *, jclass, jlong, jobject);
+
/*
* Class: org_ldk_impl_bindings
* Method: KeysInterface_ecdh
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCustomOnionMessageContents_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKCustomOnionMessageContents;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageContents_tlv_type
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageContents_write
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCOption_CustomOnionMessageContentsZ_ref_from_ptr
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_CustomOnionMessageContentsZ;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKCOption_NetAddressZ_ref_from_ptr
/*
* Class: org_ldk_impl_bindings
* Method: Persist_persist_new_channel
- * Signature: (JJJJ)J
+ * Signature: (JJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel
(JNIEnv *, jclass, jlong, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
* Method: Persist_update_persisted_channel
- * Signature: (JJJJJ)J
+ * Signature: (JJJJJ)Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1channel
(JNIEnv *, jclass, jlong, jlong, jlong, jlong, jlong);
/*
/*
* Class: org_ldk_impl_bindings
* Method: ChannelMessageHandler_peer_connected
- * Signature: (J[BJ)V
+ * Signature: (J[BJ)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1peer_1connected
(JNIEnv *, jclass, jlong, jbyteArray, jlong);
/*
/*
* Class: org_ldk_impl_bindings
* Method: RoutingMessageHandler_peer_connected
- * Signature: (J[BJ)V
+ * Signature: (J[BJ)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1peer_1connected
(JNIEnv *, jclass, jlong, jbyteArray, jlong);
/*
/*
* Class: org_ldk_impl_bindings
* Method: OnionMessageHandler_peer_connected
- * Signature: (J[BJ)V
+ * Signature: (J[BJ)J
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageHandler_1peer_1connected
(JNIEnv *, jclass, jlong, jbyteArray, jlong);
/*
JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_CustomMessageHandler_1get_1and_1clear_1pending_1msg
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKCustomOnionMessageHandler_new
+ * Signature: (Lorg/ldk/impl/bindings/LDKCustomOnionMessageHandler;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageHandler_1new
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageHandler_handle_custom_message
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1handle_1custom_1message
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageHandler_read_custom_message
+ * Signature: (JJ[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1read_1custom_1message
+ (JNIEnv *, jclass, jlong, jlong, jbyteArray);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKSocketDescriptor_new
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxidZ_1free
(JNIEnv *, jclass, jobjectArray);
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_ok
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok
- (JNIEnv *, jclass);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_err
- * Signature: (Lorg/ldk/enums/ChannelMonitorUpdateErr;)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err
- (JNIEnv *, jclass, jobject);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_is_ok
- * Signature: (J)Z
- */
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1is_1ok
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_free
- * Signature: (J)V
- */
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_clone_ptr
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone_1ptr
- (JNIEnv *, jclass, jlong);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: CResult_NoneChannelMonitorUpdateErrZ_clone
- * Signature: (J)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1clone
- (JNIEnv *, jclass, jlong);
-
/*
* Class: org_ldk_impl_bindings
* Method: CVec_MonitorEventZ_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyNoneZ_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_ok
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1ok
+ (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_err
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1err
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_is_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1is_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_PublicKeyNoneZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyNoneZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: COption_ScalarZ_some
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free
(JNIEnv *, jclass, jlongArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_CustomOnionMessageContentsZ_some
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_CustomOnionMessageContentsZ_none
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_CustomOnionMessageContentsZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_CustomOnionMessageContentsZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: COption_CustomOnionMessageContentsZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: COption_NetAddressZ_some
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosureReason_1outdated_1channel_1manager
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosureReason_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosureReason_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ClosureReason_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment
(JNIEnv *, jclass, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: HTLCDestination_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: HTLCDestination_write
/*
* Class: org_ldk_impl_bindings
- * Method: APIError_monitor_update_failed
+ * Method: APIError_monitor_update_in_progress
* Signature: ()J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1in_1progress
(JNIEnv *, jclass);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1incompatible_1shutdown_1script
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: APIError_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_APIError_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: BigSize_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Hostname_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Hostname_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Hostname_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Hostname_len
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelConfig_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelConfig_default
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BestBlock_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: BestBlock_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BestBlock_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: BestBlock_from_genesis
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelMonitorUpdateErr_clone
- * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateErr;
+ * Method: ChannelMonitorUpdateStatus_clone
+ * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1clone
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelMonitorUpdateErr_temporary_failure
- * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateErr;
+ * Method: ChannelMonitorUpdateStatus_completed
+ * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateStatus;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1completed
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelMonitorUpdateStatus_in_progress
+ * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1in_1progress
(JNIEnv *, jclass);
/*
* Class: org_ldk_impl_bindings
- * Method: ChannelMonitorUpdateErr_permanent_failure
- * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateErr;
+ * Method: ChannelMonitorUpdateStatus_permanent_failure
+ * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateStatus;
*/
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1permanent_1failure
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelMonitorUpdateStatus_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateStatus_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Watch_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: WatchedOutput_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WatchedOutput_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: WatchedOutput_hash
/*
* Class: org_ldk_impl_bindings
- * Method: MonitorEvent_update_completed
+ * Method: MonitorEvent_completed
* Signature: (JJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1completed
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1completed
(JNIEnv *, jclass, jlong, jlong);
/*
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1update_1failed
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: MonitorEvent_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: MonitorEvent_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: HTLCUpdate_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: HTLCUpdate_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DelayedPaymentOutputDescriptor_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DelayedPaymentOutputDescriptor_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: DelayedPaymentOutputDescriptor_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: StaticPaymentOutputDescriptor_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_StaticPaymentOutputDescriptor_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: StaticPaymentOutputDescriptor_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: SpendableOutputDescriptor_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: SpendableOutputDescriptor_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: provided_node_features
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_provided_1node_1features
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: provided_channel_features
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_provided_1channel_1features
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: provided_init_features
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_provided_1init_1features
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: CounterpartyForwardingInfo_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_unknown_version
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1version
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_unknown_required_feature
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1unknown_1required_1feature
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_invalid_value
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1invalid_1value
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_short_read
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1short_1read
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_bad_length_descriptor
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1bad_1length_1descriptor
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_io
+ * Signature: (Lorg/ldk/enums/IOError;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1io
+ (JNIEnv *, jclass, jobject);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_unsupported_compression
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DecodeError_1unsupported_1compression
+ (JNIEnv *, jclass);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DecodeError_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DecodeError_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Init_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Init_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Init_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ErrorMessage_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ErrorMessage_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: WarningMessage_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_WarningMessage_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: WarningMessage_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_WarningMessage_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Ping_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Ping_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Ping_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Pong_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Pong_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Pong_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: OpenChannel_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: OpenChannel_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OpenChannel_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: AcceptChannel_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: AcceptChannel_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: FundingCreated_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: FundingCreated_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingCreated_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: FundingSigned_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: FundingSigned_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_FundingSigned_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelReady_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReady_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelReady_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReady_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Shutdown_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: Shutdown_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Shutdown_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ClosingSignedFeeRange_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosingSignedFeeRange_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSignedFeeRange_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ClosingSigned_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosingSigned_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UpdateAddHTLC_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UpdateAddHTLC_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: OnionMessage_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessage_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: OnionMessage_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OnionMessage_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UpdateFulfillHTLC_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UpdateFulfillHTLC_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UpdateFailHTLC_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UpdateFailHTLC_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UpdateFailMalformedHTLC_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UpdateFailMalformedHTLC_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: CommitmentSigned_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CommitmentSigned_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: RevokeAndACK_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: RevokeAndACK_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UpdateFee_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UpdateFee_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UpdateFee_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: DataLossProtect_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: DataLossProtect_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelReestablish_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelReestablish_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: AnnouncementSignatures_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: AnnouncementSignatures_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NetAddress_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1hostname
(JNIEnv *, jclass, jlong, jshort);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NetAddress_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetAddress_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NetAddress_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UnsignedNodeAnnouncement_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NodeAnnouncement_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NodeAnnouncement_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UnsignedChannelAnnouncement_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UnsignedChannelAnnouncement_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelAnnouncement_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelAnnouncement_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: UnsignedChannelUpdate_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: UnsignedChannelUpdate_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelUpdate_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelUpdate_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: QueryChannelRange_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: QueryChannelRange_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ReplyChannelRange_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ReplyChannelRange_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: QueryShortChannelIds_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: QueryShortChannelIds_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ReplyShortChannelIdsEnd_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ReplyShortChannelIdsEnd_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: GossipTimestampFilter_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: GossipTimestampFilter_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ErrorAction_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CommitmentUpdate_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelMessageHandler_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1OnionMessageHandler
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: IgnoringMessageHandler_as_CustomOnionMessageHandler
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_IgnoringMessageHandler_1as_1CustomOnionMessageHandler
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: IgnoringMessageHandler_as_CustomMessageReader
/*
* Class: org_ldk_impl_bindings
* Method: PeerManager_new
- * Signature: (J[BJ[BJJ)J
+ * Signature: (J[BI[BJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new
- (JNIEnv *, jclass, jlong, jbyteArray, jlong, jbyteArray, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jbyteArray, jint, jbyteArray, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new
(JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: TxCreationKeys_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: TxCreationKeys_clone_ptr
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelPublicKeys_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelPublicKeys_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: HTLCOutputInCommitment_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: HTLCOutputInCommitment_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1hash
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ClosingTransaction_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ClosingTransaction_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ClosingTransaction_new
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: InitFeatures_known_channel_features
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known_1channel_1features
- (JNIEnv *, jclass);
-
-/*
- * Class: org_ldk_impl_bindings
- * Method: NodeFeatures_known_channel_features
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known_1channel_1features
- (JNIEnv *, jclass);
-
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_empty
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1empty
(JNIEnv *, jclass);
-/*
- * Class: org_ldk_impl_bindings
- * Method: InitFeatures_known
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InitFeatures_1known
- (JNIEnv *, jclass);
-
/*
* Class: org_ldk_impl_bindings
* Method: InitFeatures_requires_unknown_bits
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1empty
(JNIEnv *, jclass);
-/*
- * Class: org_ldk_impl_bindings
- * Method: NodeFeatures_known
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1known
- (JNIEnv *, jclass);
-
/*
* Class: org_ldk_impl_bindings
* Method: NodeFeatures_requires_unknown_bits
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1empty
(JNIEnv *, jclass);
-/*
- * Class: org_ldk_impl_bindings
- * Method: ChannelFeatures_known
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1known
- (JNIEnv *, jclass);
-
/*
* Class: org_ldk_impl_bindings
* Method: ChannelFeatures_requires_unknown_bits
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty
(JNIEnv *, jclass);
-/*
- * Class: org_ldk_impl_bindings
- * Method: InvoiceFeatures_known
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1known
- (JNIEnv *, jclass);
-
/*
* Class: org_ldk_impl_bindings
* Method: InvoiceFeatures_requires_unknown_bits
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty
(JNIEnv *, jclass);
-/*
- * Class: org_ldk_impl_bindings
- * Method: ChannelTypeFeatures_known
- * Signature: ()J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1known
- (JNIEnv *, jclass);
-
/*
* Class: org_ldk_impl_bindings
* Method: ChannelTypeFeatures_requires_unknown_bits
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ShutdownScript_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ShutdownScript_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: InvalidShutdownScript_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1node_1failure
(JNIEnv *, jclass, jbyteArray, jboolean);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NetworkUpdate_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NetworkUpdate_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NetworkUpdate_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelUpdateInfo_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelUpdateInfo_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelUpdateInfo_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ChannelInfo_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ChannelInfo_get_directional_info
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NodeAnnouncementInfo_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NodeAnnouncementInfo_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAlias_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NodeAlias_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeAlias_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NodeAlias_write
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1clone
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: NodeInfo_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_NodeInfo_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: NodeInfo_write
/*
* Class: org_ldk_impl_bindings
- * Method: NetworkGraph_node_failed
- * Signature: (J[BZ)V
+ * Method: NetworkGraph_node_failed_permanent
+ * Signature: (J[B)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed
- (JNIEnv *, jclass, jlong, jbyteArray, jboolean);
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1node_1failed_1permanent
+ (JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
- * Method: NetworkGraph_remove_stale_channels
+ * Method: NetworkGraph_remove_stale_channels_and_tracking
* Signature: (J)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking
(JNIEnv *, jclass, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: NetworkGraph_remove_stale_channels_with_time
+ * Method: NetworkGraph_remove_stale_channels_and_tracking_with_time
* Signature: (JJ)V
*/
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1with_1time
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1remove_1stale_1channels_1and_1tracking_1with_1time
(JNIEnv *, jclass, jlong, jlong);
/*
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1liquidity_1penalty_1amount_1multiplier_1msat
(JNIEnv *, jclass, jlong, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ProbabilisticScoringParameters_get_historical_liquidity_penalty_multiplier_msat
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1multiplier_1msat
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ProbabilisticScoringParameters_set_historical_liquidity_penalty_multiplier_msat
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1multiplier_1msat
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ProbabilisticScoringParameters_get_historical_liquidity_penalty_amount_multiplier_msat
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1liquidity_1penalty_1amount_1multiplier_1msat
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ProbabilisticScoringParameters_set_historical_liquidity_penalty_amount_multiplier_msat
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1liquidity_1penalty_1amount_1multiplier_1msat
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ProbabilisticScoringParameters_get_historical_no_updates_half_life
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1get_1historical_1no_1updates_1half_1life
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ProbabilisticScoringParameters_set_historical_no_updates_half_life
+ * Signature: (JJ)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ProbabilisticScoringParameters_1set_1historical_1no_1updates_1half_1life
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ProbabilisticScoringParameters_get_anti_probing_penalty_msat
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1first_1hop
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: SendError_invalid_message
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message
+ (JNIEnv *, jclass);
+
/*
* Class: org_ldk_impl_bindings
* Method: SendError_buffer_full
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: SendError_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageHandler_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageHandler_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: OnionMessenger_new
- * Signature: (JJ)J
+ * Signature: (JJJ)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new
- (JNIEnv *, jclass, jlong, jlong);
+ (JNIEnv *, jclass, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
- * Method: OnionMessenger_send_onion_message
- * Signature: (J[[BJJ)J
+ * Method: OnionMessenger_send_custom_onion_message
+ * Signature: (J[[BJJJ)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message
- (JNIEnv *, jclass, jlong, jobjectArray, jlong, jlong);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message
+ (JNIEnv *, jclass, jlong, jobjectArray, jlong, jlong, jlong);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageProvider
(JNIEnv *, jclass, jlong);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageContents_clone_ptr
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone_1ptr
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageContents_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1clone
+ (JNIEnv *, jclass, jlong);
+
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: CustomOnionMessageContents_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1free
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: FilesystemPersister_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParseError_1skip
(JNIEnv *, jclass);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ParseError_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseError_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: ParseOrSemanticError_free
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1semantic_1error
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: ParseOrSemanticError_eq
+ * Signature: (JJ)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ParseOrSemanticError_1eq
+ (JNIEnv *, jclass, jlong, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: Invoice_free
/*
* Class: org_ldk_impl_bindings
* Method: create_phantom_invoice
- * Signature: (J[BLjava/lang/String;I[JJLorg/ldk/enums/Currency;)J
+ * Signature: (J[BLjava/lang/String;I[JJJLorg/ldk/enums/Currency;)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice
- (JNIEnv *, jclass, jlong, jbyteArray, jstring, jint, jlongArray, jlong, jobject);
+ (JNIEnv *, jclass, jlong, jbyteArray, jstring, jint, jlongArray, jlong, jlong, jobject);
/*
* Class: org_ldk_impl_bindings
* Method: create_phantom_invoice_with_description_hash
- * Signature: (J[BIJ[JJLorg/ldk/enums/Currency;)J
+ * Signature: (J[BIJ[JJJLorg/ldk/enums/Currency;)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1phantom_1invoice_1with_1description_1hash
- (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong, jlongArray, jlong, jobject);
+ (JNIEnv *, jclass, jlong, jbyteArray, jint, jlong, jlongArray, jlong, jlong, jobject);
/*
* Class: org_ldk_impl_bindings
* Method: create_invoice_from_channelmanager
- * Signature: (JJLorg/ldk/enums/Currency;JLjava/lang/String;I)J
+ * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;I)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager
- (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring, jint);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jint);
/*
* Class: org_ldk_impl_bindings
* Method: create_invoice_from_channelmanager_with_description_hash
- * Signature: (JJLorg/ldk/enums/Currency;JJI)J
+ * Signature: (JJJLorg/ldk/enums/Currency;JJI)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash
- (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jlong, jint);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jlong, jint);
/*
* Class: org_ldk_impl_bindings
* Method: create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch
- * Signature: (JJLorg/ldk/enums/Currency;JJJI)J
+ * Signature: (JJJLorg/ldk/enums/Currency;JJJI)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1with_1description_1hash_1and_1duration_1since_1epoch
- (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jlong, jlong, jint);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jlong, jlong, jint);
/*
* Class: org_ldk_impl_bindings
* Method: create_invoice_from_channelmanager_and_duration_since_epoch
- * Signature: (JJLorg/ldk/enums/Currency;JLjava/lang/String;JI)J
+ * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;JI)J
*/
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch
- (JNIEnv *, jclass, jlong, jlong, jobject, jlong, jstring, jlong, jint);
+ (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jlong, jint);
/*
* Class: org_ldk_impl_bindings
/*
* Class: org_ldk_impl_bindings
- * Method: RapidGossipSync_sync_network_graph_with_file_path
- * Signature: (JLjava/lang/String;)J
+ * Method: RapidGossipSync_update_network_graph
+ * Signature: (J[B)J
*/
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1sync_1network_1graph_1with_1file_1path
- (JNIEnv *, jclass, jlong, jstring);
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph
+ (JNIEnv *, jclass, jlong, jbyteArray);
/*
* Class: org_ldk_impl_bindings
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GraphSyncError_1lightning_1error
(JNIEnv *, jclass, jlong);
-/*
- * Class: org_ldk_impl_bindings
- * Method: RapidGossipSync_update_network_graph
- * Signature: (J[B)J
- */
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RapidGossipSync_1update_1network_1graph
- (JNIEnv *, jclass, jlong, jbyteArray);
-
#ifdef __cplusplus
}
#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKBech32Error */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKBech32Error
+#define _Included_org_ldk_impl_bindings_LDKBech32Error
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKBech32Error
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKBech32Error_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_C2Tuple_u64u64ZZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_u64u64ZZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_C2Tuple_u64u64ZZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_C2Tuple_u64u64ZZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C2Tuple_1u64u64ZZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_CustomOnionMessageContentsZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_CustomOnionMessageContentsZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_CustomOnionMessageContentsZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_CustomOnionMessageContentsZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1CustomOnionMessageContentsZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_HTLCDestinationZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_HTLCDestinationZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_HTLCDestinationZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_HTLCDestinationZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCDestinationZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_NetAddressZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_NetAddressZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_NetAddressZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_NetAddressZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1NetAddressZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_ScalarZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_ScalarZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_ScalarZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_ScalarZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1ScalarZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKCOption_WriteableScoreZ */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKCOption_WriteableScoreZ
+#define _Included_org_ldk_impl_bindings_LDKCOption_WriteableScoreZ
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKCOption_WriteableScoreZ
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1WriteableScoreZ_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKDecodeError */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKDecodeError
+#define _Included_org_ldk_impl_bindings_LDKDecodeError
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKDecodeError
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDecodeError_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKDestination */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKDestination
+#define _Included_org_ldk_impl_bindings_LDKDestination
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKDestination
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKEffectiveCapacity */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKEffectiveCapacity
+#define _Included_org_ldk_impl_bindings_LDKEffectiveCapacity
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKEffectiveCapacity
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEffectiveCapacity_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKGossipSync */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKGossipSync
+#define _Included_org_ldk_impl_bindings_LDKGossipSync
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKGossipSync
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGossipSync_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKGraphSyncError */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKGraphSyncError
+#define _Included_org_ldk_impl_bindings_LDKGraphSyncError
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKGraphSyncError
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKGraphSyncError_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKHTLCDestination */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKHTLCDestination
+#define _Included_org_ldk_impl_bindings_LDKHTLCDestination
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKHTLCDestination
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKParseError */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKParseError
+#define _Included_org_ldk_impl_bindings_LDKParseError
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKParseError
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKParseOrSemanticError */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKParseOrSemanticError
+#define _Included_org_ldk_impl_bindings_LDKParseOrSemanticError
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKParseOrSemanticError
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKRetry */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKRetry
+#define _Included_org_ldk_impl_bindings_LDKRetry
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKRetry
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKRetry_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
--- /dev/null
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKSendError */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKSendError
+#define _Included_org_ldk_impl_bindings_LDKSendError
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: org_ldk_impl_bindings_LDKSendError
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif