aboutsummaryrefslogtreecommitdiff
path: root/src/simplewallet
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-01-11 11:06:35 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-01-11 12:11:43 +0000
commit24d500ce8e27eade6e591f83e1381be62134e151 (patch)
tree41c6c08075eb9dbfcab565f97f2744852a257ded /src/simplewallet
parentMerge pull request #206 (diff)
downloadmonero-24d500ce8e27eade6e591f83e1381be62134e151.tar.xz
Add a --restricted-rpc flag to simplewallet
It restricts RPC to a subset of "view only" commands. Kind of like a poor man's view key replacement.
Diffstat (limited to 'src/simplewallet')
-rw-r--r--src/simplewallet/simplewallet.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 6f3874981..ae61871dc 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -81,6 +81,7 @@ namespace
const command_line::arg_descriptor<int> arg_daemon_port = {"daemon-port", "Use daemon instance at port <arg> instead of 8081", 0};
const command_line::arg_descriptor<uint32_t> arg_log_level = {"set_log", "", 0, true};
const command_line::arg_descriptor<bool> arg_testnet = {"testnet", "Used to deploy test nets. The daemon must be launched with --testnet flag", false};
+ const command_line::arg_descriptor<bool> arg_restricted = {"restricted-rpc", "Restricts RPC to view only commands", false};
const command_line::arg_descriptor< std::vector<std::string> > arg_command = {"command", ""};
@@ -1336,6 +1337,7 @@ int main(int argc, char* argv[])
command_line::add_arg(desc_params, arg_non_deterministic );
command_line::add_arg(desc_params, arg_electrum_seed );
command_line::add_arg(desc_params, arg_testnet);
+ command_line::add_arg(desc_params, arg_restricted);
tools::wallet_rpc_server::init_options(desc_params);
po::positional_options_description positional_options;
@@ -1406,6 +1408,7 @@ int main(int argc, char* argv[])
}
bool testnet = command_line::get_arg(vm, arg_testnet);
+ bool restricted = command_line::get_arg(vm, arg_restricted);
std::string wallet_file = command_line::get_arg(vm, arg_wallet_file);
std::string wallet_password = command_line::get_arg(vm, arg_password);
std::string daemon_address = command_line::get_arg(vm, arg_daemon_address);
@@ -1418,7 +1421,7 @@ int main(int argc, char* argv[])
if (daemon_address.empty())
daemon_address = std::string("http://") + daemon_host + ":" + std::to_string(daemon_port);
- tools::wallet2 wal(testnet);
+ tools::wallet2 wal(testnet,restricted);
try
{
LOG_PRINT_L0("Loading wallet...");