forked from lthn/blockchain
added wallet size to open/store api
This commit is contained in:
parent
e6616cd225
commit
b97065beba
4 changed files with 9 additions and 1 deletions
|
|
@ -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()
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue