1
0
Fork 0
forked from lthn/blockchain

Merge branch 'develop' of github.com:hyle-team/zano into develop

This commit is contained in:
cryptozoidberg 2019-09-27 17:24:25 +02:00
commit 9283b7b5fd
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
3 changed files with 23 additions and 7 deletions

View file

@ -122,7 +122,7 @@ namespace command_line
boost::program_options::basic_parsed_options<charT> parse_command_line(int argc, const charT* const argv[],
const boost::program_options::options_description& desc, bool allow_unregistered = false)
{
auto parser = boost::program_options::command_line_parser(argc, argv);
auto parser = boost::program_options::basic_command_line_parser<charT>(argc, argv);
parser.options(desc);
if (allow_unregistered)
{

View file

@ -331,7 +331,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm)
}
else
{
bool r = open_wallet(epee::string_encoding::convert_to_ansii(m_wallet_file), pwd_container.password());
bool r = open_wallet(m_wallet_file, pwd_container.password());
CHECK_AND_ASSERT_MES(r, false, "could not open account");
}
@ -379,7 +379,7 @@ bool simple_wallet::new_wallet(const string &wallet_file, const std::string& pas
m_wallet->set_do_rise_transfer(false);
try
{
m_wallet->generate(epee::string_encoding::convert_to_unicode(m_wallet_file), password);
m_wallet->generate(epee::string_encoding::utf8_to_wstring(m_wallet_file), password);
message_writer(epee::log_space::console_color_white, true) << "Generated new wallet: " << m_wallet->get_account().get_public_address_str();
std::cout << "view key: " << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << std::endl << std::flush;
if(m_do_not_set_date)
@ -421,7 +421,7 @@ bool simple_wallet::restore_wallet(const std::string &wallet_file, const std::st
m_wallet->set_do_rise_transfer(false);
try
{
m_wallet->restore(epee::string_encoding::convert_to_unicode(wallet_file), password, restore_seed);
m_wallet->restore(epee::string_encoding::utf8_to_wstring(wallet_file), password, restore_seed);
message_writer(epee::log_space::console_color_white, true) << "Wallet restored: " << m_wallet->get_account().get_public_address_str();
std::cout << "view key: " << string_tools::pod_to_hex(m_wallet->get_account().get_keys().m_view_secret_key) << std::endl << std::flush;
if (m_do_not_set_date)
@ -457,7 +457,7 @@ bool simple_wallet::open_wallet(const string &wallet_file, const std::string& pa
{
try
{
m_wallet->load(epee::string_encoding::convert_to_unicode(m_wallet_file), password);
m_wallet->load(epee::string_encoding::utf8_to_wstring(m_wallet_file), password);
message_writer(epee::log_space::console_color_white, true) << "Opened" << (m_wallet->is_watch_only() ? " watch-only" : "") << " wallet: " << m_wallet->get_account().get_public_address_str();
if (m_print_brain_wallet)
@ -1512,7 +1512,11 @@ bool simple_wallet::submit_transfer(const std::vector<std::string> &args)
return true;
}
//----------------------------------------------------------------------------------------------------
#ifdef WIN32
int wmain( int argc, wchar_t* argv_w[ ], wchar_t* envp[ ] )
#else
int main(int argc, char* argv[])
#endif
{
#ifdef WIN32
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
@ -1528,6 +1532,18 @@ int main(int argc, char* argv[])
std::fflush(nullptr);
});
#ifdef WIN32
// windows: convert argv_w into UTF-8-encoded std::string the same way it is in Linux and macOS
std::vector<std::string> argv_str;
std::vector<const char*> argv_vec;
for (size_t i = 0; i < argc; ++i)
{
argv_str.push_back( epee::string_encoding::wstring_to_utf8( argv_w[i] ) );
argv_vec.push_back( argv_str.back().c_str() );
}
const char* const* argv = argv_vec.data();
#endif
string_tools::set_module_name_and_folder(argv[0]);
po::options_description desc_general("General options");
@ -1662,7 +1678,7 @@ int main(int argc, char* argv[])
try
{
LOG_PRINT_L0("Loading wallet...");
wal.load(epee::string_encoding::convert_to_unicode(wallet_file), pwd_container.password());
wal.load(epee::string_encoding::utf8_to_wstring(wallet_file), pwd_container.password());
}
catch (const tools::error::wallet_load_notice_wallet_restored& e)
{

View file

@ -7,6 +7,6 @@
#define PROJECT_REVISION "0"
#define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION
#define PROJECT_VERSION_BUILD_NO 59
#define PROJECT_VERSION_BUILD_NO 60
#define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO)
#define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"