summaryrefslogtreecommitdiff
path: root/patches/zano
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2025-02-18 04:33:30 +0100
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2025-02-18 04:33:30 +0100
commit85ee6e4d8a9de7b70b2ad10d1f351cd2dd43055e (patch)
treef3552cb523410e82abefd5d973b3d7502a7860f0 /patches/zano
parent9d9b1f2f2373fc9a99c6556a93eea63fe343cf58 (diff)
zano: add keys to open_wallet_responsecyjan-zano-fix-missing-keys
Diffstat (limited to 'patches/zano')
-rw-r--r--patches/zano/0009-add-keys-to-open_wallet_response.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/patches/zano/0009-add-keys-to-open_wallet_response.patch b/patches/zano/0009-add-keys-to-open_wallet_response.patch
new file mode 100644
index 0000000..1ca4952
--- /dev/null
+++ b/patches/zano/0009-add-keys-to-open_wallet_response.patch
@@ -0,0 +1,83 @@
+From 8f6c62f969ee38e7db5a0e639cd08216ba79d6d1 Mon Sep 17 00:00:00 2001
+From: Czarek Nakamoto <cyjan@mrcyjanek.net>
+Date: Tue, 18 Feb 2025 04:29:30 +0100
+Subject: [PATCH] add keys to open_wallet_response
+
+---
+ src/wallet/view_iface.h | 8 ++++++++
+ src/wallet/wallets_manager.cpp | 19 +++++++++++++++++++
+ 2 files changed, 27 insertions(+)
+
+diff --git a/src/wallet/view_iface.h b/src/wallet/view_iface.h
+index dce4b5ee0..bda58d05f 100644
+--- a/src/wallet/view_iface.h
++++ b/src/wallet/view_iface.h
+@@ -452,6 +452,10 @@ public:
+ transfers_array recent_history;
+ wallet_info wi;
+ std::string seed;
++ std::string private_spend_key;
++ std::string private_view_key;
++ std::string public_spend_key;
++ std::string public_view_key;
+ bool recovered;
+ uint64_t wallet_local_bc_size;
+ uint64_t wallet_file_size;
+@@ -463,6 +467,10 @@ public:
+ KV_SERIALIZE(recent_history)
+ KV_SERIALIZE(wi)
+ KV_SERIALIZE(seed)
++ KV_SERIALIZE(private_spend_key)
++ KV_SERIALIZE(private_view_key)
++ KV_SERIALIZE(public_spend_key)
++ KV_SERIALIZE(public_view_key)
+ KV_SERIALIZE(recovered)
+ KV_SERIALIZE(wallet_local_bc_size)
+ KV_SERIALIZE(wallet_file_size)
+diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp
+index 8859ec8d7..7155771d2 100644
+--- a/src/wallet/wallets_manager.cpp
++++ b/src/wallet/wallets_manager.cpp
+@@ -1086,6 +1086,13 @@ std::string wallets_manager::open_wallet(const std::wstring& path, const std::st
+
+ //workaround for missed fee
+ owr.seed = w->get_account().get_seed_phrase("");
++ auto& keys = w->get_account().get_keys();
++
++ owr.private_view_key = epee::string_tools::pod_to_hex(keys.view_secret_key);
++ owr.public_view_key = epee::string_tools::pod_to_hex(keys.account_address.view_public_key);
++ owr.private_spend_key = epee::string_tools::pod_to_hex(keys.spend_secret_key);
++ owr.public_spend_key = epee::string_tools::pod_to_hex(keys.account_address.spend_public_key);
++ // open_wallet_response
+ break;
+ }
+ catch (const tools::error::file_not_found& /**/)
+@@ -1197,6 +1204,12 @@ std::string wallets_manager::generate_wallet(const std::wstring& path, const std
+ w->generate(path, password, false);
+ w->set_minimum_height(m_last_daemon_height-1);
+ owr.seed = w->get_account().get_seed_phrase("");
++ auto& keys = w->get_account().get_keys();
++
++ owr.private_view_key = epee::string_tools::pod_to_hex(keys.view_secret_key);
++ owr.public_view_key = epee::string_tools::pod_to_hex(keys.account_address.view_public_key);
++ owr.private_spend_key = epee::string_tools::pod_to_hex(keys.spend_secret_key);
++ owr.public_spend_key = epee::string_tools::pod_to_hex(keys.account_address.spend_public_key);
+ }
+ catch (const tools::error::file_exists&)
+ {
+@@ -1306,6 +1319,12 @@ std::string wallets_manager::restore_wallet(const std::wstring& path, const std:
+ bool is_tracking = currency::account_base::is_seed_tracking(seed_phrase);
+ w->restore(path, password, seed_phrase, is_tracking, seed_password);
+ owr.seed = w->get_account().get_seed_phrase("");
++ auto& keys = w->get_account().get_keys();
++
++ owr.private_view_key = epee::string_tools::pod_to_hex(keys.view_secret_key);
++ owr.public_view_key = epee::string_tools::pod_to_hex(keys.account_address.view_public_key);
++ owr.private_spend_key = epee::string_tools::pod_to_hex(keys.spend_secret_key);
++ owr.public_spend_key = epee::string_tools::pod_to_hex(keys.account_address.spend_public_key);
+ }
+ catch (const tools::error::file_exists&)
+ {
+--
+2.48.1
+