diff options
Diffstat (limited to 'src/wallet/wallet_rpc_server.cpp')
-rw-r--r-- | src/wallet/wallet_rpc_server.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index 6361a6cfa..e6eb64d12 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1553,7 +1553,7 @@ namespace tools rpc_transfers.spent = td.m_spent; rpc_transfers.global_index = td.m_global_output_index; rpc_transfers.tx_hash = epee::string_tools::pod_to_hex(td.m_txid); - rpc_transfers.subaddr_index = td.m_subaddr_index.minor; + rpc_transfers.subaddr_index = {td.m_subaddr_index.major, td.m_subaddr_index.minor}; rpc_transfers.key_image = req.verbose && td.m_key_image_known ? epee::string_tools::pod_to_hex(td.m_key_image) : ""; res.transfers.push_back(rpc_transfers); } @@ -3294,9 +3294,12 @@ class t_daemon private: const boost::program_options::variables_map& vm; + std::unique_ptr<tools::wallet_rpc_server> wrpc; + public: t_daemon(boost::program_options::variables_map const & _vm) : vm(_vm) + , wrpc(new tools::wallet_rpc_server) { } @@ -3386,17 +3389,16 @@ public: return false; } just_dir: - tools::wallet_rpc_server wrpc; - if (wal) wrpc.set_wallet(wal.release()); - bool r = wrpc.init(&vm); + if (wal) wrpc->set_wallet(wal.release()); + bool r = wrpc->init(&vm); CHECK_AND_ASSERT_MES(r, false, tools::wallet_rpc_server::tr("Failed to initialize wallet RPC server")); - tools::signal_handler::install([&wrpc](int) { - wrpc.send_stop_signal(); + tools::signal_handler::install([this](int) { + wrpc->send_stop_signal(); }); LOG_PRINT_L0(tools::wallet_rpc_server::tr("Starting wallet RPC server")); try { - wrpc.run(); + wrpc->run(); } catch (const std::exception &e) { @@ -3407,7 +3409,7 @@ public: try { LOG_PRINT_L0(tools::wallet_rpc_server::tr("Saving wallet...")); - wrpc.stop(); + wrpc->stop(); LOG_PRINT_L0(tools::wallet_rpc_server::tr("Successfully saved")); } catch (const std::exception& e) @@ -3417,6 +3419,11 @@ public: } return true; } + + void stop() + { + wrpc->send_stop_signal(); + } }; class t_executor final @@ -3424,7 +3431,9 @@ class t_executor final public: static std::string const NAME; - std::string const & name() + typedef ::t_daemon t_daemon; + + std::string const & name() const { return NAME; } @@ -3467,6 +3476,7 @@ int main(int argc, char** argv) { command_line::add_arg(desc_params, arg_prompt_for_password); daemonizer::init_options(hidden_options, desc_params); + desc_params.add(hidden_options); boost::optional<po::variables_map> vm; bool should_terminate = false; |