From 161eda3fd1528dd87e51d85cd076f5fe05c0ef72 Mon Sep 17 00:00:00 2001 From: Doyle T Date: Tue, 10 Apr 2018 14:49:20 +1000 Subject: [PATCH 1/5] First pass Monero to Loki refs --- contrib/epee/include/misc_log_ex.h | 30 +- .../epee/include/net/abstract_tcp_server.h | 4 +- .../epee/include/net/abstract_tcp_server2.h | 4 +- .../epee/include/net/abstract_tcp_server2.inl | 4 +- .../epee/include/net/abstract_tcp_server_cp.h | 4 +- .../include/net/abstract_tcp_server_cp.inl | 4 +- contrib/epee/include/net/http_auth.h | 4 +- contrib/epee/include/net/http_base.h | 4 +- contrib/epee/include/net/http_client.h | 4 +- contrib/epee/include/net/http_client_base.h | 4 +- .../include/net/http_client_via_api_helper.h | 4 +- .../epee/include/net/http_protocol_handler.h | 4 +- .../include/net/http_protocol_handler.inl | 4 +- contrib/epee/include/net/http_server_cp.h | 4 +- contrib/epee/include/net/http_server_cp2.h | 4 +- .../include/net/http_server_handlers_map2.h | 4 +- .../epee/include/net/http_server_impl_base.h | 4 +- contrib/epee/include/net/levin_client.inl | 4 +- contrib/epee/include/net/levin_client_async.h | 4 +- contrib/epee/include/net/levin_helper.h | 4 +- .../epee/include/net/levin_protocol_handler.h | 4 +- .../net/levin_protocol_handler_async.h | 4 +- contrib/epee/include/net/net_helper.h | 4 +- contrib/epee/include/net/net_parse_helpers.h | 4 +- contrib/epee/include/net/net_utils_base.h | 4 +- .../include/storages/levin_abstract_invoke2.h | 4 +- contrib/epee/src/connection_basic.cpp | 4 +- contrib/epee/src/mlog.cpp | 6 +- contrib/epee/src/network_throttle-detail.cpp | 4 +- src/blockchain_db/blockchain_db.cpp | 5 +- src/blockchain_db/lmdb/db_lmdb.cpp | 7 +- .../blockchain_blackball.cpp | 13 +- .../blockchain_export.cpp | 9 +- .../blockchain_import.cpp | 9 +- src/blockchain_utilities/blockchain_usage.cpp | 9 +- src/blockchain_utilities/blocksdat_file.cpp | 5 +- src/blockchain_utilities/bootstrap_file.cpp | 7 +- src/checkpoints/checkpoints.cpp | 5 +- src/common/dns_utils.cpp | 13 +- src/common/download.cpp | 5 +- src/common/i18n.cpp | 5 +- src/common/perf_timer.cpp | 5 +- src/common/perf_timer.h | 5 +- src/common/stack_trace.cpp | 7 +- src/common/updates.cpp | 5 +- src/cryptonote_basic/account.cpp | 5 +- .../cryptonote_basic_impl.cpp | 5 +- .../cryptonote_format_utils.cpp | 15 +- src/cryptonote_basic/difficulty.cpp | 5 +- src/cryptonote_basic/hardfork.cpp | 5 +- src/cryptonote_basic/miner.cpp | 5 +- src/cryptonote_core/blockchain.cpp | 9 +- src/cryptonote_core/cryptonote_core.cpp | 9 +- src/cryptonote_core/tx_pool.cpp | 5 +- src/cryptonote_protocol/block_queue.cpp | 5 +- src/cryptonote_protocol/block_queue.h | 5 +- .../cryptonote_protocol_handler-base.cpp | 5 +- .../cryptonote_protocol_handler.inl | 13 +- src/daemon/command_parser_executor.cpp | 5 +- src/daemon/command_server.cpp | 11 +- src/daemon/core.h | 5 +- src/daemon/daemon.cpp | 5 +- src/daemon/daemon.h | 5 +- src/daemon/executor.cpp | 9 +- src/daemon/executor.h | 5 +- src/daemon/main.cpp | 15 +- src/daemon/p2p.h | 5 +- src/daemon/protocol.h | 5 +- src/daemon/rpc.h | 5 +- src/daemon/rpc_command_executor.cpp | 13 +- src/daemon/rpc_command_executor.h | 5 +- src/daemonizer/posix_daemonizer.inl | 3 +- src/daemonizer/windows_daemonizer.inl | 3 +- src/debug_utilities/cn_deserialize.cpp | 7 +- src/debug_utilities/object_sizes.cpp | 17 +- src/device/device_ledger.cpp | 5 +- src/device/log.cpp | 7 +- src/gen_multisig/gen_multisig.cpp | 9 +- src/multisig/multisig.cpp | 5 +- src/p2p/net_node.inl | 7 +- src/ringct/bulletproofs.cc | 4 +- src/ringct/rctOps.cpp | 4 +- src/ringct/rctSigs.cpp | 6 +- src/ringct/rctTypes.cpp | 4 +- src/rpc/core_rpc_server.cpp | 7 +- src/simplewallet/simplewallet.cpp | 81 +- src/simplewallet/simplewallet.h | 5 +- src/version.cpp.in | 16 +- src/version.h | 8 +- src/wallet/api/wallet.cpp | 15 +- src/wallet/api/wallet_manager.cpp | 7 +- src/wallet/ringdb.cpp | 5 +- src/wallet/wallet2.cpp | 25 +- src/wallet/wallet2.h | 5 +- src/wallet/wallet_args.cpp | 17 +- src/wallet/wallet_rpc_server.cpp | 21 +- src/wallet/wallet_rpc_server.h | 5 +- src/wallet/wallet_rpc_server_commands_defs.h | 5 +- tests/core_tests/chaingen.h | 714 ------------------ translations/{monero.ts => loki.ts} | 0 translations/{monero_fr.ts => loki_fr.ts} | 0 translations/{monero_it.ts => loki_it.ts} | 0 translations/{monero_sv.ts => loki_sv.ts} | 0 103 files changed, 403 insertions(+), 1056 deletions(-) delete mode 100644 tests/core_tests/chaingen.h rename translations/{monero.ts => loki.ts} (100%) rename translations/{monero_fr.ts => loki_fr.ts} (100%) rename translations/{monero_it.ts => loki_it.ts} (100%) rename translations/{monero_sv.ts => loki_sv.ts} (100%) diff --git a/contrib/epee/include/misc_log_ex.h b/contrib/epee/include/misc_log_ex.h index 35ec0950bc..92e8c8dc96 100644 --- a/contrib/epee/include/misc_log_ex.h +++ b/contrib/epee/include/misc_log_ex.h @@ -32,7 +32,7 @@ #include "easylogging++.h" -#define MONERO_DEFAULT_LOG_CATEGORY "default" +#define LOKI_DEFAULT_LOG_CATEGORY "default" #define MAX_LOG_FILE_SIZE 104850000 // 100 MB - 7600 bytes #define MCFATAL(cat,x) CLOG(FATAL,cat) << x @@ -52,20 +52,20 @@ #define MCLOG_MAGENTA(level,cat,x) MCLOG_COLOR(level,cat,"35",x) #define MCLOG_CYAN(level,cat,x) MCLOG_COLOR(level,cat,"36",x) -#define MLOG_RED(level,x) MCLOG_RED(level,MONERO_DEFAULT_LOG_CATEGORY,x) -#define MLOG_GREEN(level,x) MCLOG_GREEN(level,MONERO_DEFAULT_LOG_CATEGORY,x) -#define MLOG_YELLOW(level,x) MCLOG_YELLOW(level,MONERO_DEFAULT_LOG_CATEGORY,x) -#define MLOG_BLUE(level,x) MCLOG_BLUE(level,MONERO_DEFAULT_LOG_CATEGORY,x) -#define MLOG_MAGENTA(level,x) MCLOG_MAGENTA(level,MONERO_DEFAULT_LOG_CATEGORY,x) -#define MLOG_CYAN(level,x) MCLOG_CYAN(level,MONERO_DEFAULT_LOG_CATEGORY,x) - -#define MFATAL(x) MCFATAL(MONERO_DEFAULT_LOG_CATEGORY,x) -#define MERROR(x) MCERROR(MONERO_DEFAULT_LOG_CATEGORY,x) -#define MWARNING(x) MCWARNING(MONERO_DEFAULT_LOG_CATEGORY,x) -#define MINFO(x) MCINFO(MONERO_DEFAULT_LOG_CATEGORY,x) -#define MDEBUG(x) MCDEBUG(MONERO_DEFAULT_LOG_CATEGORY,x) -#define MTRACE(x) MCTRACE(MONERO_DEFAULT_LOG_CATEGORY,x) -#define MLOG(level,x) MCLOG(level,MONERO_DEFAULT_LOG_CATEGORY,x) +#define MLOG_RED(level,x) MCLOG_RED(level,LOKI_DEFAULT_LOG_CATEGORY,x) +#define MLOG_GREEN(level,x) MCLOG_GREEN(level,LOKI_DEFAULT_LOG_CATEGORY,x) +#define MLOG_YELLOW(level,x) MCLOG_YELLOW(level,LOKI_DEFAULT_LOG_CATEGORY,x) +#define MLOG_BLUE(level,x) MCLOG_BLUE(level,LOKI_DEFAULT_LOG_CATEGORY,x) +#define MLOG_MAGENTA(level,x) MCLOG_MAGENTA(level,LOKI_DEFAULT_LOG_CATEGORY,x) +#define MLOG_CYAN(level,x) MCLOG_CYAN(level,LOKI_DEFAULT_LOG_CATEGORY,x) + +#define MFATAL(x) MCFATAL(LOKI_DEFAULT_LOG_CATEGORY,x) +#define MERROR(x) MCERROR(LOKI_DEFAULT_LOG_CATEGORY,x) +#define MWARNING(x) MCWARNING(LOKI_DEFAULT_LOG_CATEGORY,x) +#define MINFO(x) MCINFO(LOKI_DEFAULT_LOG_CATEGORY,x) +#define MDEBUG(x) MCDEBUG(LOKI_DEFAULT_LOG_CATEGORY,x) +#define MTRACE(x) MCTRACE(LOKI_DEFAULT_LOG_CATEGORY,x) +#define MLOG(level,x) MCLOG(level,LOKI_DEFAULT_LOG_CATEGORY,x) #define MGINFO(x) MCINFO("global",x) #define MGINFO_RED(x) MCLOG_RED(el::Level::Info, "global",x) diff --git a/contrib/epee/include/net/abstract_tcp_server.h b/contrib/epee/include/net/abstract_tcp_server.h index cbad1717ce..00da12d389 100644 --- a/contrib/epee/include/net/abstract_tcp_server.h +++ b/contrib/epee/include/net/abstract_tcp_server.h @@ -38,8 +38,8 @@ #pragma comment(lib, "Ws2_32.lib") -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h index ccde928ba3..5c75c48fa2 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.h +++ b/contrib/epee/include/net/abstract_tcp_server2.h @@ -57,8 +57,8 @@ #include "connection_basic.hpp" #include "network_throttle-detail.hpp" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" #define ABSTRACT_SERVER_SEND_QUE_MAX_COUNT 1000 diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl index 195ee2f0c6..2e5c2f4985 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.inl +++ b/contrib/epee/include/net/abstract_tcp_server2.inl @@ -51,8 +51,8 @@ #include "../../../../src/cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal() -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" PRAGMA_WARNING_PUSH namespace epee diff --git a/contrib/epee/include/net/abstract_tcp_server_cp.h b/contrib/epee/include/net/abstract_tcp_server_cp.h index f10f4203fd..b7d04ecc8f 100644 --- a/contrib/epee/include/net/abstract_tcp_server_cp.h +++ b/contrib/epee/include/net/abstract_tcp_server_cp.h @@ -42,8 +42,8 @@ #include "net_utils_base.h" #include "pragma_comp_defs.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" #define LEVIN_DEFAULT_DATA_BUFF_SIZE 2000 diff --git a/contrib/epee/include/net/abstract_tcp_server_cp.inl b/contrib/epee/include/net/abstract_tcp_server_cp.inl index e0ef6470ea..2d4867e1ec 100644 --- a/contrib/epee/include/net/abstract_tcp_server_cp.inl +++ b/contrib/epee/include/net/abstract_tcp_server_cp.inl @@ -27,8 +27,8 @@ #pragma comment(lib, "Ws2_32.lib") -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/include/net/http_auth.h b/contrib/epee/include/net/http_auth.h index 4324c41fd9..77cae7f8df 100644 --- a/contrib/epee/include/net/http_auth.h +++ b/contrib/epee/include/net/http_auth.h @@ -36,8 +36,8 @@ #include "wipeable_string.h" #include "http_base.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_base.h b/contrib/epee/include/net/http_base.h index a66fb7c237..a8d4833a51 100644 --- a/contrib/epee/include/net/http_base.h +++ b/contrib/epee/include/net/http_base.h @@ -35,8 +35,8 @@ #include "string_tools.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_client.h b/contrib/epee/include/net/http_client.h index e016917947..e996ec74a9 100644 --- a/contrib/epee/include/net/http_client.h +++ b/contrib/epee/include/net/http_client.h @@ -57,8 +57,8 @@ //#pragma comment(lib, "shlwapi.lib") -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" extern epee::critical_section gregexp_lock; diff --git a/contrib/epee/include/net/http_client_base.h b/contrib/epee/include/net/http_client_base.h index c3da287186..e78c07324a 100644 --- a/contrib/epee/include/net/http_client_base.h +++ b/contrib/epee/include/net/http_client_base.h @@ -26,8 +26,8 @@ #pragma once -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_client_via_api_helper.h b/contrib/epee/include/net/http_client_via_api_helper.h index 3242e4162c..62dadfca98 100644 --- a/contrib/epee/include/net/http_client_via_api_helper.h +++ b/contrib/epee/include/net/http_client_via_api_helper.h @@ -32,8 +32,8 @@ #include #pragma comment(lib, "Wininet.lib") -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_protocol_handler.h b/contrib/epee/include/net/http_protocol_handler.h index b4485d1cd5..c47042f203 100644 --- a/contrib/epee/include/net/http_protocol_handler.h +++ b/contrib/epee/include/net/http_protocol_handler.h @@ -37,8 +37,8 @@ #include "http_auth.h" #include "http_base.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_protocol_handler.inl b/contrib/epee/include/net/http_protocol_handler.inl index c18f7f706e..6822eb008e 100644 --- a/contrib/epee/include/net/http_protocol_handler.inl +++ b/contrib/epee/include/net/http_protocol_handler.inl @@ -33,8 +33,8 @@ #include "file_io_utils.h" #include "net_parse_helpers.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" #define HTTP_MAX_URI_LEN 9000 #define HTTP_MAX_HEADER_LEN 100000 diff --git a/contrib/epee/include/net/http_server_cp.h b/contrib/epee/include/net/http_server_cp.h index 1ac2223c7b..7d34a5e9ab 100644 --- a/contrib/epee/include/net/http_server_cp.h +++ b/contrib/epee/include/net/http_server_cp.h @@ -33,8 +33,8 @@ #include "abstract_tcp_server_cp.h" #include "http_server.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_server_cp2.h b/contrib/epee/include/net/http_server_cp2.h index 8dfd43a167..d2a34fb50a 100644 --- a/contrib/epee/include/net/http_server_cp2.h +++ b/contrib/epee/include/net/http_server_cp2.h @@ -33,8 +33,8 @@ #include "abstract_tcp_server2.h" #include "http_protocol_handler.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/http_server_handlers_map2.h b/contrib/epee/include/net/http_server_handlers_map2.h index 429e3e1afd..281d421c92 100644 --- a/contrib/epee/include/net/http_server_handlers_map2.h +++ b/contrib/epee/include/net/http_server_handlers_map2.h @@ -31,8 +31,8 @@ #include "storages/portable_storage.h" #include "storages/portable_storage_template_helper.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" #define CHAIN_HTTP_TO_MAP2(context_type) bool handle_http_request(const epee::net_utils::http::http_request_info& query_info, \ diff --git a/contrib/epee/include/net/http_server_impl_base.h b/contrib/epee/include/net/http_server_impl_base.h index 1a97e610a6..c4b38dfa15 100644 --- a/contrib/epee/include/net/http_server_impl_base.h +++ b/contrib/epee/include/net/http_server_impl_base.h @@ -36,8 +36,8 @@ #include "net/http_server_cp2.h" #include "net/http_server_handlers_map2.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.http" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.http" namespace epee { diff --git a/contrib/epee/include/net/levin_client.inl b/contrib/epee/include/net/levin_client.inl index ab7c32c32c..7260ea6e0a 100644 --- a/contrib/epee/include/net/levin_client.inl +++ b/contrib/epee/include/net/levin_client.inl @@ -31,8 +31,8 @@ //------------------------------------------------------------------------------ #include "string_tools.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/include/net/levin_client_async.h b/contrib/epee/include/net/levin_client_async.h index b3a46465bf..a3f783793d 100644 --- a/contrib/epee/include/net/levin_client_async.h +++ b/contrib/epee/include/net/levin_client_async.h @@ -31,8 +31,8 @@ #include "net_helper.h" #include "levin_base.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee diff --git a/contrib/epee/include/net/levin_helper.h b/contrib/epee/include/net/levin_helper.h index 05560dd908..bb91167240 100644 --- a/contrib/epee/include/net/levin_helper.h +++ b/contrib/epee/include/net/levin_helper.h @@ -31,8 +31,8 @@ #include "levin_base.h" #include "serializeble_struct_helper.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/include/net/levin_protocol_handler.h b/contrib/epee/include/net/levin_protocol_handler.h index b3a75bedc5..dd82caf534 100644 --- a/contrib/epee/include/net/levin_protocol_handler.h +++ b/contrib/epee/include/net/levin_protocol_handler.h @@ -32,8 +32,8 @@ #include #include "levin_base.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/include/net/levin_protocol_handler_async.h b/contrib/epee/include/net/levin_protocol_handler_async.h index 0b1fe05fa1..73c428d5f5 100644 --- a/contrib/epee/include/net/levin_protocol_handler_async.h +++ b/contrib/epee/include/net/levin_protocol_handler_async.h @@ -41,8 +41,8 @@ #include #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" #ifndef MIN_BYTES_WANTED #define MIN_BYTES_WANTED 512 diff --git a/contrib/epee/include/net/net_helper.h b/contrib/epee/include/net/net_helper.h index 2c2efcd82d..df044aa2bd 100644 --- a/contrib/epee/include/net/net_helper.h +++ b/contrib/epee/include/net/net_helper.h @@ -42,8 +42,8 @@ #include "net/net_utils_base.h" #include "misc_language.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" #ifndef MAKE_IP #define MAKE_IP( a1, a2, a3, a4 ) (a1|(a2<<8)|(a3<<16)|(a4<<24)) diff --git a/contrib/epee/include/net/net_parse_helpers.h b/contrib/epee/include/net/net_parse_helpers.h index 708cce0ff2..b2a681f475 100644 --- a/contrib/epee/include/net/net_parse_helpers.h +++ b/contrib/epee/include/net/net_parse_helpers.h @@ -31,8 +31,8 @@ #include "http_base.h" #include "reg_exp_definer.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/include/net/net_utils_base.h b/contrib/epee/include/net/net_utils_base.h index 7615786bea..07dd5766a6 100644 --- a/contrib/epee/include/net/net_utils_base.h +++ b/contrib/epee/include/net/net_utils_base.h @@ -36,8 +36,8 @@ #include "serialization/keyvalue_serialization.h" #include "misc_log_ex.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" #ifndef MAKE_IP #define MAKE_IP( a1, a2, a3, a4 ) (a1|(a2<<8)|(a3<<16)|(a4<<24)) diff --git a/contrib/epee/include/storages/levin_abstract_invoke2.h b/contrib/epee/include/storages/levin_abstract_invoke2.h index d77e7a1f86..498006f3d3 100644 --- a/contrib/epee/include/storages/levin_abstract_invoke2.h +++ b/contrib/epee/include/storages/levin_abstract_invoke2.h @@ -30,8 +30,8 @@ #include #include "net/levin_base.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net" namespace epee { diff --git a/contrib/epee/src/connection_basic.cpp b/contrib/epee/src/connection_basic.cpp index dea1928a7e..6005904ced 100644 --- a/contrib/epee/src/connection_basic.cpp +++ b/contrib/epee/src/connection_basic.cpp @@ -79,8 +79,8 @@ // TODO: #include "net/network_throttle-detail.hpp" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.p2p" // ################################################################################################ // local (TU local) headers diff --git a/contrib/epee/src/mlog.cpp b/contrib/epee/src/mlog.cpp index 5b94720068..4f7c6422d5 100644 --- a/contrib/epee/src/mlog.cpp +++ b/contrib/epee/src/mlog.cpp @@ -35,12 +35,12 @@ #include "string_tools.h" #include "misc_log_ex.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "logging" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "logging" #define MLOG_BASE_FORMAT "%datetime{%Y-%M-%d %H:%m:%s.%g}\t%thread\t%level\t%logger\t%loc\t%msg" -#define MLOG_LOG(x) CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,MONERO_DEFAULT_LOG_CATEGORY) << x +#define MLOG_LOG(x) CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,LOKI_DEFAULT_LOG_CATEGORY) << x using namespace epee; diff --git a/contrib/epee/src/network_throttle-detail.cpp b/contrib/epee/src/network_throttle-detail.cpp index 7eeade3a19..fa98b37012 100644 --- a/contrib/epee/src/network_throttle-detail.cpp +++ b/contrib/epee/src/network_throttle-detail.cpp @@ -76,8 +76,8 @@ // TODO: #include "net/network_throttle-detail.hpp" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.throttle" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.throttle" // ################################################################################################ // ################################################################################################ diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp index 9f760dc0d8..0678a8d2d6 100644 --- a/src/blockchain_db/blockchain_db.cpp +++ b/src/blockchain_db/blockchain_db.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -47,8 +48,8 @@ static const char *db_types[] = { NULL }; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "blockchain.db" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "blockchain.db" using epee::string_tools::pod_to_hex; diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 9a755fb0c0..2279d1e32a 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are @@ -41,8 +42,8 @@ #include "profile_tools.h" #include "ringct/rctOps.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "blockchain.db.lmdb" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "blockchain.db.lmdb" #if defined(__i386) || defined(__x86_64) @@ -3267,7 +3268,7 @@ void BlockchainLMDB::fixup() ptr = (char *)k.mv_data; \ ptr[sizeof(name)-2] = 's' -#define LOGIF(y) if (ELPP->vRegistry()->allowed(y, MONERO_DEFAULT_LOG_CATEGORY)) +#define LOGIF(y) if (ELPP->vRegistry()->allowed(y, LOKI_DEFAULT_LOG_CATEGORY)) void BlockchainLMDB::migrate_0_1() { diff --git a/src/blockchain_utilities/blockchain_blackball.cpp b/src/blockchain_utilities/blockchain_blackball.cpp index 40ce898d97..93c5a7532f 100644 --- a/src/blockchain_utilities/blockchain_blackball.cpp +++ b/src/blockchain_utilities/blockchain_blackball.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -38,8 +39,8 @@ #include "wallet/ringdb.h" #include "version.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bcutil" namespace po = boost::program_options; using namespace epee; @@ -69,7 +70,7 @@ namespace std static std::string get_default_db_path() { boost::filesystem::path dir = tools::get_default_data_dir(); - // remove .bitmonero, replace with .shared-ringdb + // remove .loki, replace with .shared-ringdb dir = dir.remove_filename(); dir /= ".shared-ringdb"; return dir.string(); @@ -178,7 +179,7 @@ int main(int argc, char* argv[]) "database", available_dbs.c_str(), default_db_type }; const command_line::arg_descriptor arg_rct_only = {"rct-only", "Only work on ringCT outputs", false}; - const command_line::arg_descriptor > arg_inputs = {"inputs", "Path to Monero DB, and path to any fork DBs"}; + const command_line::arg_descriptor > arg_inputs = {"inputs", "Path to Loki DB, and path to any fork DBs"}; command_line::add_arg(desc_cmd_sett, arg_blackball_db_dir); command_line::add_arg(desc_cmd_sett, cryptonote::arg_testnet_on); @@ -208,12 +209,12 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } - mlog_configure(mlog_get_default_log_path("monero-blockchain-blackball.log"), true); + mlog_configure(mlog_get_default_log_path("loki-blockchain-blackball.log"), true); if (!command_line::is_arg_defaulted(vm, arg_log_level)) mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); else diff --git a/src/blockchain_utilities/blockchain_export.cpp b/src/blockchain_utilities/blockchain_export.cpp index 5a49f34781..541a2b1ae0 100644 --- a/src/blockchain_utilities/blockchain_export.cpp +++ b/src/blockchain_utilities/blockchain_export.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -35,8 +36,8 @@ #include "blockchain_db/db_types.h" #include "version.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bcutil" namespace po = boost::program_options; using namespace epee; @@ -97,12 +98,12 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } - mlog_configure(mlog_get_default_log_path("monero-blockchain-export.log"), true); + mlog_configure(mlog_get_default_log_path("loki-blockchain-export.log"), true); if (!command_line::is_arg_defaulted(vm, arg_log_level)) mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); else diff --git a/src/blockchain_utilities/blockchain_import.cpp b/src/blockchain_utilities/blockchain_import.cpp index caa549c132..3cdc135f00 100644 --- a/src/blockchain_utilities/blockchain_import.cpp +++ b/src/blockchain_utilities/blockchain_import.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -43,8 +44,8 @@ #include "blockchain_db/db_types.h" #include "cryptonote_core/cryptonote_core.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bcutil" namespace { @@ -641,7 +642,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } @@ -679,7 +680,7 @@ int main(int argc, char* argv[]) m_config_folder = command_line::get_arg(vm, cryptonote::arg_data_dir); db_arg_str = command_line::get_arg(vm, arg_database); - mlog_configure(mlog_get_default_log_path("monero-blockchain-import.log"), true); + mlog_configure(mlog_get_default_log_path("loki-blockchain-import.log"), true); if (!command_line::is_arg_defaulted(vm, arg_log_level)) mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); else diff --git a/src/blockchain_utilities/blockchain_usage.cpp b/src/blockchain_utilities/blockchain_usage.cpp index 7c3c83167e..0f0c3a7437 100644 --- a/src/blockchain_utilities/blockchain_usage.cpp +++ b/src/blockchain_utilities/blockchain_usage.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -37,8 +38,8 @@ #include "blockchain_db/db_types.h" #include "version.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bcutil" namespace po = boost::program_options; using namespace epee; @@ -129,12 +130,12 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } - mlog_configure(mlog_get_default_log_path("monero-blockchain-usage.log"), true); + mlog_configure(mlog_get_default_log_path("loki-blockchain-usage.log"), true); if (!command_line::is_arg_defaulted(vm, arg_log_level)) mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str()); else diff --git a/src/blockchain_utilities/blocksdat_file.cpp b/src/blockchain_utilities/blocksdat_file.cpp index 45ef33acb0..b2c4c47b79 100644 --- a/src/blockchain_utilities/blocksdat_file.cpp +++ b/src/blockchain_utilities/blocksdat_file.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -28,8 +29,8 @@ #include "blocksdat_file.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bcutil" namespace po = boost::program_options; diff --git a/src/blockchain_utilities/bootstrap_file.cpp b/src/blockchain_utilities/bootstrap_file.cpp index aa85e5e531..40eeb83207 100644 --- a/src/blockchain_utilities/bootstrap_file.cpp +++ b/src/blockchain_utilities/bootstrap_file.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -32,8 +33,8 @@ #include "bootstrap_file.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bcutil" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bcutil" namespace po = boost::program_options; @@ -43,7 +44,7 @@ using namespace epee; namespace { // This number was picked by taking the leading 4 bytes from this output: - // echo Monero bootstrap file | sha1sum + // echo Loki bootstrap file | sha1sum const uint32_t blockchain_raw_magic = 0x28721586; const uint32_t header_size = 1024; diff --git a/src/checkpoints/checkpoints.cpp b/src/checkpoints/checkpoints.cpp index a62b7a1256..07ca2a0dbe 100644 --- a/src/checkpoints/checkpoints.cpp +++ b/src/checkpoints/checkpoints.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -40,8 +41,8 @@ using namespace epee; #include "storages/portable_storage_template_helper.h" // epee json include #include "serialization/keyvalue_serialization.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "checkpoints" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "checkpoints" namespace cryptonote { diff --git a/src/common/dns_utils.cpp b/src/common/dns_utils.cpp index 1ecdae8ec4..7ec1763e25 100644 --- a/src/common/dns_utils.cpp +++ b/src/common/dns_utils.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -40,8 +41,8 @@ using namespace epee; namespace bf = boost::filesystem; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.dns" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.dns" static const char *DEFAULT_DNS_PUBLIC_ADDR[] = { @@ -370,9 +371,9 @@ std::string address_from_txt_record(const std::string& s) return {}; } /** - * @brief gets a monero address from the TXT record of a DNS entry + * @brief gets a loki address from the TXT record of a DNS entry * - * gets the monero address from the TXT record of the DNS entry associated + * gets the loki address from the TXT record of the DNS entry associated * with . If this lookup fails, or the TXT record does not contain an * XMR address in the correct format, returns an empty string. * will be set true or false according to whether or not the DNS query passes @@ -381,7 +382,7 @@ std::string address_from_txt_record(const std::string& s) * @param url the url to look up * @param dnssec_valid return-by-reference for DNSSEC status of query * - * @return a monero address (as a string) or an empty string + * @return a loki address (as a string) or an empty string */ std::vector addresses_from_url(const std::string& url, bool& dnssec_valid) { @@ -398,7 +399,7 @@ std::vector addresses_from_url(const std::string& url, bool& dnssec } else dnssec_valid = false; - // for each txt record, try to find a monero address in it. + // for each txt record, try to find a loki address in it. for (auto& rec : records) { std::string addr = address_from_txt_record(rec); diff --git a/src/common/download.cpp b/src/common/download.cpp index 6698a5abfe..3c9dd7ede9 100644 --- a/src/common/download.cpp +++ b/src/common/download.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -37,8 +38,8 @@ #include "net/http_client.h" #include "download.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.dl" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.dl" namespace tools { diff --git a/src/common/i18n.cpp b/src/common/i18n.cpp index 4a89876fbc..cacd992c03 100644 --- a/src/common/i18n.cpp +++ b/src/common/i18n.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -37,8 +38,8 @@ #include "common/i18n.h" #include "translation_files.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "i18n" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "i18n" static const unsigned char qm_magic[16] = {0x3c, 0xb8, 0x64, 0x18, 0xca, 0xef, 0x9c, 0x95, 0xcd, 0x21, 0x1c, 0xbf, 0x60, 0xa1, 0xbd, 0xdd}; diff --git a/src/common/perf_timer.cpp b/src/common/perf_timer.cpp index 16abdfd991..70f266f33e 100644 --- a/src/common/perf_timer.cpp +++ b/src/common/perf_timer.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2016-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -30,8 +31,8 @@ #include "misc_os_dependent.h" #include "perf_timer.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "perf" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "perf" namespace { diff --git a/src/common/perf_timer.h b/src/common/perf_timer.h index 0e910caf9f..12b6649a38 100644 --- a/src/common/perf_timer.h +++ b/src/common/perf_timer.h @@ -1,4 +1,5 @@ // Copyright (c) 2016-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -33,8 +34,8 @@ #include #include "misc_log_ex.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "perf" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "perf" namespace tools { diff --git a/src/common/stack_trace.cpp b/src/common/stack_trace.cpp index 9c2bf4b537..aa1b454bbe 100644 --- a/src/common/stack_trace.cpp +++ b/src/common/stack_trace.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2016-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -46,10 +47,10 @@ #include "common/stack_trace.h" #include "misc_log_ex.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "stacktrace" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "stacktrace" -#define ST_LOG(x) CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,MONERO_DEFAULT_LOG_CATEGORY) << x +#define ST_LOG(x) CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,LOKI_DEFAULT_LOG_CATEGORY) << x // from http://stackoverflow.com/questions/11665829/how-can-i-print-stack-trace-for-caught-exceptions-in-c-code-injection-in-c diff --git a/src/common/updates.cpp b/src/common/updates.cpp index 9eb402e0b5..134eeea8e3 100644 --- a/src/common/updates.cpp +++ b/src/common/updates.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -32,8 +33,8 @@ #include "dns_utils.h" #include "updates.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "updates" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "updates" namespace tools { diff --git a/src/cryptonote_basic/account.cpp b/src/cryptonote_basic/account.cpp index bab991d19b..6872440420 100644 --- a/src/cryptonote_basic/account.cpp +++ b/src/cryptonote_basic/account.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -41,8 +42,8 @@ extern "C" #include "cryptonote_basic_impl.h" #include "cryptonote_format_utils.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "account" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "account" using namespace std; diff --git a/src/cryptonote_basic/cryptonote_basic_impl.cpp b/src/cryptonote_basic/cryptonote_basic_impl.cpp index 11e70e6111..7d1add6cf9 100644 --- a/src/cryptonote_basic/cryptonote_basic_impl.cpp +++ b/src/cryptonote_basic/cryptonote_basic_impl.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -43,8 +44,8 @@ using namespace epee; #include "common/int-util.h" #include "common/dns_utils.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "cn" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "cn" namespace cryptonote { diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index ae7c1c0ae6..822ef6b10c 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -42,8 +43,8 @@ using namespace epee; #include "crypto/hash.h" #include "ringct/rctSigs.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "cn" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "cn" #define ENCRYPTED_PAYMENT_ID_TAIL 0x8d @@ -694,16 +695,14 @@ namespace cryptonote decimal_point = default_decimal_point; switch (std::atomic_load(&default_decimal_point)) { - case 12: - return "monero"; case 9: - return "millinero"; + return "loki"; case 6: - return "micronero"; + return "megarok"; case 3: - return "nanonero"; + return "kilorok"; case 0: - return "piconero"; + return "rok"; default: ASSERT_MES_AND_THROW("Invalid decimal point specification: " << default_decimal_point); } diff --git a/src/cryptonote_basic/difficulty.cpp b/src/cryptonote_basic/difficulty.cpp index cb2a00a128..75f6bf6abe 100644 --- a/src/cryptonote_basic/difficulty.cpp +++ b/src/cryptonote_basic/difficulty.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -39,8 +40,8 @@ #include "cryptonote_config.h" #include "difficulty.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "difficulty" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "difficulty" namespace cryptonote { diff --git a/src/cryptonote_basic/hardfork.cpp b/src/cryptonote_basic/hardfork.cpp index 95f1ecab9d..a19405a6bf 100644 --- a/src/cryptonote_basic/hardfork.cpp +++ b/src/cryptonote_basic/hardfork.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -33,8 +34,8 @@ #include "blockchain_db/blockchain_db.h" #include "hardfork.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "hardfork" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "hardfork" using namespace cryptonote; diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index 2c777f5a26..27cfce1c79 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -69,8 +70,8 @@ #include #endif -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "miner" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "miner" using namespace epee; diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 6fe369bce9..685507ada7 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -56,8 +57,8 @@ #include "blocks/blocks.h" #endif -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "blockchain" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "blockchain" #define FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE (100*1024*1024) // 100 MB @@ -89,7 +90,7 @@ static const struct { uint8_t threshold; time_t time; } mainnet_hard_forks[] = { - // version 7 from the start of the blockchain, inhereted from Monero mainnet + // version 7 from the start of the blockchain, inhereted from Loki mainnet { 7, 1, 0, 1503046577 }, }; static const uint64_t mainnet_hard_fork_version_1_till = 0; @@ -100,7 +101,7 @@ static const struct { uint8_t threshold; time_t time; } testnet_hard_forks[] = { - // version 7 from the start of the blockchain, inhereted from Monero testnet + // version 7 from the start of the blockchain, inhereted from Loki testnet { 7, 1, 0, 1512211236 }, }; static const uint64_t testnet_hard_fork_version_1_till = 624633; diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index e4a4cb2f16..6e98b3a69d 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -55,8 +56,8 @@ using namespace epee; #include "ringct/rctSigs.h" #include "version.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "cn" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "cn" DISABLE_VS_WARNINGS(4355) @@ -1372,7 +1373,7 @@ namespace cryptonote { std::string main_message; if (m_offline) - main_message = "The daemon is running offline and will not attempt to sync to the Monero network."; + main_message = "The daemon is running offline and will not attempt to sync to the Loki network."; else main_message = "The daemon will start synchronizing with the network. This may take a long time to complete."; MGINFO_YELLOW(ENDL << "**********************************************************************" << ENDL @@ -1450,7 +1451,7 @@ namespace cryptonote if (!tools::check_updates(software, buildtag, version, hash)) return false; - if (tools::vercmp(version.c_str(), MONERO_VERSION) <= 0) + if (tools::vercmp(version.c_str(), LOKI_VERSION) <= 0) return true; std::string url = tools::get_update_url(software, subdir, buildtag, version, true); diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 0af9737a7f..f62473fc72 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -46,8 +47,8 @@ #include "common/perf_timer.h" #include "crypto/hash.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "txpool" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "txpool" DISABLE_VS_WARNINGS(4244 4345 4503) //'boost::foreach_detail_::or_' : decorated name length exceeded, name was truncated diff --git a/src/cryptonote_protocol/block_queue.cpp b/src/cryptonote_protocol/block_queue.cpp index 9ae33d5401..4054d46ce4 100644 --- a/src/cryptonote_protocol/block_queue.cpp +++ b/src/cryptonote_protocol/block_queue.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -35,8 +36,8 @@ #include "cryptonote_protocol_defs.h" #include "block_queue.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "cn.block_queue" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "cn.block_queue" namespace std { static_assert(sizeof(size_t) <= sizeof(boost::uuids::uuid), "boost::uuids::uuid too small"); diff --git a/src/cryptonote_protocol/block_queue.h b/src/cryptonote_protocol/block_queue.h index 69ddaa4358..8893f720b7 100644 --- a/src/cryptonote_protocol/block_queue.h +++ b/src/cryptonote_protocol/block_queue.h @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -36,8 +37,8 @@ #include #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "cn.block_queue" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "cn.block_queue" namespace cryptonote { diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp index c9fd40d88f..40f43cf87c 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp +++ b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp @@ -3,6 +3,7 @@ /// @brief This is the place to implement our handlers for protocol network actions, e.g. for ratelimit for download-requests // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -74,8 +75,8 @@ #include "cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal() -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.cn" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.cn" // ################################################################################################ // ################################################################################################ diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 5d91ad5693..a0262c4526 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -3,6 +3,7 @@ /// @brief This is the original cryptonote protocol network-events handler, modified by us // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -43,8 +44,8 @@ #include "profile_tools.h" #include "net/network_throttle-detail.hpp" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.cn" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.cn" #define MLOG_P2P_MESSAGE(x) MCINFO("net.p2p.msg", context << x) @@ -865,7 +866,7 @@ namespace cryptonote auto time_from_epoh = point.time_since_epoch(); auto sec = duration_cast< seconds >( time_from_epoh ).count();*/ - //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size()); + //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-loki/net/req-all.data", sec, get_avg_block_size()); if(context.m_last_response_height > arg.current_blockchain_height) { @@ -1505,7 +1506,7 @@ skip: context.m_last_request_time = boost::posix_time::microsec_clock::universal_time(); LOG_PRINT_CCONTEXT_L1("-->>NOTIFY_REQUEST_GET_OBJECTS: blocks.size()=" << req.blocks.size() << ", txs.size()=" << req.txs.size() << "requested blocks count=" << count << " / " << count_limit << " from " << span.first << ", first hash " << req.blocks.front()); - //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size()); + //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-loki/net/req-all.data", sec, get_avg_block_size()); post_notify(req, context); return true; @@ -1532,7 +1533,7 @@ skip: //std::string blob; // for calculate size of request //epee::serialization::store_t_to_binary(r, blob); - //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size()); + //epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-loki/net/req-all.data", sec, get_avg_block_size()); //LOG_PRINT_CCONTEXT_L1("r = " << 200); context.m_last_request_time = boost::posix_time::microsec_clock::universal_time(); @@ -1573,7 +1574,7 @@ skip: if(m_synchronized.compare_exchange_strong(val_expected, true)) { MGINFO_YELLOW(ENDL << "**********************************************************************" << ENDL - << "You are now synchronized with the network. You may now start monero-wallet-cli." << ENDL + << "You are now synchronized with the network. You may now start loki-wallet-cli." << ENDL << ENDL << "Use the \"help\" command to see the list of available commands." << ENDL << "**********************************************************************"); diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 7a89ebc0c9..54b4dd2f8a 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -29,8 +30,8 @@ #include "common/dns_utils.h" #include "daemon/command_parser_executor.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/command_server.cpp b/src/daemon/command_server.cpp index a50dbea690..188f1af8c7 100644 --- a/src/daemon/command_server.cpp +++ b/src/daemon/command_server.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -32,8 +33,8 @@ #include "string_tools.h" #include "daemon/command_server.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { @@ -205,12 +206,12 @@ t_command_server::t_command_server( m_command_lookup.set_handler( "start_save_graph" , std::bind(&t_command_parser_executor::start_save_graph, &m_parser, p::_1) - , "Start saving data for dr monero." + , "Start saving data for dr loki." ); m_command_lookup.set_handler( "stop_save_graph" , std::bind(&t_command_parser_executor::stop_save_graph, &m_parser, p::_1) - , "Stop saving data for dr monero." + , "Stop saving data for dr loki." ); m_command_lookup.set_handler( "hard_fork_info" @@ -329,7 +330,7 @@ bool t_command_server::help(const std::vector& args) std::string t_command_server::get_commands_str() { std::stringstream ss; - ss << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << std::endl; + ss << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << std::endl; ss << "Commands: " << std::endl; std::string usage = m_command_lookup.get_usage(); boost::replace_all(usage, "\n", "\n "); diff --git a/src/daemon/core.h b/src/daemon/core.h index 475f418d65..e73d0ac68f 100644 --- a/src/daemon/core.h +++ b/src/daemon/core.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -32,8 +33,8 @@ #include "cryptonote_protocol/cryptonote_protocol_handler.h" #include "misc_log_ex.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index 48671f190c..deadb1e3f5 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -51,8 +52,8 @@ using namespace epee; #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/daemon.h b/src/daemon/daemon.h index 1e356ef5f2..4f79df5a0e 100644 --- a/src/daemon/daemon.h +++ b/src/daemon/daemon.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -29,8 +30,8 @@ #pragma once #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/executor.cpp b/src/daemon/executor.cpp index fbc7d04fd6..ebd35f9027 100644 --- a/src/daemon/executor.cpp +++ b/src/daemon/executor.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -35,12 +36,12 @@ #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { - std::string const t_executor::NAME = "Monero Daemon"; + std::string const t_executor::NAME = "Loki Daemon"; void t_executor::init_options( boost::program_options::options_description & configurable_options @@ -58,7 +59,7 @@ namespace daemonize boost::program_options::variables_map const & vm ) { - LOG_PRINT_L0("Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ") Daemonised"); + LOG_PRINT_L0("Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ") Daemonised"); return t_daemon{vm}; } diff --git a/src/daemon/executor.h b/src/daemon/executor.h index 79d70567aa..b8f25696b9 100644 --- a/src/daemon/executor.h +++ b/src/daemon/executor.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -33,8 +34,8 @@ #include #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 50384b2a68..7fee063281 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -50,8 +51,8 @@ #include "common/stack_trace.h" #endif // STACK_TRACE -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace po = boost::program_options; namespace bf = boost::filesystem; @@ -118,16 +119,16 @@ int main(int argc, char const * argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL << ENDL; std::cout << "Usage: " + std::string{argv[0]} + " [options|settings] [daemon_command...]" << std::endl << std::endl; std::cout << visible_options << std::endl; return 0; } - // Monero Version + // Loki Version if (command_line::get_arg(vm, command_line::arg_version)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL; return 0; } @@ -157,7 +158,7 @@ int main(int argc, char const * argv[]) } // data_dir - // default: e.g. ~/.bitmonero/ or ~/.bitmonero/testnet + // default: e.g. ~/.loki/ or ~/.loki/testnet // if data-dir argument given: // absolute path // relative path: relative to cwd @@ -277,7 +278,7 @@ int main(int argc, char const * argv[]) tools::set_max_concurrency(command_line::get_arg(vm, daemon_args::arg_max_concurrency)); // logging is now set up - MGINFO("Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")"); + MGINFO("Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")"); MINFO("Moving from main() into the daemonize now."); diff --git a/src/daemon/p2p.h b/src/daemon/p2p.h index 0f01c746df..577fee1b2b 100644 --- a/src/daemon/p2p.h +++ b/src/daemon/p2p.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -34,8 +35,8 @@ #include "p2p/net_node.h" #include "daemon/protocol.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/protocol.h b/src/daemon/protocol.h index fd1d1b6386..ab63920e03 100644 --- a/src/daemon/protocol.h +++ b/src/daemon/protocol.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -30,8 +31,8 @@ #pragma once -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/rpc.h b/src/daemon/rpc.h index 9621b0d015..dfcfa31574 100644 --- a/src/daemon/rpc.h +++ b/src/daemon/rpc.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -32,8 +33,8 @@ #include "rpc/core_rpc_server.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 73b8d1a187..eadde5d1f9 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -39,8 +40,8 @@ #include #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { @@ -1099,8 +1100,8 @@ bool t_rpc_command_executor::stop_daemon() //# ifdef WIN32 // // Stop via service API // // TODO - this is only temporary! Get rid of hard-coded constants! -// bool ok = windows::stop_service("BitMonero Daemon"); -// ok = windows::uninstall_service("BitMonero Daemon"); +// bool ok = windows::stop_service("Loki Daemon"); +// ok = windows::uninstall_service("Loki Daemon"); // //bool ok = windows::stop_service(SERVICE_NAME); // //ok = windows::uninstall_service(SERVICE_NAME); // if (ok) @@ -1144,10 +1145,10 @@ bool t_rpc_command_executor::print_status() bool daemon_is_alive = m_rpc_client->check_connection(); if(daemon_is_alive) { - tools::success_msg_writer() << "monerod is running"; + tools::success_msg_writer() << "lokid is running"; } else { - tools::fail_msg_writer() << "monerod is NOT running"; + tools::fail_msg_writer() << "lokid is NOT running"; } return true; diff --git a/src/daemon/rpc_command_executor.h b/src/daemon/rpc_command_executor.h index 46168c93b9..69164d8ae1 100644 --- a/src/daemon/rpc_command_executor.h +++ b/src/daemon/rpc_command_executor.h @@ -7,6 +7,7 @@ */ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -45,8 +46,8 @@ #include "cryptonote_basic/cryptonote_basic.h" #include "rpc/core_rpc_server.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon" namespace daemonize { diff --git a/src/daemonizer/posix_daemonizer.inl b/src/daemonizer/posix_daemonizer.inl index b3f3f262f3..77a3b3e22d 100644 --- a/src/daemonizer/posix_daemonizer.inl +++ b/src/daemonizer/posix_daemonizer.inl @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -100,7 +101,7 @@ namespace daemonizer } else { - //LOG_PRINT_L0("Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL); + //LOG_PRINT_L0("Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL); return executor.run_interactive(vm); } } diff --git a/src/daemonizer/windows_daemonizer.inl b/src/daemonizer/windows_daemonizer.inl index 8077f29fb6..3935280114 100644 --- a/src/daemonizer/windows_daemonizer.inl +++ b/src/daemonizer/windows_daemonizer.inl @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -175,7 +176,7 @@ namespace daemonizer } else // interactive { - //LOG_PRINT_L0("Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL); + //LOG_PRINT_L0("Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL); return executor.run_interactive(vm); } diff --git a/src/debug_utilities/cn_deserialize.cpp b/src/debug_utilities/cn_deserialize.cpp index dfbd3b8645..d2c141d6a9 100644 --- a/src/debug_utilities/cn_deserialize.cpp +++ b/src/debug_utilities/cn_deserialize.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -33,8 +34,8 @@ #include "common/command_line.h" #include "version.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "debugtools.deserialize" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "debugtools.deserialize" namespace po = boost::program_options; using namespace epee; @@ -93,7 +94,7 @@ int main(int argc, char* argv[]) if (command_line::get_arg(vm, command_line::arg_help)) { - std::cout << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL << ENDL; + std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL << ENDL; std::cout << desc_options << std::endl; return 1; } diff --git a/src/debug_utilities/object_sizes.cpp b/src/debug_utilities/object_sizes.cpp index a3d037a59d..6c337a948f 100644 --- a/src/debug_utilities/object_sizes.cpp +++ b/src/debug_utilities/object_sizes.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -43,8 +44,8 @@ #include "wallet/api/unsigned_transaction.h" #include "wallet/api/pending_transaction.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "debugtools.objectsizes" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "debugtools.objectsizes" class size_logger { @@ -104,12 +105,12 @@ int main(int argc, char* argv[]) SL(tools::wallet2::unsigned_tx_set); SL(tools::wallet2::signed_tx_set); - SL(Monero::WalletImpl); - SL(Monero::AddressBookRow); - SL(Monero::TransactionInfoImpl); - SL(Monero::TransactionHistoryImpl); - SL(Monero::PendingTransactionImpl); - SL(Monero::UnsignedTransactionImpl); + SL(Loki::WalletImpl); + SL(Loki::AddressBookRow); + SL(Loki::TransactionInfoImpl); + SL(Loki::TransactionHistoryImpl); + SL(Loki::PendingTransactionImpl); + SL(Loki::UnsignedTransactionImpl); return 0; } diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index b3c0035a1d..b44b6b9a96 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -41,8 +42,8 @@ namespace hw { #ifdef WITH_DEVICE_LEDGER - #undef MONERO_DEFAULT_LOG_CATEGORY - #define MONERO_DEFAULT_LOG_CATEGORY "device.ledger" + #undef LOKI_DEFAULT_LOG_CATEGORY + #define LOKI_DEFAULT_LOG_CATEGORY "device.ledger" /* ===================================================================== */ /* === Debug ==== */ diff --git a/src/device/log.cpp b/src/device/log.cpp index a2ad0f4f49..ccaf05f726 100644 --- a/src/device/log.cpp +++ b/src/device/log.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -35,8 +36,8 @@ namespace hw { #ifdef WITH_DEVICE_LEDGER namespace ledger { - #undef MONERO_DEFAULT_LOG_CATEGORY - #define MONERO_DEFAULT_LOG_CATEGORY "device.ledger" + #undef LOKI_DEFAULT_LOG_CATEGORY + #define LOKI_DEFAULT_LOG_CATEGORY "device.ledger" void buffer_to_str(char *to_buff, size_t to_len, const char *buff, size_t len) { CHECK_AND_ASSERT_THROW_MES(to_len > (len*2), "destination buffer too short. At least" << (len*2+1) << " bytes required"); @@ -161,4 +162,4 @@ namespace hw { } #endif //WITH_DEVICE_LEDGER -} \ No newline at end of file +} diff --git a/src/gen_multisig/gen_multisig.cpp b/src/gen_multisig/gen_multisig.cpp index 943589b4a2..1000657ed5 100644 --- a/src/gen_multisig/gen_multisig.cpp +++ b/src/gen_multisig/gen_multisig.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -53,8 +54,8 @@ using namespace cryptonote; using boost::lexical_cast; namespace po = boost::program_options; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.gen_multisig" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.gen_multisig" namespace genms { @@ -176,12 +177,12 @@ int main(int argc, char* argv[]) const auto vm = wallet_args::main( argc, argv, - "monero-gen-multisig [(--testnet|--stagenet)] [--filename-base=] [--scheme=M/N] [--threshold=M] [--participants=N]", + "loki-gen-multisig [(--testnet|--stagenet)] [--filename-base=] [--scheme=M/N] [--threshold=M] [--participants=N]", genms::tr("This program generates a set of multisig wallets - use this simpler scheme only if all the participants trust each other"), desc_params, boost::program_options::positional_options_description(), [](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; }, - "monero-gen-multisig.log" + "loki-gen-multisig.log" ); if (!vm) return 1; diff --git a/src/multisig/multisig.cpp b/src/multisig/multisig.cpp index d85c477720..09a06933d9 100644 --- a/src/multisig/multisig.cpp +++ b/src/multisig/multisig.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2017-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -34,8 +35,8 @@ #include "cryptonote_basic/cryptonote_format_utils.h" #include "multisig.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "multisig" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "multisig" using namespace std; diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 663c4cab5e..296d9489d9 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -60,8 +61,8 @@ #include "upnperrors.h" #endif -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "net.p2p" #define NET_MAKE_IP(b1,b2,b3,b4) ((LPARAM)(((DWORD)(b1)<<24)+((DWORD)(b2)<<16)+((DWORD)(b3)<<8)+((DWORD)(b4)))) @@ -1416,7 +1417,7 @@ namespace nodetool } rsp.connections_count = m_net_server.get_config_object().get_connections_count(); rsp.incoming_connections_count = rsp.connections_count - get_outgoing_connections_count(); - rsp.version = MONERO_VERSION_FULL; + rsp.version = LOKI_VERSION_FULL; rsp.os_version = tools::get_os_version_string(); m_payload_handler.get_stat_info(rsp.payload_info); return 1; diff --git a/src/ringct/bulletproofs.cc b/src/ringct/bulletproofs.cc index fd15ffbc45..5832b0d66b 100644 --- a/src/ringct/bulletproofs.cc +++ b/src/ringct/bulletproofs.cc @@ -40,8 +40,8 @@ extern "C" #include "rctOps.h" #include "bulletproofs.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "bulletproofs" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "bulletproofs" //#define DEBUG_BP diff --git a/src/ringct/rctOps.cpp b/src/ringct/rctOps.cpp index cc46d0aa78..eb91ca009e 100644 --- a/src/ringct/rctOps.cpp +++ b/src/ringct/rctOps.cpp @@ -34,8 +34,8 @@ using namespace crypto; using namespace std; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "ringct" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "ringct" #define CHECK_AND_ASSERT_THROW_MES_L1(expr, message) {if(!(expr)) {MWARNING(message); throw std::runtime_error(message);}} diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index 4ecf62cec6..f41741af9f 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2016, Monero Research Labs +// Copyright (c) 2018, The Loki Project // // Author: Shen Noether // @@ -39,8 +39,8 @@ using namespace crypto; using namespace std; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "ringct" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "ringct" namespace rct { bool is_simple(int type) diff --git a/src/ringct/rctTypes.cpp b/src/ringct/rctTypes.cpp index 5650b3ba11..193a0a2be7 100644 --- a/src/ringct/rctTypes.cpp +++ b/src/ringct/rctTypes.cpp @@ -32,8 +32,8 @@ using namespace crypto; using namespace std; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "ringct" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "ringct" namespace rct { diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index c3d1a9d119..5cd70127cb 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -49,8 +50,8 @@ using namespace epee; #include "p2p/net_node.h" #include "version.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "daemon.rpc" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "daemon.rpc" #define MAX_RESTRICTED_FAKE_OUTS_COUNT 40 #define MAX_RESTRICTED_GLOBAL_FAKE_OUTS_COUNT 5000 @@ -1914,7 +1915,7 @@ namespace cryptonote res.status = "Error checking for updates"; return true; } - if (tools::vercmp(version.c_str(), MONERO_VERSION) <= 0) + if (tools::vercmp(version.c_str(), LOKI_VERSION) <= 0) { res.update = false; res.status = CORE_RPC_STATUS_OK; diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4e51222376..3323b40e77 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -80,8 +81,8 @@ using boost::lexical_cast; namespace po = boost::program_options; typedef cryptonote::simple_wallet sw; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.simplewallet" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.simplewallet" #define EXTENDED_LOGS_FILE "wallet_details.log" @@ -89,7 +90,7 @@ typedef cryptonote::simple_wallet sw; #define MIN_RING_SIZE 10 // Used to inform user about min ring size -- does not track actual protocol -#define OUTPUT_EXPORT_FILE_MAGIC "Monero output export\003" +#define OUTPUT_EXPORT_FILE_MAGIC "Loki output export\003" #define LOCK_IDLE_SCOPE() \ bool auto_refresh_enabled = m_auto_refresh_enabled.load(std::memory_order_relaxed); \ @@ -132,7 +133,7 @@ namespace const command_line::arg_descriptor arg_trusted_daemon = {"trusted-daemon", sw::tr("Enable commands which rely on a trusted daemon"), false}; const command_line::arg_descriptor arg_allow_mismatched_daemon_version = {"allow-mismatched-daemon-version", sw::tr("Allow communicating with a daemon that uses a different RPC version"), false}; const command_line::arg_descriptor arg_restore_height = {"restore-height", sw::tr("Restore from specific blockchain height"), 0}; - const command_line::arg_descriptor arg_do_not_relay = {"do-not-relay", sw::tr("The newly created transaction will not be relayed to the monero network"), false}; + const command_line::arg_descriptor arg_do_not_relay = {"do-not-relay", sw::tr("The newly created transaction will not be relayed to the loki network"), false}; const command_line::arg_descriptor arg_create_address_file = {"create-address-file", sw::tr("Create an address file for new wallets"), false}; const command_line::arg_descriptor arg_subaddress_lookahead = {"subaddress-lookahead", tools::wallet2::tr("Set subaddress lookahead sizes to :"), ""}; const command_line::arg_descriptor arg_use_english_language_names = {"use-english-language-names", sw::tr("Display English language names"), false}; @@ -142,7 +143,7 @@ namespace #ifdef WIN32 // Translate from CP850 to UTF-8; // std::getline for a Windows console returns a string in CP437 or CP850; as simplewallet, - // like all of Monero, is assumed to work internally with UTF-8 throughout, even on Windows + // like all of Loki, is assumed to work internally with UTF-8 throughout, even on Windows // (although only implemented partially), a translation to UTF-8 is needed for input. // // Note that if a program is started inside the MSYS2 shell somebody already translates @@ -335,7 +336,7 @@ namespace std::stringstream prompt; prompt << tr("For URL: ") << url << ", " << dnssec_str << std::endl - << tr(" Monero Address = ") << addresses[0] + << tr(" Loki Address = ") << addresses[0] << std::endl << tr("Is this OK? (Y/n) ") ; @@ -758,7 +759,7 @@ bool simple_wallet::print_fee_info(const std::vector &args/* = std: } const uint64_t per_kb_fee = m_wallet->get_per_kb_fee(); const uint64_t typical_size_kb = 13; - message_writer() << (boost::format(tr("Current fee is %s monero per kB")) % print_money(per_kb_fee)).str(); + message_writer() << (boost::format(tr("Current fee is %s loki per kB")) % print_money(per_kb_fee)).str(); std::vector fees; for (uint32_t priority = 1; priority <= 4; ++priority) @@ -1289,7 +1290,7 @@ bool simple_wallet::export_raw_multisig(const std::vector &args) for (auto &ptx: txs.m_ptx) { const crypto::hash txid = cryptonote::get_transaction_hash(ptx.tx); - const std::string filename = std::string("raw_multisig_monero_tx_") + epee::string_tools::pod_to_hex(txid); + const std::string filename = std::string("raw_multisig_loki_tx_") + epee::string_tools::pod_to_hex(txid); if (!filenames.empty()) filenames += ", "; filenames += filename; @@ -2162,12 +2163,12 @@ simple_wallet::simple_wallet() "auto-low-priority <1|0>\n " " Whether to automatically use the low priority fee level when it's safe to do so.\n " "segregate-pre-fork-outputs <1|0>\n " - " Set this if you intend to spend outputs on both Monero AND a key reusing fork.\n " + " Set this if you intend to spend outputs on both Loki AND a key reusing fork.\n " "key-reuse-mitigation2 <1|0>\n " - " Set this if you are not sure whether you will spend on a key reusing Monero fork later.\n" + " Set this if you are not sure whether you will spend on a key reusing Loki fork later.\n" "subaddress-lookahead :\n " " Set the lookahead sizes for the subaddress hash table.\n " - " Set this if you are not sure whether you will spend on a key reusing Monero fork later.\n " + " Set this if you are not sure whether you will spend on a key reusing Loki fork later.\n " "segregation-height \n " " Set to the height of a key reusing fork you want to use, 0 to use default.")); m_cmd_binder.set_handler("encrypted_seed", @@ -3302,7 +3303,7 @@ bool simple_wallet::new_wallet(const boost::program_options::variables_map& vm, "To start synchronizing with the daemon, use the \"refresh\" command.\n" "Use the \"help\" command to see the list of available commands.\n" "Use \"help \" to see a command's documentation.\n" - "Always use the \"exit\" command when closing monero-wallet-cli to save \n" + "Always use the \"exit\" command when closing loki-wallet-cli to save \n" "your current session's state. Otherwise, you might need to synchronize \n" "your wallet again (your wallet keys are NOT at risk in any case).\n") ; @@ -4379,7 +4380,7 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vector 1000000) { - fail_msg_writer() << tr("Locked blocks too high, max 1000000 (˜4 yrs)"); + fail_msg_writer() << tr("Locked blocks too high, max 1000000 (??4 yrs)"); return true; } local_args.pop_back(); @@ -4597,26 +4598,26 @@ bool simple_wallet::transfer_main(int transfer_type, const std::vectormultisig()) { - bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_monero_tx"); + bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx"; } } else if (m_wallet->watch_only()) { - bool r = m_wallet->save_tx(ptx_vector, "unsigned_monero_tx"); + bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx"; } } else @@ -4705,26 +4706,26 @@ bool simple_wallet::sweep_unmixable(const std::vector &args_) // actually commit the transactions if (m_wallet->multisig()) { - bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_monero_tx"); + bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx"; } } else if (m_wallet->watch_only()) { - bool r = m_wallet->save_tx(ptx_vector, "unsigned_monero_tx"); + bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx"; } } else @@ -4938,26 +4939,26 @@ bool simple_wallet::sweep_main(uint64_t below, const std::vector &a // actually commit the transactions if (m_wallet->multisig()) { - bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_monero_tx"); + bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx"; } } else if (m_wallet->watch_only()) { - bool r = m_wallet->save_tx(ptx_vector, "unsigned_monero_tx"); + bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx"; } } else @@ -5135,26 +5136,26 @@ bool simple_wallet::sweep_single(const std::vector &args_) // actually commit the transactions if (m_wallet->multisig()) { - bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_monero_tx"); + bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx"; } } else if (m_wallet->watch_only()) { - bool r = m_wallet->save_tx(ptx_vector, "unsigned_monero_tx"); + bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx"); if (!r) { fail_msg_writer() << tr("Failed to write transaction(s) to file"); } else { - success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_monero_tx"; + success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx"; } } else @@ -5412,7 +5413,7 @@ bool simple_wallet::sign_transfer(const std::vector &args_) std::vector ptx; try { - bool r = m_wallet->sign_tx("unsigned_monero_tx", "signed_monero_tx", ptx, [&](const tools::wallet2::unsigned_tx_set &tx){ return accept_loaded_tx(tx); }, export_raw); + bool r = m_wallet->sign_tx("unsigned_loki_tx", "signed_loki_tx", ptx, [&](const tools::wallet2::unsigned_tx_set &tx){ return accept_loaded_tx(tx); }, export_raw); if (!r) { fail_msg_writer() << tr("Failed to sign transaction"); @@ -5432,7 +5433,7 @@ bool simple_wallet::sign_transfer(const std::vector &args_) txids_as_text += (", "); txids_as_text += epee::string_tools::pod_to_hex(get_transaction_hash(t.tx)); } - success_msg_writer(true) << tr("Transaction successfully signed to file ") << "signed_monero_tx" << ", txid " << txids_as_text; + success_msg_writer(true) << tr("Transaction successfully signed to file ") << "signed_loki_tx" << ", txid " << txids_as_text; if (export_raw) { std::string rawfiles_as_text; @@ -5440,7 +5441,7 @@ bool simple_wallet::sign_transfer(const std::vector &args_) { if (i > 0) rawfiles_as_text += ", "; - rawfiles_as_text += "signed_monero_tx_raw" + (ptx.size() == 1 ? "" : ("_" + std::to_string(i))); + rawfiles_as_text += "signed_loki_tx_raw" + (ptx.size() == 1 ? "" : ("_" + std::to_string(i))); } success_msg_writer(true) << tr("Transaction raw hex data exported to ") << rawfiles_as_text; } @@ -5460,7 +5461,7 @@ bool simple_wallet::submit_transfer(const std::vector &args_) try { std::vector ptx_vector; - bool r = m_wallet->load_tx("signed_monero_tx", ptx_vector, [&](const tools::wallet2::signed_tx_set &tx){ return accept_loaded_tx(tx); }); + bool r = m_wallet->load_tx("signed_loki_tx", ptx_vector, [&](const tools::wallet2::signed_tx_set &tx){ return accept_loaded_tx(tx); }); if (!r) { fail_msg_writer() << tr("Failed to load transaction from file"); @@ -5556,7 +5557,7 @@ bool simple_wallet::get_tx_proof(const std::vector &args) try { std::string sig_str = m_wallet->get_tx_proof(txid, info.address, info.is_subaddress, args.size() == 3 ? args[2] : ""); - const std::string filename = "monero_tx_proof"; + const std::string filename = "loki_tx_proof"; if (epee::file_io_utils::save_string_to_file(filename, sig_str)) success_msg_writer() << tr("signature file saved to: ") << filename; else @@ -5771,7 +5772,7 @@ bool simple_wallet::get_spend_proof(const std::vector &args) try { const std::string sig_str = m_wallet->get_spend_proof(txid, args.size() == 2 ? args[1] : ""); - const std::string filename = "monero_spend_proof"; + const std::string filename = "loki_spend_proof"; if (epee::file_io_utils::save_string_to_file(filename, sig_str)) success_msg_writer() << tr("signature file saved to: ") << filename; else @@ -5868,7 +5869,7 @@ bool simple_wallet::get_reserve_proof(const std::vector &args) try { const std::string sig_str = m_wallet->get_reserve_proof(account_minreserve, args.size() == 2 ? args[1] : ""); - const std::string filename = "monero_reserve_proof"; + const std::string filename = "loki_reserve_proof"; if (epee::file_io_utils::save_string_to_file(filename, sig_str)) success_msg_writer() << tr("signature file saved to: ") << filename; else @@ -7402,7 +7403,7 @@ void simple_wallet::commit_or_save(std::vector& ptx_ cryptonote::blobdata blob; tx_to_blob(ptx.tx, blob); const std::string blob_hex = epee::string_tools::buff_to_hex_nodelimer(blob); - const std::string filename = "raw_monero_tx" + (ptx_vector.size() == 1 ? "" : ("_" + std::to_string(i++))); + const std::string filename = "raw_loki_tx" + (ptx_vector.size() == 1 ? "" : ("_" + std::to_string(i++))); if (epee::file_io_utils::save_string_to_file(filename, blob_hex)) success_msg_writer(true) << tr("Transaction successfully saved to ") << filename << tr(", txid ") << txid; else @@ -7457,12 +7458,12 @@ int main(int argc, char* argv[]) const auto vm = wallet_args::main( argc, argv, - "monero-wallet-cli [--wallet-file=|--generate-new-wallet=] []", - sw::tr("This is the command line monero wallet. It needs to connect to a monero\ndaemon to work correctly."), + "loki-wallet-cli [--wallet-file=|--generate-new-wallet=] []", + sw::tr("This is the command line loki wallet. It needs to connect to a loki\ndaemon to work correctly."), desc_params, positional_options, [](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; }, - "monero-wallet-cli.log" + "loki-wallet-cli.log" ); if (!vm) diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index f26f693536..5e54d6e5c1 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -48,8 +49,8 @@ #include "common/password.h" #include "crypto/crypto.h" // for definition of crypto::secret_key -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.simplewallet" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.simplewallet" // Hardcode Monero's donation address (see #1447) constexpr const char MONERO_DONATION_ADDR[] = "44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A"; diff --git a/src/version.cpp.in b/src/version.cpp.in index f83a85d9d6..b95d60f8c9 100644 --- a/src/version.cpp.in +++ b/src/version.cpp.in @@ -1,11 +1,11 @@ -#define DEF_MONERO_VERSION_TAG "@VERSIONTAG@" -#define DEF_MONERO_VERSION "0.12.0.0-master" -#define DEF_MONERO_RELEASE_NAME "Lithium Luna" -#define DEF_MONERO_VERSION_FULL DEF_MONERO_VERSION "-" DEF_MONERO_VERSION_TAG +#define DEF_LOKI_VERSION_TAG "@VERSIONTAG@" +#define DEF_LOKI_VERSION "0.12.0.0-master" +#define DEF_LOKI_RELEASE_NAME "Lithium Luna" +#define DEF_LOKI_VERSION_FULL DEF_LOKI_VERSION "-" DEF_LOKI_VERSION_TAG #include "version.h" -const char* const MONERO_VERSION_TAG = DEF_MONERO_VERSION_TAG; -const char* const MONERO_VERSION = DEF_MONERO_VERSION; -const char* const MONERO_RELEASE_NAME = DEF_MONERO_RELEASE_NAME; -const char* const MONERO_VERSION_FULL = DEF_MONERO_VERSION_FULL; +const char* const LOKI_VERSION_TAG = DEF_LOKI_VERSION_TAG; +const char* const LOKI_VERSION = DEF_LOKI_VERSION; +const char* const LOKI_RELEASE_NAME = DEF_LOKI_RELEASE_NAME; +const char* const LOKI_VERSION_FULL = DEF_LOKI_VERSION_FULL; diff --git a/src/version.h b/src/version.h index d1d06c7907..5ccecdaa27 100644 --- a/src/version.h +++ b/src/version.h @@ -1,6 +1,6 @@ #pragma once -extern const char* const MONERO_VERSION_TAG; -extern const char* const MONERO_VERSION; -extern const char* const MONERO_RELEASE_NAME; -extern const char* const MONERO_VERSION_FULL; +extern const char* const LOKI_VERSION_TAG; +extern const char* const LOKI_VERSION; +extern const char* const LOKI_RELEASE_NAME; +extern const char* const LOKI_VERSION_FULL; diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index b02884f674..8ba6bdf9b7 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -53,8 +54,8 @@ using namespace std; using namespace cryptonote; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "WalletAPI" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "WalletAPI" namespace Monero { @@ -72,7 +73,7 @@ namespace { std::string get_default_ringdb_path() { boost::filesystem::path dir = tools::get_default_data_dir(); - // remove .bitmonero, replace with .shared-ringdb + // remove .loki, replace with .shared-ringdb dir = dir.remove_filename(); dir /= ".shared-ringdb"; return dir.string(); @@ -316,19 +317,19 @@ void Wallet::init(const char *argv0, const char *default_log_base_name) { } void Wallet::debug(const std::string &category, const std::string &str) { - MCDEBUG(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); + MCDEBUG(category.empty() ? LOKI_DEFAULT_LOG_CATEGORY : category.c_str(), str); } void Wallet::info(const std::string &category, const std::string &str) { - MCINFO(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); + MCINFO(category.empty() ? LOKI_DEFAULT_LOG_CATEGORY : category.c_str(), str); } void Wallet::warning(const std::string &category, const std::string &str) { - MCWARNING(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); + MCWARNING(category.empty() ? LOKI_DEFAULT_LOG_CATEGORY : category.c_str(), str); } void Wallet::error(const std::string &category, const std::string &str) { - MCERROR(category.empty() ? MONERO_DEFAULT_LOG_CATEGORY : category.c_str(), str); + MCERROR(category.empty() ? LOKI_DEFAULT_LOG_CATEGORY : category.c_str(), str); } ///////////////////////// WalletImpl implementation //////////////////////// diff --git a/src/wallet/api/wallet_manager.cpp b/src/wallet/api/wallet_manager.cpp index 80f5780b5e..c1c049b346 100644 --- a/src/wallet/api/wallet_manager.cpp +++ b/src/wallet/api/wallet_manager.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -40,8 +41,8 @@ #include #include -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "WalletAPI" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "WalletAPI" namespace epee { unsigned int g_test_dbg_lock_sleep = 0; @@ -321,7 +322,7 @@ std::tuple WalletManag if (!tools::check_updates(software, buildtag, version, hash)) return std::make_tuple(false, "", "", "", ""); - if (tools::vercmp(version.c_str(), MONERO_VERSION) > 0) + if (tools::vercmp(version.c_str(), LOKI_VERSION) > 0) { std::string user_url = tools::get_update_url(software, subdir, buildtag, version, true); std::string auto_url = tools::get_update_url(software, subdir, buildtag, version, false); diff --git a/src/wallet/ringdb.cpp b/src/wallet/ringdb.cpp index 44992520f9..944bf69114 100644 --- a/src/wallet/ringdb.cpp +++ b/src/wallet/ringdb.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -35,8 +36,8 @@ #include "wallet_errors.h" #include "ringdb.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.ringdb" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.ringdb" static const char zerokey[8] = {0}; static const MDB_val zerokeyval = { sizeof(zerokey), (void *)zerokey }; diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 15aa44c40a..565b861da2 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -78,8 +79,8 @@ using namespace std; using namespace crypto; using namespace cryptonote; -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.wallet2" // used to choose when to stop adding outputs to a tx #define APPROXIMATE_INPUT_BYTES 80 @@ -90,9 +91,9 @@ using namespace cryptonote; // arbitrary, used to generate different hashes from the same input #define CHACHA8_KEY_TAIL 0x8c -#define UNSIGNED_TX_PREFIX "Monero unsigned tx set\004" -#define SIGNED_TX_PREFIX "Monero signed tx set\004" -#define MULTISIG_UNSIGNED_TX_PREFIX "Monero multisig unsigned tx set\001" +#define UNSIGNED_TX_PREFIX "Loki unsigned tx set\004" +#define SIGNED_TX_PREFIX "Loki signed tx set\004" +#define MULTISIG_UNSIGNED_TX_PREFIX "Loki multisig unsigned tx set\001" #define RECENT_OUTPUT_RATIO (0.5) // 50% of outputs are from the recent zone #define RECENT_OUTPUT_DAYS (1.8) // last 1.8 day makes up the recent zone (taken from monerolink.pdf, Miller et al) @@ -106,9 +107,9 @@ using namespace cryptonote; #define SUBADDRESS_LOOKAHEAD_MAJOR 50 #define SUBADDRESS_LOOKAHEAD_MINOR 200 -#define KEY_IMAGE_EXPORT_FILE_MAGIC "Monero key image export\002" +#define KEY_IMAGE_EXPORT_FILE_MAGIC "Loki key image export\002" -#define MULTISIG_EXPORT_FILE_MAGIC "Monero multisig export\001" +#define MULTISIG_EXPORT_FILE_MAGIC "Loki multisig export\001" #define SEGREGATION_FORK_HEIGHT 1564965 #define TESTNET_SEGREGATION_FORK_HEIGHT 1000000 @@ -121,7 +122,7 @@ namespace std::string get_default_ringdb_path() { boost::filesystem::path dir = tools::get_default_data_dir(); - // remove .bitmonero, replace with .shared-ringdb + // remove .loki, replace with .shared-ringdb dir = dir.remove_filename(); dir /= ".shared-ringdb"; return dir.string(); @@ -1337,7 +1338,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote } uint64_t tx_money_spent_in_ins = 0; - // The line below is equivalent to "boost::optional subaddr_account;", but avoids the GCC warning: ‘*((void*)& subaddr_account +4)’ may be used uninitialized in this function + // The line below is equivalent to "boost::optional subaddr_account;", but avoids the GCC warning: '*((void*)& subaddr_account +4)' may be used uninitialized in this function // It's a GCC bug with boost::optional, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679 auto subaddr_account ([]()->boost::optional {return boost::none;}()); std::set subaddr_indices; @@ -10037,7 +10038,7 @@ std::string wallet2::make_uri(const std::string &address, const std::string &pay } } - std::string uri = "monero:" + address; + std::string uri = "loki:" + address; unsigned int n_fields = 0; if (!payment_id.empty()) @@ -10066,9 +10067,9 @@ std::string wallet2::make_uri(const std::string &address, const std::string &pay //---------------------------------------------------------------------------------------------------- bool wallet2::parse_uri(const std::string &uri, std::string &address, std::string &payment_id, uint64_t &amount, std::string &tx_description, std::string &recipient_name, std::vector &unknown_parameters, std::string &error) { - if (uri.substr(0, 7) != "monero:") + if (uri.substr(0, 7) != "loki:") { - error = std::string("URI has wrong scheme (expected \"monero:\"): ") + uri; + error = std::string("URI has wrong scheme (expected \"loki:\"): ") + uri; return false; } diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index abc7bb538c..4e75db9bb2 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -59,8 +60,8 @@ #include "common/password.h" #include "node_rpc_proxy.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.wallet2" class Serialization_portability_wallet_Test; diff --git a/src/wallet/wallet_args.cpp b/src/wallet/wallet_args.cpp index a6ff63dd35..a88e1864f7 100644 --- a/src/wallet/wallet_args.cpp +++ b/src/wallet/wallet_args.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -40,8 +41,8 @@ #include #endif -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.wallet2" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.wallet2" // workaround for a suspected bug in pthread/kernel on MacOS X #ifdef __APPLE__ @@ -122,7 +123,7 @@ namespace wallet_args command_line::add_arg(desc_params, arg_max_concurrency); command_line::add_arg(desc_params, arg_config_file); - i18n_set_language("translations", "monero", lang); + i18n_set_language("translations", "loki", lang); po::options_description desc_all; desc_all.add(desc_general).add(desc_params); @@ -134,8 +135,8 @@ namespace wallet_args if (command_line::get_arg(vm, command_line::arg_help)) { - Print(print) << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")" << ENDL; - Print(print) << wallet_args::tr("This is the command line monero wallet. It needs to connect to a monero\n" + Print(print) << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << ENDL; + Print(print) << wallet_args::tr("This is the command line loki wallet. It needs to connect to a loki\n" "daemon to work correctly.") << ENDL; Print(print) << wallet_args::tr("Usage:") << ENDL << " " << usage; Print(print) << desc_all; @@ -143,7 +144,7 @@ namespace wallet_args } else if (command_line::get_arg(vm, command_line::arg_version)) { - Print(print) << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")"; + Print(print) << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")"; return false; } @@ -186,12 +187,12 @@ namespace wallet_args if (!command_line::is_arg_defaulted(vm, arg_max_concurrency)) tools::set_max_concurrency(command_line::get_arg(vm, arg_max_concurrency)); - Print(print) << "Monero '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")"; + Print(print) << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")"; if (!command_line::is_arg_defaulted(vm, arg_log_level)) MINFO("Setting log level = " << command_line::get_arg(vm, arg_log_level)); else - MINFO("Setting log levels = " << getenv("MONERO_LOGS")); + MINFO("Setting log levels = " << getenv("LOKI_LOGS")); MINFO(wallet_args::tr("Logging to: ") << log_path); Print(print) << boost::format(wallet_args::tr("Logging to %s")) % log_path; diff --git a/src/wallet/wallet_rpc_server.cpp b/src/wallet/wallet_rpc_server.cpp index a9d211532f..e07a9a72d3 100644 --- a/src/wallet/wallet_rpc_server.cpp +++ b/src/wallet/wallet_rpc_server.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -52,8 +53,8 @@ using namespace epee; #include "rpc/rpc_args.h" #include "rpc/core_rpc_server_commands_defs.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.rpc" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.rpc" namespace { @@ -63,7 +64,7 @@ namespace const command_line::arg_descriptor arg_wallet_dir = {"wallet-dir", "Directory for newly created wallets"}; const command_line::arg_descriptor arg_prompt_for_password = {"prompt-for-password", "Prompts for password when not provided", false}; - constexpr const char default_rpc_username[] = "monero"; + constexpr const char default_rpc_username[] = "loki"; boost::optional password_prompter(const char *prompt, bool verify) { @@ -201,7 +202,7 @@ namespace tools string_encoding::base64_encode(rand_128bit.data(), rand_128bit.size()) ); - std::string temp = "monero-wallet-rpc." + bind_port + ".login"; + std::string temp = "loki-wallet-rpc." + bind_port + ".login"; rpc_login_file = tools::private_file::create(temp); if (!rpc_login_file.handle()) { @@ -591,7 +592,7 @@ namespace tools } if (addresses.empty()) { - er.message = std::string("No Monero address found at ") + url; + er.message = std::string("No Loki address found at ") + url; return {}; } return addresses[0]; @@ -1424,7 +1425,7 @@ namespace tools } if (addresses.empty()) { - er.message = std::string("No Monero address found at ") + url; + er.message = std::string("No Loki address found at ") + url; return {}; } return addresses[0]; @@ -2129,7 +2130,7 @@ namespace tools } if (addresses.empty()) { - er.message = std::string("No Monero address found at ") + url; + er.message = std::string("No Loki address found at ") + url; return {}; } return addresses[0]; @@ -2897,12 +2898,12 @@ int main(int argc, char** argv) { const auto vm = wallet_args::main( argc, argv, - "monero-wallet-rpc [--wallet-file=|--generate-from-json=|--wallet-dir=] [--rpc-bind-port=]", - tools::wallet_rpc_server::tr("This is the RPC monero wallet. It needs to connect to a monero\ndaemon to work correctly."), + "loki-wallet-rpc [--wallet-file=|--generate-from-json=|--wallet-dir=] [--rpc-bind-port=]", + tools::wallet_rpc_server::tr("This is the RPC loki wallet. It needs to connect to a loki\ndaemon to work correctly."), desc_params, po::positional_options_description(), [](const std::string &s, bool emphasis){ epee::set_console_color(emphasis ? epee::console_color_white : epee::console_color_default, true); std::cout << s << std::endl; if (emphasis) epee::reset_console_color(); }, - "monero-wallet-rpc.log", + "loki-wallet-rpc.log", true ); if (!vm) diff --git a/src/wallet/wallet_rpc_server.h b/src/wallet/wallet_rpc_server.h index 2ec53cc803..5e9ac711cb 100644 --- a/src/wallet/wallet_rpc_server.h +++ b/src/wallet/wallet_rpc_server.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -38,8 +39,8 @@ #include "wallet_rpc_server_commands_defs.h" #include "wallet2.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.rpc" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.rpc" namespace tools { diff --git a/src/wallet/wallet_rpc_server_commands_defs.h b/src/wallet/wallet_rpc_server_commands_defs.h index a0f43c9b9e..ce530966d7 100644 --- a/src/wallet/wallet_rpc_server_commands_defs.h +++ b/src/wallet/wallet_rpc_server_commands_defs.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2018, The Monero Project +// Copyright (c) 2018, The Loki Project // // All rights reserved. // @@ -36,8 +37,8 @@ #include "crypto/hash.h" #include "wallet_rpc_server_error_codes.h" -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "wallet.rpc" +#undef LOKI_DEFAULT_LOG_CATEGORY +#define LOKI_DEFAULT_LOG_CATEGORY "wallet.rpc" namespace tools { diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h deleted file mode 100644 index 6a723d56f9..0000000000 --- a/tests/core_tests/chaingen.h +++ /dev/null @@ -1,714 +0,0 @@ -// Copyright (c) 2014-2018, The Monero Project -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be -// used to endorse or promote products derived from this software without specific -// prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers - -#pragma once - -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "include_base_utils.h" -#include "common/boost_serialization_helper.h" -#include "common/command_line.h" - -#include "cryptonote_basic/account_boost_serialization.h" -#include "cryptonote_basic/cryptonote_basic.h" -#include "cryptonote_basic/cryptonote_basic_impl.h" -#include "cryptonote_basic/cryptonote_format_utils.h" -#include "cryptonote_core/cryptonote_core.h" -#include "cryptonote_basic/cryptonote_boost_serialization.h" -#include "misc_language.h" - -#undef MONERO_DEFAULT_LOG_CATEGORY -#define MONERO_DEFAULT_LOG_CATEGORY "tests.core" - - - -struct callback_entry -{ - std::string callback_name; - BEGIN_SERIALIZE_OBJECT() - FIELD(callback_name) - END_SERIALIZE() - -private: - friend class boost::serialization::access; - - template - void serialize(Archive & ar, const unsigned int /*version*/) - { - ar & callback_name; - } -}; - -template -struct serialized_object -{ - serialized_object() { } - - serialized_object(const cryptonote::blobdata& a_data) - : data(a_data) - { - } - - cryptonote::blobdata data; - BEGIN_SERIALIZE_OBJECT() - FIELD(data) - END_SERIALIZE() - -private: - friend class boost::serialization::access; - - template - void serialize(Archive & ar, const unsigned int /*version*/) - { - ar & data; - } -}; - -typedef serialized_object serialized_block; -typedef serialized_object serialized_transaction; - -struct event_visitor_settings -{ - int valid_mask; - bool txs_keeped_by_block; - - enum settings - { - set_txs_keeped_by_block = 1 << 0 - }; - - event_visitor_settings(int a_valid_mask = 0, bool a_txs_keeped_by_block = false) - : valid_mask(a_valid_mask) - , txs_keeped_by_block(a_txs_keeped_by_block) - { - } - -private: - friend class boost::serialization::access; - - template - void serialize(Archive & ar, const unsigned int /*version*/) - { - ar & valid_mask; - ar & txs_keeped_by_block; - } -}; - -VARIANT_TAG(binary_archive, callback_entry, 0xcb); -VARIANT_TAG(binary_archive, cryptonote::account_base, 0xcc); -VARIANT_TAG(binary_archive, serialized_block, 0xcd); -VARIANT_TAG(binary_archive, serialized_transaction, 0xce); -VARIANT_TAG(binary_archive, event_visitor_settings, 0xcf); - -typedef boost::variant test_event_entry; -typedef std::unordered_map map_hash2tx_t; - -class test_chain_unit_base -{ -public: - typedef boost::function &events)> verify_callback; - typedef std::map callbacks_map; - - void register_callback(const std::string& cb_name, verify_callback cb); - bool verify(const std::string& cb_name, cryptonote::core& c, size_t ev_index, const std::vector &events); -private: - callbacks_map m_callbacks; -}; - - -class test_generator -{ -public: - struct block_info - { - block_info() - : prev_id() - , already_generated_coins(0) - , block_size(0) - { - } - - block_info(crypto::hash a_prev_id, uint64_t an_already_generated_coins, size_t a_block_size) - : prev_id(a_prev_id) - , already_generated_coins(an_already_generated_coins) - , block_size(a_block_size) - { - } - - crypto::hash prev_id; - uint64_t already_generated_coins; - size_t block_size; - }; - - enum block_fields - { - bf_none = 0, - bf_major_ver = 1 << 0, - bf_minor_ver = 1 << 1, - bf_timestamp = 1 << 2, - bf_prev_id = 1 << 3, - bf_miner_tx = 1 << 4, - bf_tx_hashes = 1 << 5, - bf_diffic = 1 << 6, - bf_max_outs = 1 << 7, - bf_hf_version= 1 << 8 - }; - - void get_block_chain(std::vector& blockchain, const crypto::hash& head, size_t n) const; - void get_last_n_block_sizes(std::vector& block_sizes, const crypto::hash& head, size_t n) const; - uint64_t get_already_generated_coins(const crypto::hash& blk_id) const; - uint64_t get_already_generated_coins(const cryptonote::block& blk) const; - - void add_block(const cryptonote::block& blk, size_t tsx_size, std::vector& block_sizes, uint64_t already_generated_coins, - uint8_t hf_version = 1); - bool construct_block(cryptonote::block& blk, uint64_t height, const crypto::hash& prev_id, - const cryptonote::account_base& miner_acc, uint64_t timestamp, uint64_t already_generated_coins, - std::vector& block_sizes, const std::list& tx_list); - bool construct_block(cryptonote::block& blk, const cryptonote::account_base& miner_acc, uint64_t timestamp); - bool construct_block(cryptonote::block& blk, const cryptonote::block& blk_prev, const cryptonote::account_base& miner_acc, - const std::list& tx_list = std::list()); - - bool construct_block_manually(cryptonote::block& blk, const cryptonote::block& prev_block, - const cryptonote::account_base& miner_acc, int actual_params = bf_none, uint8_t major_ver = 0, - uint8_t minor_ver = 0, uint64_t timestamp = 0, const crypto::hash& prev_id = crypto::hash(), - const cryptonote::difficulty_type& diffic = 1, const cryptonote::transaction& miner_tx = cryptonote::transaction(), - const std::vector& tx_hashes = std::vector(), size_t txs_sizes = 0, size_t max_outs = 999, - uint8_t hf_version = 1); - bool construct_block_manually_tx(cryptonote::block& blk, const cryptonote::block& prev_block, - const cryptonote::account_base& miner_acc, const std::vector& tx_hashes, size_t txs_size); - -private: - std::unordered_map m_blocks_info; -}; - -inline cryptonote::difficulty_type get_test_difficulty() {return 1;} -void fill_nonce(cryptonote::block& blk, const cryptonote::difficulty_type& diffic, uint64_t height); - -bool construct_miner_tx_manually(size_t height, uint64_t already_generated_coins, - const cryptonote::account_public_address& miner_address, cryptonote::transaction& tx, - uint64_t fee, cryptonote::keypair* p_txkey = 0); -bool construct_tx_to_key(const std::vector& events, cryptonote::transaction& tx, - const cryptonote::block& blk_head, const cryptonote::account_base& from, const cryptonote::account_base& to, - uint64_t amount, uint64_t fee, size_t nmix); -cryptonote::transaction construct_tx_with_fee(std::vector& events, const cryptonote::block& blk_head, - const cryptonote::account_base& acc_from, const cryptonote::account_base& acc_to, - uint64_t amount, uint64_t fee); - -void get_confirmed_txs(const std::vector& blockchain, const map_hash2tx_t& mtx, map_hash2tx_t& confirmed_txs); -bool find_block_chain(const std::vector& events, std::vector& blockchain, map_hash2tx_t& mtx, const crypto::hash& head); -void fill_tx_sources_and_destinations(const std::vector& events, const cryptonote::block& blk_head, - const cryptonote::account_base& from, const cryptonote::account_base& to, - uint64_t amount, uint64_t fee, size_t nmix, - std::vector& sources, - std::vector& destinations); -uint64_t get_balance(const cryptonote::account_base& addr, const std::vector& blockchain, const map_hash2tx_t& mtx); - -//-------------------------------------------------------------------------- -template -auto do_check_tx_verification_context(const cryptonote::tx_verification_context& tvc, bool tx_added, size_t event_index, const cryptonote::transaction& tx, t_test_class& validator, int) - -> decltype(validator.check_tx_verification_context(tvc, tx_added, event_index, tx)) -{ - return validator.check_tx_verification_context(tvc, tx_added, event_index, tx); -} -//-------------------------------------------------------------------------- -template -bool do_check_tx_verification_context(const cryptonote::tx_verification_context& tvc, bool tx_added, size_t /*event_index*/, const cryptonote::transaction& /*tx*/, t_test_class&, long) -{ - // Default block verification context check - if (tvc.m_verifivation_failed) - throw std::runtime_error("Transaction verification failed"); - return true; -} -//-------------------------------------------------------------------------- -template -bool check_tx_verification_context(const cryptonote::tx_verification_context& tvc, bool tx_added, size_t event_index, const cryptonote::transaction& tx, t_test_class& validator) -{ - // SFINAE in action - return do_check_tx_verification_context(tvc, tx_added, event_index, tx, validator, 0); -} -//-------------------------------------------------------------------------- -template -auto do_check_block_verification_context(const cryptonote::block_verification_context& bvc, size_t event_index, const cryptonote::block& blk, t_test_class& validator, int) - -> decltype(validator.check_block_verification_context(bvc, event_index, blk)) -{ - return validator.check_block_verification_context(bvc, event_index, blk); -} -//-------------------------------------------------------------------------- -template -bool do_check_block_verification_context(const cryptonote::block_verification_context& bvc, size_t /*event_index*/, const cryptonote::block& /*blk*/, t_test_class&, long) -{ - // Default block verification context check - if (bvc.m_verifivation_failed) - throw std::runtime_error("Block verification failed"); - return true; -} -//-------------------------------------------------------------------------- -template -bool check_block_verification_context(const cryptonote::block_verification_context& bvc, size_t event_index, const cryptonote::block& blk, t_test_class& validator) -{ - // SFINAE in action - return do_check_block_verification_context(bvc, event_index, blk, validator, 0); -} - -/************************************************************************/ -/* */ -/************************************************************************/ -template -struct push_core_event_visitor: public boost::static_visitor -{ -private: - cryptonote::core& m_c; - const std::vector& m_events; - t_test_class& m_validator; - size_t m_ev_index; - - bool m_txs_keeped_by_block; - -public: - push_core_event_visitor(cryptonote::core& c, const std::vector& events, t_test_class& validator) - : m_c(c) - , m_events(events) - , m_validator(validator) - , m_ev_index(0) - , m_txs_keeped_by_block(false) - { - } - - void event_index(size_t ev_index) - { - m_ev_index = ev_index; - } - - bool operator()(const event_visitor_settings& settings) - { - log_event("event_visitor_settings"); - - if (settings.valid_mask & event_visitor_settings::set_txs_keeped_by_block) - { - m_txs_keeped_by_block = settings.txs_keeped_by_block; - } - - return true; - } - - bool operator()(const cryptonote::transaction& tx) const - { - log_event("cryptonote::transaction"); - - cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); - size_t pool_size = m_c.get_pool_transactions_count(); - m_c.handle_incoming_tx(t_serializable_object_to_blob(tx), tvc, m_txs_keeped_by_block, false, false); - bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count(); - bool r = check_tx_verification_context(tvc, tx_added, m_ev_index, tx, m_validator); - CHECK_AND_NO_ASSERT_MES(r, false, "tx verification context check failed"); - return true; - } - - bool operator()(const cryptonote::block& b) const - { - log_event("cryptonote::block"); - - cryptonote::block_verification_context bvc = AUTO_VAL_INIT(bvc); - m_c.handle_incoming_block(t_serializable_object_to_blob(b), bvc); - bool r = check_block_verification_context(bvc, m_ev_index, b, m_validator); - CHECK_AND_NO_ASSERT_MES(r, false, "block verification context check failed"); - return r; - } - - bool operator()(const callback_entry& cb) const - { - log_event(std::string("callback_entry ") + cb.callback_name); - return m_validator.verify(cb.callback_name, m_c, m_ev_index, m_events); - } - - bool operator()(const cryptonote::account_base& ab) const - { - log_event("cryptonote::account_base"); - return true; - } - - bool operator()(const serialized_block& sr_block) const - { - log_event("serialized_block"); - - cryptonote::block_verification_context bvc = AUTO_VAL_INIT(bvc); - m_c.handle_incoming_block(sr_block.data, bvc); - - cryptonote::block blk; - std::stringstream ss; - ss << sr_block.data; - binary_archive ba(ss); - ::serialization::serialize(ba, blk); - if (!ss.good()) - { - blk = cryptonote::block(); - } - bool r = check_block_verification_context(bvc, m_ev_index, blk, m_validator); - CHECK_AND_NO_ASSERT_MES(r, false, "block verification context check failed"); - return true; - } - - bool operator()(const serialized_transaction& sr_tx) const - { - log_event("serialized_transaction"); - - cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); - size_t pool_size = m_c.get_pool_transactions_count(); - m_c.handle_incoming_tx(sr_tx.data, tvc, m_txs_keeped_by_block, false, false); - bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count(); - - cryptonote::transaction tx; - std::stringstream ss; - ss << sr_tx.data; - binary_archive ba(ss); - ::serialization::serialize(ba, tx); - if (!ss.good()) - { - tx = cryptonote::transaction(); - } - - bool r = check_tx_verification_context(tvc, tx_added, m_ev_index, tx, m_validator); - CHECK_AND_NO_ASSERT_MES(r, false, "transaction verification context check failed"); - return true; - } - -private: - void log_event(const std::string& event_type) const - { - MGINFO_YELLOW("=== EVENT # " << m_ev_index << ": " << event_type); - } -}; -//-------------------------------------------------------------------------- -template -inline bool replay_events_through_core(cryptonote::core& cr, const std::vector& events, t_test_class& validator) -{ - TRY_ENTRY(); - - //init core here - - CHECK_AND_ASSERT_MES(typeid(cryptonote::block) == events[0].type(), false, "First event must be genesis block creation"); - cr.set_genesis_block(boost::get(events[0])); - - bool r = true; - push_core_event_visitor visitor(cr, events, validator); - for(size_t i = 1; i < events.size() && r; ++i) - { - visitor.event_index(i); - r = boost::apply_visitor(visitor, events[i]); - } - - return r; - - CATCH_ENTRY_L0("replay_events_through_core", false); -} -//-------------------------------------------------------------------------- -template -struct get_test_options { - const std::pair hard_forks[2]; - const cryptonote::test_options test_options = { - hard_forks - }; - get_test_options():hard_forks{std::make_pair((uint8_t)1, (uint64_t)0), std::make_pair((uint8_t)0, (uint64_t)0)}{} -}; - -//-------------------------------------------------------------------------- -template -inline bool do_replay_events(std::vector& events) -{ - boost::program_options::options_description desc("Allowed options"); - cryptonote::core::init_options(desc); - boost::program_options::variables_map vm; - bool r = command_line::handle_error_helper(desc, [&]() - { - boost::program_options::store(boost::program_options::basic_parsed_options(&desc), vm); - boost::program_options::notify(vm); - return true; - }); - if (!r) - return false; - - cryptonote::cryptonote_protocol_stub pr; //TODO: stub only for this kind of test, make real validation of relayed objects - cryptonote::core c(&pr); - // FIXME: make sure that vm has arg_testnet_on set to true or false if - // this test needs for it to be so. - get_test_options gto; - if (!c.init(vm, NULL, >o.test_options)) - { - MERROR("Failed to init core"); - return false; - } - c.get_blockchain_storage().get_db().set_batch_transactions(true); - - // start with a clean pool - std::vector pool_txs; - if (!c.get_pool_transaction_hashes(pool_txs)) - { - MERROR("Failed to flush txpool"); - return false; - } - c.get_blockchain_storage().flush_txes_from_pool(std::list(pool_txs.begin(), pool_txs.end())); - - t_test_class validator; - bool ret = replay_events_through_core(c, events, validator); - c.deinit(); - return ret; -} -//-------------------------------------------------------------------------- -template -inline bool do_replay_file(const std::string& filename) -{ - std::vector events; - if (!tools::unserialize_obj_from_file(events, filename)) - { - MERROR("Failed to deserialize data from file: "); - return false; - } - return do_replay_events(events); -} -//-------------------------------------------------------------------------- -#define GENERATE_ACCOUNT(account) \ - cryptonote::account_base account; \ - account.generate(); - -#define GENERATE_MULTISIG_ACCOUNT(account, threshold, total) \ - CHECK_AND_ASSERT_MES(threshold >= 2 && threshold <= total, false, "Invalid multisig scheme"); \ - std::vector account(total); \ - do \ - { \ - for (size_t msidx = 0; msidx < total; ++msidx) \ - account[msidx].generate(); \ - std::unordered_set all_multisig_keys; \ - std::vector> view_keys(total); \ - std::vector> spend_keys(total); \ - for (size_t msidx = 0; msidx < total; ++msidx) \ - { \ - for (size_t msidx_inner = 0; msidx_inner < total; ++msidx_inner) \ - { \ - if (msidx_inner != msidx) \ - { \ - crypto::secret_key vkh = cryptonote::get_multisig_blinded_secret_key(account[msidx_inner].get_keys().m_view_secret_key); \ - view_keys[msidx].push_back(vkh); \ - crypto::secret_key skh = cryptonote::get_multisig_blinded_secret_key(account[msidx_inner].get_keys().m_spend_secret_key); \ - crypto::public_key pskh; \ - crypto::secret_key_to_public_key(skh, pskh); \ - spend_keys[msidx].push_back(pskh); \ - } \ - } \ - } \ - for (size_t msidx = 0; msidx < total; ++msidx) \ - { \ - std::vector multisig_keys; \ - crypto::secret_key spend_skey; \ - crypto::public_key spend_pkey; \ - if (threshold == total) \ - cryptonote::generate_multisig_N_N(account[msidx].get_keys(), spend_keys[msidx], multisig_keys, (rct::key&)spend_skey, (rct::key&)spend_pkey); \ - else \ - cryptonote::generate_multisig_N1_N(account[msidx].get_keys(), spend_keys[msidx], multisig_keys, (rct::key&)spend_skey, (rct::key&)spend_pkey); \ - crypto::secret_key view_skey = cryptonote::generate_multisig_view_secret_key(account[msidx].get_keys().m_view_secret_key, view_keys[msidx]); \ - account[msidx].make_multisig(view_skey, spend_skey, spend_pkey, multisig_keys); \ - for (const auto &k: multisig_keys) \ - all_multisig_keys.insert(rct::rct2pk(rct::scalarmultBase(rct::sk2rct(k)))); \ - } \ - if (threshold < total) \ - { \ - std::vector spend_public_keys; \ - for (const auto &k: all_multisig_keys) \ - spend_public_keys.push_back(k); \ - crypto::public_key spend_pkey = cryptonote::generate_multisig_N1_N_spend_public_key(spend_public_keys); \ - for (size_t msidx = 0; msidx < total; ++msidx) \ - account[msidx].finalize_multisig(spend_pkey); \ - } \ - } while(0) - -#define MAKE_ACCOUNT(VEC_EVENTS, account) \ - cryptonote::account_base account; \ - account.generate(); \ - VEC_EVENTS.push_back(account); - -#define DO_CALLBACK(VEC_EVENTS, CB_NAME) \ -{ \ - callback_entry CALLBACK_ENTRY; \ - CALLBACK_ENTRY.callback_name = CB_NAME; \ - VEC_EVENTS.push_back(CALLBACK_ENTRY); \ -} - -#define REGISTER_CALLBACK(CB_NAME, CLBACK) \ - register_callback(CB_NAME, boost::bind(&CLBACK, this, _1, _2, _3)); - -#define REGISTER_CALLBACK_METHOD(CLASS, METHOD) \ - register_callback(#METHOD, boost::bind(&CLASS::METHOD, this, _1, _2, _3)); - -#define MAKE_GENESIS_BLOCK(VEC_EVENTS, BLK_NAME, MINER_ACC, TS) \ - test_generator generator; \ - cryptonote::block BLK_NAME; \ - generator.construct_block(BLK_NAME, MINER_ACC, TS); \ - VEC_EVENTS.push_back(BLK_NAME); - -#define MAKE_NEXT_BLOCK(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC) \ - cryptonote::block BLK_NAME; \ - generator.construct_block(BLK_NAME, PREV_BLOCK, MINER_ACC); \ - VEC_EVENTS.push_back(BLK_NAME); - -#define MAKE_NEXT_BLOCK_TX1(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, TX1) \ - cryptonote::block BLK_NAME; \ - { \ - std::list tx_list; \ - tx_list.push_back(TX1); \ - generator.construct_block(BLK_NAME, PREV_BLOCK, MINER_ACC, tx_list); \ - } \ - VEC_EVENTS.push_back(BLK_NAME); - -#define MAKE_NEXT_BLOCK_TX_LIST(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, TXLIST) \ - cryptonote::block BLK_NAME; \ - generator.construct_block(BLK_NAME, PREV_BLOCK, MINER_ACC, TXLIST); \ - VEC_EVENTS.push_back(BLK_NAME); - -#define REWIND_BLOCKS_N(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, COUNT) \ - cryptonote::block BLK_NAME; \ - { \ - cryptonote::block blk_last = PREV_BLOCK; \ - for (size_t i = 0; i < COUNT; ++i) \ - { \ - MAKE_NEXT_BLOCK(VEC_EVENTS, blk, blk_last, MINER_ACC); \ - blk_last = blk; \ - } \ - BLK_NAME = blk_last; \ - } - -#define REWIND_BLOCKS(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC) REWIND_BLOCKS_N(VEC_EVENTS, BLK_NAME, PREV_BLOCK, MINER_ACC, CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW) - -#define MAKE_TX_MIX(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, NMIX, HEAD) \ - cryptonote::transaction TX_NAME; \ - construct_tx_to_key(VEC_EVENTS, TX_NAME, HEAD, FROM, TO, AMOUNT, TESTS_DEFAULT_FEE, NMIX); \ - VEC_EVENTS.push_back(TX_NAME); - -#define MAKE_TX(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, HEAD) MAKE_TX_MIX(VEC_EVENTS, TX_NAME, FROM, TO, AMOUNT, 0, HEAD) - -#define MAKE_TX_MIX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, NMIX, HEAD) \ - { \ - cryptonote::transaction t; \ - construct_tx_to_key(VEC_EVENTS, t, HEAD, FROM, TO, AMOUNT, TESTS_DEFAULT_FEE, NMIX); \ - SET_NAME.push_back(t); \ - VEC_EVENTS.push_back(t); \ - } - -#define MAKE_TX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, HEAD) MAKE_TX_MIX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, 0, HEAD) - -#define MAKE_TX_LIST_START(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, HEAD) \ - std::list SET_NAME; \ - MAKE_TX_LIST(VEC_EVENTS, SET_NAME, FROM, TO, AMOUNT, HEAD); - -#define MAKE_MINER_TX_AND_KEY_MANUALLY(TX, BLK, KEY) \ - transaction TX; \ - if (!construct_miner_tx_manually(get_block_height(BLK) + 1, generator.get_already_generated_coins(BLK), \ - miner_account.get_keys().m_account_address, TX, 0, KEY)) \ - return false; - -#define MAKE_MINER_TX_MANUALLY(TX, BLK) MAKE_MINER_TX_AND_KEY_MANUALLY(TX, BLK, 0) - -#define SET_EVENT_VISITOR_SETT(VEC_EVENTS, SETT, VAL) VEC_EVENTS.push_back(event_visitor_settings(SETT, VAL)); - -#define GENERATE(filename, genclass) \ - { \ - std::vector events; \ - genclass g; \ - g.generate(events); \ - if (!tools::serialize_obj_to_file(events, filename)) \ - { \ - MERROR("Failed to serialize data to file: " << filename); \ - throw std::runtime_error("Failed to serialize data to file"); \ - } \ - } - - -#define PLAY(filename, genclass) \ - if(!do_replay_file(filename)) \ - { \ - MERROR("Failed to pass test : " << #genclass); \ - return 1; \ - } - -#define GENERATE_AND_PLAY(genclass) \ - { \ - std::vector events; \ - ++tests_count; \ - bool generated = false; \ - try \ - { \ - genclass g; \ - generated = g.generate(events);; \ - } \ - catch (const std::exception& ex) \ - { \ - MERROR(#genclass << " generation failed: what=" << ex.what()); \ - } \ - catch (...) \ - { \ - MERROR(#genclass << " generation failed: generic exception"); \ - } \ - if (generated && do_replay_events< genclass >(events)) \ - { \ - MGINFO_GREEN("#TEST# Succeeded " << #genclass); \ - } \ - else \ - { \ - MERROR("#TEST# Failed " << #genclass); \ - failed_tests.push_back(#genclass); \ - } \ - } - -#define CALL_TEST(test_name, function) \ - { \ - if(!function()) \ - { \ - MERROR("#TEST# Failed " << test_name); \ - return 1; \ - } \ - else \ - { \ - MGINFO_GREEN("#TEST# Succeeded " << test_name); \ - } \ - } - -#define QUOTEME(x) #x -#define DEFINE_TESTS_ERROR_CONTEXT(text) const char* perr_context = text; -#define CHECK_TEST_CONDITION(cond) CHECK_AND_ASSERT_MES(cond, false, "[" << perr_context << "] failed: \"" << QUOTEME(cond) << "\"") -#define CHECK_EQ(v1, v2) CHECK_AND_ASSERT_MES(v1 == v2, false, "[" << perr_context << "] failed: \"" << QUOTEME(v1) << " == " << QUOTEME(v2) << "\", " << v1 << " != " << v2) -#define CHECK_NOT_EQ(v1, v2) CHECK_AND_ASSERT_MES(!(v1 == v2), false, "[" << perr_context << "] failed: \"" << QUOTEME(v1) << " != " << QUOTEME(v2) << "\", " << v1 << " == " << v2) -#define MK_COINS(amount) (UINT64_C(amount) * COIN) -#define TESTS_DEFAULT_FEE ((uint64_t)20000000000) // 2 * pow(10, 10) diff --git a/translations/monero.ts b/translations/loki.ts similarity index 100% rename from translations/monero.ts rename to translations/loki.ts diff --git a/translations/monero_fr.ts b/translations/loki_fr.ts similarity index 100% rename from translations/monero_fr.ts rename to translations/loki_fr.ts diff --git a/translations/monero_it.ts b/translations/loki_it.ts similarity index 100% rename from translations/monero_it.ts rename to translations/loki_it.ts diff --git a/translations/monero_sv.ts b/translations/loki_sv.ts similarity index 100% rename from translations/monero_sv.ts rename to translations/loki_sv.ts From 21277f807b67d0aff39db3e2b434534bc6a026b6 Mon Sep 17 00:00:00 2001 From: Doyle T Date: Tue, 10 Apr 2018 14:49:48 +1000 Subject: [PATCH 2/5] Disable monero pulse urls --- src/common/updates.cpp | 7 +------ src/wallet/wallet2.cpp | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/common/updates.cpp b/src/common/updates.cpp index 134eeea8e3..967d137154 100644 --- a/src/common/updates.cpp +++ b/src/common/updates.cpp @@ -46,12 +46,7 @@ namespace tools MDEBUG("Checking updates for " << buildtag << " " << software); // All four MoneroPulse domains have DNSSEC on and valid - static const std::vector dns_urls = { - "updates.moneropulse.org", - "updates.moneropulse.net", - "updates.moneropulse.co", - "updates.moneropulse.se" - }; + static const std::vector dns_urls = {}; if (!tools::dns_utils::load_txt_records_from_dns(records, dns_urls)) return false; diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 565b861da2..d9d2fec2c6 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -10335,12 +10335,7 @@ uint64_t wallet2::get_segregation_fork_height() const if (use_dns) { // All four MoneroPulse domains have DNSSEC on and valid - static const std::vector dns_urls = { - "segheights.moneropulse.org", - "segheights.moneropulse.net", - "segheights.moneropulse.co", - "segheights.moneropulse.se" - }; + static const std::vector dns_urls = {}; const uint64_t current_height = get_blockchain_current_height(); uint64_t best_diff = std::numeric_limits::max(), best_height = 0; From 9b1d3a9b5dfc0adaf769691b32a797124445639c Mon Sep 17 00:00:00 2001 From: Doyle T Date: Tue, 10 Apr 2018 14:50:13 +1000 Subject: [PATCH 3/5] Disable donation printing prompts --- src/simplewallet/simplewallet.cpp | 55 ++++++++++++++++++------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 3323b40e77..3158a707b1 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -5207,34 +5207,43 @@ bool simple_wallet::donate(const std::vector &args_) return true; } - std::vector local_args = args_; - if(local_args.empty() || local_args.size() > 5) + if (0) { - fail_msg_writer() << tr("usage: donate [index=[,,...]] [] [] []"); - return true; + std::vector local_args = args_; + if(local_args.empty() || local_args.size() > 5) + { + fail_msg_writer() << tr("usage: donate [index=[,,...]] [] [] []"); + return true; + } + std::string amount_str; + std::string payment_id_str; + // get payment id and pop + crypto::hash payment_id; + crypto::hash8 payment_id8; + if (tools::wallet2::parse_long_payment_id (local_args.back(), payment_id ) || + tools::wallet2::parse_short_payment_id(local_args.back(), payment_id8)) + { + payment_id_str = local_args.back(); + local_args.pop_back(); + } + // get amount and pop + amount_str = local_args.back(); + local_args.pop_back(); + // push back address, amount, payment id + local_args.push_back(MONERO_DONATION_ADDR); + local_args.push_back(amount_str); + if (!payment_id_str.empty()) + local_args.push_back(payment_id_str); + message_writer() << tr("Donating ") << amount_str << " to The Monero Project (donate.getmonero.org or "<< MONERO_DONATION_ADDR <<")."; + transfer_new(local_args); } - std::string amount_str; - std::string payment_id_str; - // get payment id and pop - crypto::hash payment_id; - crypto::hash8 payment_id8; - if (tools::wallet2::parse_long_payment_id (local_args.back(), payment_id ) || - tools::wallet2::parse_short_payment_id(local_args.back(), payment_id8)) + else { - payment_id_str = local_args.back(); - local_args.pop_back(); + fail_msg_writer() << tr("Donations are not supported in Loki right now"); } - // get amount and pop - amount_str = local_args.back(); - local_args.pop_back(); - // push back address, amount, payment id - local_args.push_back(MONERO_DONATION_ADDR); - local_args.push_back(amount_str); - if (!payment_id_str.empty()) - local_args.push_back(payment_id_str); - message_writer() << tr("Donating ") << amount_str << " to The Monero Project (donate.getmonero.org or "<< MONERO_DONATION_ADDR <<")."; - transfer_new(local_args); + return true; + } //---------------------------------------------------------------------------------------------------- bool simple_wallet::accept_loaded_tx(const std::function get_num_txes, const std::function &get_tx, const std::string &extra_message) From e9cf61bb3fcdb03284dd32e1fb74c5a043df9f37 Mon Sep 17 00:00:00 2001 From: Doyle T Date: Tue, 10 Apr 2018 14:51:12 +1000 Subject: [PATCH 4/5] Update output binaries to loki --- src/blockchain_utilities/CMakeLists.txt | 4 ++-- src/blockchain_utilities/README.md | 25 +++++++++++++------------ src/cryptonote_core/cryptonote_core.cpp | 2 +- src/ringct/rctSigs.cpp | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt index 19b4ff1c30..540356d173 100644 --- a/src/blockchain_utilities/CMakeLists.txt +++ b/src/blockchain_utilities/CMakeLists.txt @@ -161,7 +161,7 @@ target_link_libraries(blockchain_blackball set_property(TARGET blockchain_blackball PROPERTY - OUTPUT_NAME "monero-blockchain-blackball") + OUTPUT_NAME "loki-blockchain-blackball") install(TARGETS blockchain_blackball DESTINATION bin) @@ -184,6 +184,6 @@ target_link_libraries(blockchain_usage set_property(TARGET blockchain_usage PROPERTY - OUTPUT_NAME "monero-blockchain-usage") + OUTPUT_NAME "loki-blockchain-usage") install(TARGETS blockchain_usage DESTINATION bin) diff --git a/src/blockchain_utilities/README.md b/src/blockchain_utilities/README.md index 5d968cd755..d83b640633 100644 --- a/src/blockchain_utilities/README.md +++ b/src/blockchain_utilities/README.md @@ -1,6 +1,7 @@ -# Monero Blockchain Utilities +# Loki Blockchain Utilities Copyright (c) 2014-2018, The Monero Project +Copyright (c) 2018, The Loki Project ## Introduction @@ -12,16 +13,16 @@ See also each utility's "--help" option. ### Export an existing blockchain database -`$ monero-blockchain-export` +`$ loki-blockchain-export` -This loads the existing blockchain and exports it to `$MONERO_DATA_DIR/export/blockchain.raw` +This loads the existing blockchain and exports it to `$LOKI_DATA_DIR/export/blockchain.raw` ### Import the exported file -`$ monero-blockchain-import` +`$ loki-blockchain-import` -This imports blocks from `$MONERO_DATA_DIR/export/blockchain.raw` (exported using the -`monero-blockchain-export` tool as described above) into the current database. +This imports blocks from `$LOKI_DATA_DIR/export/blockchain.raw` (exported using the +`loki-blockchain-export` tool as described above) into the current database. Defaults: `--batch on`, `--batch size 20000`, `--verify on` @@ -30,14 +31,14 @@ Batch size refers to number of blocks and can be adjusted for performance based Verification should only be turned off if importing from a trusted blockchain. If you encounter an error like "resizing not supported in batch mode", you can just re-run -the `monero-blockchain-import` command again, and it will restart from where it left off. +the `loki-blockchain-import` command again, and it will restart from where it left off. ```bash ## use default settings to import blockchain.raw into database -$ monero-blockchain-import +$ loki-blockchain-import ## fast import with large batch size, database mode "fastest", verification off -$ monero-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off +$ loki-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off ``` @@ -80,9 +81,9 @@ LMDB flags (more than one may be specified): ## Examples: ``` -$ monero-blockchain-import --database lmdb#fastest +$ loki-blockchain-import --database lmdb#fastest -$ monero-blockchain-import --database lmdb#nosync +$ loki-blockchain-import --database lmdb#nosync -$ monero-blockchain-import --database lmdb#nosync,nometasync +$ loki-blockchain-import --database lmdb#nosync,nometasync ``` diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 6e98b3a69d..4a44b51c9b 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -409,7 +409,7 @@ namespace cryptonote { MWARNING("Found old-style blockchain.bin in " << old_files.string()); MWARNING("Monero now uses a new format. You can either remove blockchain.bin to start syncing"); - MWARNING("the blockchain anew, or use monero-blockchain-export and monero-blockchain-import to"); + MWARNING("the blockchain anew, or use loki-blockchain-export and loki-blockchain-import to"); MWARNING("convert your existing blockchain.bin to the new format. See README.md for instructions."); return false; } diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index f41741af9f..64b468ad9c 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2018, The Loki Project +// Copyright (c) 2016, Monero Research Labs // // Author: Shen Noether // From 0a87d931fbc6a94151277680f3c78fec1b2c042f Mon Sep 17 00:00:00 2001 From: Doyle T Date: Tue, 10 Apr 2018 14:51:30 +1000 Subject: [PATCH 5/5] Update loki sub-currency units --- .../cryptonote_format_utils.cpp | 8 ++++---- src/simplewallet/simplewallet.cpp | 18 ++++++++---------- src/wallet/wallet2.cpp | 2 +- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index 822ef6b10c..858a9791d3 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -53,7 +53,7 @@ using namespace epee; using namespace crypto; static const uint64_t valid_decomposed_outputs[] = { - (uint64_t)1, (uint64_t)2, (uint64_t)3, (uint64_t)4, (uint64_t)5, (uint64_t)6, (uint64_t)7, (uint64_t)8, (uint64_t)9, // 1 piconero + (uint64_t)1, (uint64_t)2, (uint64_t)3, (uint64_t)4, (uint64_t)5, (uint64_t)6, (uint64_t)7, (uint64_t)8, (uint64_t)9, // 1 rok (uint64_t)10, (uint64_t)20, (uint64_t)30, (uint64_t)40, (uint64_t)50, (uint64_t)60, (uint64_t)70, (uint64_t)80, (uint64_t)90, (uint64_t)100, (uint64_t)200, (uint64_t)300, (uint64_t)400, (uint64_t)500, (uint64_t)600, (uint64_t)700, (uint64_t)800, (uint64_t)900, (uint64_t)1000, (uint64_t)2000, (uint64_t)3000, (uint64_t)4000, (uint64_t)5000, (uint64_t)6000, (uint64_t)7000, (uint64_t)8000, (uint64_t)9000, @@ -672,7 +672,6 @@ namespace cryptonote { switch (decimal_point) { - case 12: case 9: case 6: case 3: @@ -693,7 +692,8 @@ namespace cryptonote { if (decimal_point == (unsigned int)-1) decimal_point = default_decimal_point; - switch (std::atomic_load(&default_decimal_point)) + + switch (decimal_point) { case 9: return "loki"; @@ -704,7 +704,7 @@ namespace cryptonote case 0: return "rok"; default: - ASSERT_MES_AND_THROW("Invalid decimal point specification: " << default_decimal_point); + ASSERT_MES_AND_THROW("Invalid decimal point specification: " << decimal_point); } } //--------------------------------------------------------------- diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 3158a707b1..37344db5aa 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1781,15 +1781,13 @@ bool simple_wallet::set_unit(const std::vector &args/* = std::vecto const std::string &unit = args[1]; unsigned int decimal_point = CRYPTONOTE_DISPLAY_DECIMAL_POINT; - if (unit == "monero") + if (unit == "loki") decimal_point = CRYPTONOTE_DISPLAY_DECIMAL_POINT; - else if (unit == "millinero") + else if (unit == "megarok") decimal_point = CRYPTONOTE_DISPLAY_DECIMAL_POINT - 3; - else if (unit == "micronero") + else if (unit == "kilorok") decimal_point = CRYPTONOTE_DISPLAY_DECIMAL_POINT - 6; - else if (unit == "nanonero") - decimal_point = CRYPTONOTE_DISPLAY_DECIMAL_POINT - 9; - else if (unit == "piconero") + else if (unit == "rok") decimal_point = 0; else { @@ -2069,7 +2067,7 @@ simple_wallet::simple_wallet() m_cmd_binder.set_handler("donate", boost::bind(&simple_wallet::donate, this, _1), tr("donate [index=[,,...]] [] [] []"), - tr("Donate to the development team (donate.getmonero.org).")); + tr("Donation is not supported at the moment and does nothing.")); m_cmd_binder.set_handler("sign_transfer", boost::bind(&simple_wallet::sign_transfer, this, _1), tr("sign_transfer "), @@ -2146,8 +2144,8 @@ simple_wallet::simple_wallet() " Set the fee too default/unimportant/normal/elevated/priority.\n " "confirm-missing-payment-id <1|0>\n " "ask-password <1|0>\n " - "unit \n " - " Set the default monero (sub-)unit.\n " + "unit \n " + " Set the default loki (sub-)unit.\n " "min-outputs-count [n]\n " " Try to keep at least that many outputs of value at least min-outputs-value.\n " "min-outputs-value [n]\n " @@ -2411,7 +2409,7 @@ bool simple_wallet::set_variable(const std::vector &args) CHECK_SIMPLE_VARIABLE("priority", set_default_priority, tr("0, 1, 2, 3, or 4")); CHECK_SIMPLE_VARIABLE("confirm-missing-payment-id", set_confirm_missing_payment_id, tr("0 or 1")); CHECK_SIMPLE_VARIABLE("ask-password", set_ask_password, tr("0 or 1")); - CHECK_SIMPLE_VARIABLE("unit", set_unit, tr("monero, millinero, micronero, nanonero, piconero")); + CHECK_SIMPLE_VARIABLE("unit", set_unit, tr("loki, megarok, kilorok, rok")); CHECK_SIMPLE_VARIABLE("min-outputs-count", set_min_output_count, tr("unsigned integer")); CHECK_SIMPLE_VARIABLE("min-outputs-value", set_min_output_value, tr("amount")); CHECK_SIMPLE_VARIABLE("merge-destinations", set_merge_destinations, tr("0 or 1")); diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index d9d2fec2c6..36483188dd 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -10296,7 +10296,7 @@ std::vector> wallet2::estimate_backlog(const std:: uint64_t nblocks_min = priority_size_min / full_reward_zone; uint64_t nblocks_max = priority_size_max / full_reward_zone; MDEBUG("estimate_backlog: priority_size " << priority_size_min << " - " << priority_size_max << " for " - << our_fee_byte_min << " - " << our_fee_byte_max << " piconero byte fee, " + << our_fee_byte_min << " - " << our_fee_byte_max << " rok byte fee, " << nblocks_min << " - " << nblocks_max << " blocks at block size " << full_reward_zone); blocks.push_back(std::make_pair(nblocks_min, nblocks_max)); }