Skip to content
Permalink
Browse files

wallet_rpc_server: error out on getting the spend key from a hot wallet

  • Loading branch information...
moneromooo-monero committed Mar 19, 2019
1 parent d260084 commit 49443225f2232c282a3dfaa370603f5385132e82
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/wallet/wallet_rpc_server.cpp
@@ -1850,7 +1850,7 @@ namespace tools
if (m_wallet->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;
}
if (!m_wallet->is_deterministic())
@@ -1875,6 +1875,12 @@ namespace tools
}
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);
res.key = std::string(key.data(), key.size());
}

0 comments on commit 4944322

Please sign in to comment.
You can’t perform that action at this time.