diff --git a/src/wallet/view_iface.h b/src/wallet/view_iface.h index c8af4a5c..35b20d4f 100644 --- a/src/wallet/view_iface.h +++ b/src/wallet/view_iface.h @@ -432,6 +432,7 @@ public: std::string seed; bool recovered; uint64_t wallet_local_bc_size; + uint64_t wallet_file_size; BEGIN_KV_SERIALIZE_MAP() KV_SERIALIZE(wallet_id) @@ -440,6 +441,7 @@ public: KV_SERIALIZE(seed) KV_SERIALIZE(recovered) KV_SERIALIZE(wallet_local_bc_size) + KV_SERIALIZE(wallet_file_size) END_KV_SERIALIZE_MAP() }; diff --git a/src/wallet/wallet_public_structs_defs.h b/src/wallet/wallet_public_structs_defs.h index 574a1ba6..da115c33 100644 --- a/src/wallet/wallet_public_structs_defs.h +++ b/src/wallet/wallet_public_structs_defs.h @@ -359,7 +359,10 @@ namespace wallet_public struct response { + uint64_t wallet_file_size; + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(wallet_file_size) END_KV_SERIALIZE_MAP() }; }; diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 040ef071..c9fb111b 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -350,6 +350,8 @@ namespace tools { WALLET_RPC_BEGIN_TRY_ENTRY(); m_wallet.store(); + boost::system::error_code ec = AUTO_VAL_INIT(ec); + res.wallet_file_size = boost::filesystem::file_size(m_wallet.get_wallet_path(), ec); WALLET_RPC_CATCH_TRY_ENTRY(); return true; } diff --git a/src/wallet/wallets_manager.cpp b/src/wallet/wallets_manager.cpp index 6bd89cde..79e979eb 100644 --- a/src/wallet/wallets_manager.cpp +++ b/src/wallet/wallets_manager.cpp @@ -794,7 +794,8 @@ std::string wallets_manager::open_wallet(const std::wstring& path, const std::st } } EXCLUSIVE_CRITICAL_REGION_LOCAL(m_wallets_lock); - + boost::system::error_code ec = AUTO_VAL_INIT(ec); + owr.wallet_file_size = boost::filesystem::file_size(path, ec); wallet_vs_options& wo = m_wallets[owr.wallet_id]; **wo.w = w; get_wallet_info(wo, owr.wi);