From a6134fcebc9928b8a1e90623b136e4e4a309fc64 Mon Sep 17 00:00:00 2001 From: cyan Date: Mon, 30 Dec 2024 16:15:33 +0000 Subject: [PATCH] fix wownero crashing issue --- impls/monero.dart/lib/src/checksum_wownero.dart | 2 +- impls/monero.ts/checksum_wownero.ts | 2 +- wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp | 8 ++++++-- wownero_libwallet2_api_c/src/main/cpp/wownero_checksum.h | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/impls/monero.dart/lib/src/checksum_wownero.dart b/impls/monero.dart/lib/src/checksum_wownero.dart index 615a989..bada1f4 100644 --- a/impls/monero.dart/lib/src/checksum_wownero.dart +++ b/impls/monero.dart/lib/src/checksum_wownero.dart @@ -1,4 +1,4 @@ // ignore_for_file: constant_identifier_names const String wallet2_api_c_h_sha256 = "f99009d1ca1d1c783cc9aa0fb63f680d48753b88124fb5de2079c57b7e34c827"; -const String wallet2_api_c_cpp_sha256 = "880add77ec8c77d8054a6f21e996d6d08a37ef84e10df7220630426fd048b43c-dd46a31f3cab67b316e9239b15acf7d5cea60aa9"; +const String wallet2_api_c_cpp_sha256 = "70b39a0bef660cb9ba0397117eb1590e18461ace89ab18141690658a2a537d5d-dd46a31f3cab67b316e9239b15acf7d5cea60aa9"; const String wallet2_api_c_exp_sha256 = "5f53ea8bbe66a5e5aa6cbc4ca00695900e08589cfd32062e88965a24252d05ba"; diff --git a/impls/monero.ts/checksum_wownero.ts b/impls/monero.ts/checksum_wownero.ts index 2a6007f..7e0c8cd 100644 --- a/impls/monero.ts/checksum_wownero.ts +++ b/impls/monero.ts/checksum_wownero.ts @@ -1,5 +1,5 @@ export const wowneroChecksum = { wallet2_api_c_h_sha256: "f99009d1ca1d1c783cc9aa0fb63f680d48753b88124fb5de2079c57b7e34c827", - wallet2_api_c_cpp_sha256: "880add77ec8c77d8054a6f21e996d6d08a37ef84e10df7220630426fd048b43c-dd46a31f3cab67b316e9239b15acf7d5cea60aa9", + wallet2_api_c_cpp_sha256: "70b39a0bef660cb9ba0397117eb1590e18461ace89ab18141690658a2a537d5d-dd46a31f3cab67b316e9239b15acf7d5cea60aa9", wallet2_api_c_exp_sha256: "5f53ea8bbe66a5e5aa6cbc4ca00695900e08589cfd32062e88965a24252d05ba", } diff --git a/wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp b/wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp index 0d53cb5..44887f6 100644 --- a/wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp +++ b/wownero_libwallet2_api_c/src/main/cpp/wallet2_api_c.cpp @@ -2454,8 +2454,12 @@ void* WOWNERO_deprecated_restore14WordSeed(char *path, char *password, char *see uint64_t WOWNERO_deprecated_14WordSeedHeight(char *seed) { DEBUG_START() - wownero_seed wow_seed(seed, "wownero"); - return wow_seed.blockheight(); + try { + wownero_seed wow_seed(seed, "wownero"); + return wow_seed.blockheight(); + } catch(...) { + return 1; + } DEBUG_END() } diff --git a/wownero_libwallet2_api_c/src/main/cpp/wownero_checksum.h b/wownero_libwallet2_api_c/src/main/cpp/wownero_checksum.h index 60a7112..e366e07 100644 --- a/wownero_libwallet2_api_c/src/main/cpp/wownero_checksum.h +++ b/wownero_libwallet2_api_c/src/main/cpp/wownero_checksum.h @@ -1,6 +1,6 @@ #ifndef MONEROC_CHECKSUMS #define MONEROC_CHECKSUMS const char * WOWNERO_wallet2_api_c_h_sha256 = "f99009d1ca1d1c783cc9aa0fb63f680d48753b88124fb5de2079c57b7e34c827"; -const char * WOWNERO_wallet2_api_c_cpp_sha256 = "880add77ec8c77d8054a6f21e996d6d08a37ef84e10df7220630426fd048b43c-dd46a31f3cab67b316e9239b15acf7d5cea60aa9"; +const char * WOWNERO_wallet2_api_c_cpp_sha256 = "70b39a0bef660cb9ba0397117eb1590e18461ace89ab18141690658a2a537d5d-dd46a31f3cab67b316e9239b15acf7d5cea60aa9"; const char * WOWNERO_wallet2_api_c_exp_sha256 = "5f53ea8bbe66a5e5aa6cbc4ca00695900e08589cfd32062e88965a24252d05ba"; #endif