diff options
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 11 | ||||
-rw-r--r-- | src/wallet/wallet_args.cpp | 19 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index bb242c5f1..79578a34e 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -548,7 +548,16 @@ namespace cryptonote tx_ids.push_back(tx_hash); if (m_core.get_transactions(tx_ids, txes, missing) && missing.empty()) { - have_tx.push_back(tx_to_blob(tx)); + if (txes.size() == 1) + { + have_tx.push_back(tx_to_blob(txes.front())); + } + else + { + MERROR("1 tx requested, none not found, but " << txes.size() << " returned"); + m_core.resume_mine(); + return 1; + } } else { diff --git a/src/wallet/wallet_args.cpp b/src/wallet/wallet_args.cpp index 166ce57e7..1508f3791 100644 --- a/src/wallet/wallet_args.cpp +++ b/src/wallet/wallet_args.cpp @@ -86,6 +86,7 @@ namespace wallet_args const command_line::arg_descriptor<std::string> arg_log_level = {"log-level", "0-4 or categories", ""}; const command_line::arg_descriptor<uint32_t> arg_max_concurrency = {"max-concurrency", wallet_args::tr("Max number of threads to use for a parallel job"), DEFAULT_MAX_CONCURRENCY}; const command_line::arg_descriptor<std::string> arg_log_file = {"log-file", wallet_args::tr("Specify log file"), ""}; + const command_line::arg_descriptor<std::string> arg_config_file = {"config-file", wallet_args::tr("Config file"), "", true}; std::string lang = i18n_get_language(); @@ -101,6 +102,7 @@ namespace wallet_args command_line::add_arg(desc_params, arg_log_file, ""); command_line::add_arg(desc_params, arg_log_level); command_line::add_arg(desc_params, arg_max_concurrency); + command_line::add_arg(desc_params, arg_config_file); i18n_set_language("translations", "monero", lang); @@ -111,6 +113,23 @@ namespace wallet_args { auto parser = po::command_line_parser(argc, argv).options(desc_all).positional(positional_options); po::store(parser.run(), vm); + + if(command_line::has_arg(vm, arg_config_file)) + { + std::string config = command_line::get_arg(vm, arg_config_file); + bf::path config_path(config); + boost::system::error_code ec; + if (bf::exists(config_path, ec)) + { + po::store(po::parse_config_file<char>(config_path.string<std::string>().c_str(), desc_params), vm); + } + else + { + tools::fail_msg_writer() << wallet_args::tr("Can't find config file ") << config; + return false; + } + } + po::notify(vm); return true; }); |