aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-03-19 01:07:46 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-01 19:31:01 +0000
commit36c037ec4748d26fdc8f95b60f758ad34c7aba9f (patch)
tree2fe1221c848902aaf5977e6b592be6016850f564 /src/wallet
parentwallet_rpc_server: always fill out subaddr_indices in get_transfers (diff)
downloadmonero-36c037ec4748d26fdc8f95b60f758ad34c7aba9f.tar.xz
wallet_rpc_server: error out on getting the spend key from a hot wallet
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet_rpc_server.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp
index c1ccffd6d..aa3169c97 100644
--- a/src/wallet/wallet_rpc_server.cpp
+++ b/src/wallet/wallet_rpc_server.cpp
@@ -1832,7 +1832,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())
@@ -1857,6 +1857,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());
}