From: Matt Corallo Date: Wed, 23 Jun 2021 00:19:33 +0000 (+0000) Subject: Update auto-generated bindings X-Git-Tag: v0.0.98.4~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=d464171d32fed0612d4572defd49e78696e8bc17;p=ldk-java Update auto-generated bindings --- diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 49f921d2..cca825ac 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -48,7 +48,7 @@ public class bindings { static native String get_lib_version_string(); public static String get_ldk_java_bindings_version() { - return "v0.0.98.2"; + return "v0.0.98.3"; } public static native String get_ldk_c_bindings_version(); public static native String get_ldk_version(); diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 68b11b17..07a072ac 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -133,7 +133,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) { } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) { - return str_ref_to_java(env, "v0.0.98.2", strlen("v0.0.98.2")); + return str_ref_to_java(env, "v0.0.98.3", strlen("v0.0.98.3")); } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) { return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version())); @@ -2139,6 +2139,10 @@ LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, ui jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKPublicKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 33); (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); @@ -2159,6 +2163,10 @@ LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_a jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); @@ -2179,6 +2187,10 @@ LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); @@ -2207,6 +2219,10 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2234,6 +2250,10 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2259,6 +2279,10 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2292,6 +2316,10 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2325,6 +2353,10 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2348,6 +2380,10 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2375,6 +2411,10 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2402,6 +2442,10 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2647,6 +2691,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called 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"); @@ -3313,6 +3361,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3346,6 +3398,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3365,6 +3421,10 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_MonitorEventZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -3502,6 +3562,10 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -3584,6 +3648,10 @@ LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKSecretKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.bytes); @@ -3604,6 +3672,10 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called 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"); @@ -3625,6 +3697,10 @@ LDKPublicKey get_shutdown_pubkey_LDKKeysInterface_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_shutdown_pubkey_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKPublicKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 33); (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); @@ -3645,6 +3721,10 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKSign* ret = (LDKSign*)(*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound, channel_value_satoshis); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1); ret_conv = Sign_clone(ret); if (get_jenv_res == JNI_EDETACHED) { @@ -3664,6 +3744,10 @@ LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* thi jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); @@ -3687,6 +3771,10 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignDecodeErrorZ* ret = (LDKCResult_SignDecodeErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3710,6 +3798,10 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_RecoverableSignatureNoneZ* ret = (LDKCResult_RecoverableSignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_preimage_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3857,6 +3949,10 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -3933,6 +4029,10 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -5968,6 +6068,10 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -6068,6 +6172,10 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6142,6 +6250,10 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, (uint64_t)ret); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6220,6 +6332,10 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6304,6 +6420,10 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6322,6 +6442,10 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6424,6 +6548,10 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6442,6 +6570,10 @@ void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_ jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6460,6 +6592,10 @@ void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6476,6 +6612,10 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_TxidZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -6626,6 +6766,10 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6649,6 +6793,10 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCOption_C2Tuple_usizeTransactionZZ* ret = (LDKCOption_C2Tuple_usizeTransactionZZ*)(*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1); ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6762,6 +6910,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, id_ref, data_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6804,6 +6956,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6944,6 +7100,10 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6977,6 +7137,10 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7003,6 +7167,10 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7029,6 +7197,10 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7055,6 +7227,10 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7089,6 +7265,10 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7115,6 +7295,10 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7141,6 +7325,10 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7167,6 +7355,10 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7193,6 +7385,10 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7219,6 +7415,10 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7245,6 +7445,10 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7271,6 +7475,10 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7297,6 +7505,10 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7323,6 +7535,10 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7341,6 +7557,10 @@ void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7367,6 +7587,10 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl 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); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7393,6 +7617,10 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7419,6 +7647,10 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7445,6 +7677,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7818,6 +8054,10 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -7845,6 +8085,10 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -7872,6 +8116,10 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -7892,6 +8140,10 @@ void handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_htlc_fail_channel_update_meth, ret_update); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7908,6 +8160,10 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -7941,6 +8197,10 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_NodeAnnouncementZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -7984,6 +8244,10 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8009,6 +8273,10 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8037,6 +8305,10 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8065,6 +8337,10 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8093,6 +8369,10 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8342,6 +8622,10 @@ uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, b jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8359,6 +8643,10 @@ void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8377,6 +8665,10 @@ bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescripto jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, (uint64_t)other_arg_clone); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8394,6 +8686,10 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8500,6 +8796,10 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneErrorZ* ret = (LDKCResult_NoneErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -25582,3 +25882,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *e return ret_conv; } +// __cxa_thread_atexit_impl is used to more effeciently cleanup per-thread local storage by rust libstd. +// However, it is not available on glibc versions 2.17 or earlier, and rust libstd has a null-check and fallback in case it is missing. +// Because it is weak-linked on the rust side, we can simply define it explicitly here, forcing rust to use the fallback. +void *__cxa_thread_atexit_impl = NULL; diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index e3fe4d19..3b7d9625 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -131,7 +131,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) { } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) { - return str_ref_to_java(env, "v0.0.98.2", strlen("v0.0.98.2")); + return str_ref_to_java(env, "v0.0.98.3", strlen("v0.0.98.3")); } JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) { return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version())); @@ -2137,6 +2137,10 @@ LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, ui jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_per_commitment_point_meth, idx); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKPublicKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 33); (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); @@ -2157,6 +2161,10 @@ LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_a jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_commitment_secret_meth, idx); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); @@ -2177,6 +2185,10 @@ LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->channel_keys_id_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); @@ -2205,6 +2217,10 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_L jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_commitment_meth, commitment_tx_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2232,6 +2248,10 @@ LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htl jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_holder_commitment_and_htlcs_meth, commitment_tx_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2257,6 +2277,10 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_output_LDKBaseSign_jcall(const vo jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_output_meth, justice_tx_arr, input, amount, per_commitment_key_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2290,6 +2314,10 @@ LDKCResult_SignatureNoneZ sign_justice_revoked_htlc_LDKBaseSign_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_justice_revoked_htlc_meth, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2323,6 +2351,10 @@ LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_LDKBaseSign_jcall(c jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2346,6 +2378,10 @@ LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_closing_transaction_meth, closing_tx_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2373,6 +2409,10 @@ LDKCResult_SignatureNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_channel_announcement_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignatureNoneZ_clone((LDKCResult_SignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -2400,6 +2440,10 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -2645,6 +2689,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->write_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called 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"); @@ -3311,6 +3359,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3344,6 +3396,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->update_channel_meth, funding_txo_ref, update_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3363,6 +3419,10 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->release_pending_monitor_events_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_MonitorEventZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -3500,6 +3560,10 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->broadcast_transaction_meth, tx_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -3582,6 +3646,10 @@ LDKSecretKey get_node_secret_LDKKeysInterface_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_node_secret_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKSecretKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.bytes); @@ -3602,6 +3670,10 @@ LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_destination_script_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called 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"); @@ -3623,6 +3695,10 @@ LDKPublicKey get_shutdown_pubkey_LDKKeysInterface_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_shutdown_pubkey_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKPublicKey ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 33); (*env)->GetByteArrayRegion(env, ret, 0, 33, ret_ref.compressed_form); @@ -3643,6 +3719,10 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKSign* ret = (LDKSign*)(*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound, channel_value_satoshis); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKSign ret_conv = *(LDKSign*)(((uint64_t)ret) & ~1); ret_conv = Sign_clone(ret); if (get_jenv_res == JNI_EDETACHED) { @@ -3662,6 +3742,10 @@ LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* thi jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_secure_random_bytes_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKThirtyTwoBytes ret_ref; CHECK((*env)->GetArrayLength(env, ret) == 32); (*env)->GetByteArrayRegion(env, ret, 0, 32, ret_ref.data); @@ -3685,6 +3769,10 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_SignDecodeErrorZ* ret = (LDKCResult_SignDecodeErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->read_chan_signer_meth, reader_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_SignDecodeErrorZ_clone((LDKCResult_SignDecodeErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3708,6 +3796,10 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_RecoverableSignatureNoneZ* ret = (LDKCResult_RecoverableSignatureNoneZ*)(*env)->CallLongMethod(env, obj, j_calls->sign_invoice_meth, invoice_preimage_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -3855,6 +3947,10 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int32_t ret = (*env)->CallIntMethod(env, obj, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -3931,6 +4027,10 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->log_meth, record_conv); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -5966,6 +6066,10 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_and_clear_pending_msg_events_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -6066,6 +6170,10 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6140,6 +6248,10 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->process_pending_events_meth, (uint64_t)ret); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6218,6 +6330,10 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6302,6 +6418,10 @@ void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uin jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->block_connected_meth, block_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6320,6 +6440,10 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->block_disconnected_meth, header_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6422,6 +6546,10 @@ void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->transactions_confirmed_meth, header_arr, txdata_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6440,6 +6568,10 @@ void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_ jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->transaction_unconfirmed_meth, txid_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6458,6 +6590,10 @@ void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->best_block_updated_meth, header_arr, height); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6474,6 +6610,10 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_TxidZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -6624,6 +6764,10 @@ void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32 jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->register_tx_meth, txid_arr, script_pubkey_arr); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6647,6 +6791,10 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCOption_C2Tuple_usizeTransactionZZ* ret = (LDKCOption_C2Tuple_usizeTransactionZZ*)(*env)->CallLongMethod(env, obj, j_calls->register_output_meth, output_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1); ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6760,6 +6908,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(con jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->persist_new_channel_meth, id_ref, data_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6802,6 +6954,10 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, obj, j_calls->update_persisted_channel_meth, id_ref, update_ref, data_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -6942,6 +7098,10 @@ void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LD jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_open_channel_meth, their_node_id_arr, their_features_ref, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -6975,6 +7135,10 @@ void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_accept_channel_meth, their_node_id_arr, their_features_ref, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7001,6 +7165,10 @@ void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_created_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7027,6 +7195,10 @@ void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_signed_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7053,6 +7225,10 @@ void handle_funding_locked_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_funding_locked_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7087,6 +7263,10 @@ void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPub jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_shutdown_meth, their_node_id_arr, their_features_ref, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7113,6 +7293,10 @@ void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_closing_signed_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7139,6 +7323,10 @@ void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_add_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7165,6 +7353,10 @@ void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_ jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fulfill_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7191,6 +7383,10 @@ void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7217,6 +7413,10 @@ void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7243,6 +7443,10 @@ void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_ar jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_commitment_signed_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7269,6 +7473,10 @@ void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_revoke_and_ack_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7295,6 +7503,10 @@ void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_update_fee_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7321,6 +7533,10 @@ void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* t jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_announcement_signatures_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7339,6 +7555,10 @@ void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKP jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->peer_disconnected_meth, their_node_id_arr, no_connection_possible); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7365,6 +7585,10 @@ void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPubl 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); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7391,6 +7615,10 @@ void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_ jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_reestablish_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7417,6 +7645,10 @@ void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_channel_update_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7443,6 +7675,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_error_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7816,6 +8052,10 @@ LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_node_announcement_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -7843,6 +8083,10 @@ LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHand jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_channel_announcement_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -7870,6 +8114,10 @@ LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jc jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_channel_update_meth, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_boolLightningErrorZ_clone((LDKCResult_boolLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -7890,6 +8138,10 @@ void handle_htlc_fail_channel_update_LDKRoutingMessageHandler_jcall(const void* jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->handle_htlc_fail_channel_update_meth, ret_update); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -7906,6 +8158,10 @@ LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -7939,6 +8195,10 @@ LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_j jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_next_node_announcements_meth, starting_point_arr, batch_amount); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCVec_NodeAnnouncementZ ret_constr; ret_constr.datalen = (*env)->GetArrayLength(env, ret); if (ret_constr.datalen > 0) @@ -7982,6 +8242,10 @@ void sync_routing_table_LDKRoutingMessageHandler_jcall(const void* this_arg, LDK jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->sync_routing_table_meth, their_node_id_arr, init_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8007,6 +8271,10 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_reply_channel_range_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8035,6 +8303,10 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_reply_short_channel_ids_end_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8063,6 +8335,10 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_query_channel_range_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8091,6 +8367,10 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneLightningErrorZ* ret = (LDKCResult_NoneLightningErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->handle_query_short_channel_ids_meth, their_node_id_arr, msg_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { @@ -8340,6 +8620,10 @@ uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, b jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_data_meth, data_arr, resume_read); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8357,6 +8641,10 @@ void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); (*env)->CallVoidMethod(env, obj, j_calls->disconnect_socket_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8375,6 +8663,10 @@ bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescripto jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); jboolean ret = (*env)->CallBooleanMethod(env, obj, j_calls->eq_meth, (uint64_t)other_arg_clone); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8392,6 +8684,10 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); int64_t ret = (*env)->CallLongMethod(env, obj, j_calls->hash_meth); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -8498,6 +8794,10 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); LDKCResult_NoneErrorZ* ret = (LDKCResult_NoneErrorZ*)(*env)->CallLongMethod(env, obj, j_calls->persist_manager_meth, channel_manager_ref); + if ((*env)->ExceptionCheck(env)) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A Java interface method called from rust threw an exception."); + } LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1); ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1)); if (get_jenv_res == JNI_EDETACHED) { diff --git a/src/main/resources/liblightningjni_Linux-amd64.nativelib b/src/main/resources/liblightningjni_Linux-amd64.nativelib index 8acc71a4..d452617b 100755 Binary files a/src/main/resources/liblightningjni_Linux-amd64.nativelib and b/src/main/resources/liblightningjni_Linux-amd64.nativelib differ diff --git a/src/main/resources/liblightningjni_MacOSX-aarch64.nativelib b/src/main/resources/liblightningjni_MacOSX-aarch64.nativelib index 06f615e8..af484b91 100755 Binary files a/src/main/resources/liblightningjni_MacOSX-aarch64.nativelib and b/src/main/resources/liblightningjni_MacOSX-aarch64.nativelib differ diff --git a/src/main/resources/liblightningjni_MacOSX-x86_64.nativelib b/src/main/resources/liblightningjni_MacOSX-x86_64.nativelib index 2c5b8ca7..f6c9cfe8 100755 Binary files a/src/main/resources/liblightningjni_MacOSX-x86_64.nativelib and b/src/main/resources/liblightningjni_MacOSX-x86_64.nativelib differ