mirror of
https://github.com/monero-project/monero.git
synced 2024-12-11 03:54:20 -05:00
wallet_rpc_server: error out on getting the spend key from a hot wallet
This commit is contained in:
parent
cd1eaff29e
commit
36c037ec47
@ -1832,7 +1832,7 @@ namespace tools
|
|||||||
if (m_wallet->watch_only())
|
if (m_wallet->watch_only())
|
||||||
{
|
{
|
||||||
er.code = WALLET_RPC_ERROR_CODE_WATCH_ONLY;
|
er.code = WALLET_RPC_ERROR_CODE_WATCH_ONLY;
|
||||||
er.message = "The wallet is watch-only. Cannot display seed.";
|
er.message = "The wallet is watch-only. Cannot retrieve seed.";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!m_wallet->is_deterministic())
|
if (!m_wallet->is_deterministic())
|
||||||
@ -1857,6 +1857,12 @@ namespace tools
|
|||||||
}
|
}
|
||||||
else if(req.key_type.compare("spend_key") == 0)
|
else if(req.key_type.compare("spend_key") == 0)
|
||||||
{
|
{
|
||||||
|
if (m_wallet->watch_only())
|
||||||
|
{
|
||||||
|
er.code = WALLET_RPC_ERROR_CODE_WATCH_ONLY;
|
||||||
|
er.message = "The wallet is watch-only. Cannot retrieve spend key.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
epee::wipeable_string key = epee::to_hex::wipeable_string(m_wallet->get_account().get_keys().m_spend_secret_key);
|
epee::wipeable_string key = epee::to_hex::wipeable_string(m_wallet->get_account().get_keys().m_spend_secret_key);
|
||||||
res.key = std::string(key.data(), key.size());
|
res.key = std::string(key.data(), key.size());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user