diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-03-05 10:10:57 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-03-05 10:10:57 +0200 |
commit | 5fb4a9719cb799ae59e04cda0a3d760be969d7e8 (patch) | |
tree | 8a7361e525f9e7e45bb04e4f252fd9a1c430d0a7 /src/cryptonote_basic | |
parent | Merge pull request #5162 (diff) | |
parent | check load_t_from_json return values (diff) | |
download | monero-5fb4a9719cb799ae59e04cda0a3d760be969d7e8.tar.xz |
Merge pull request #5101
23abe607 check load_t_from_json return values (moneromooo-monero)
e396146a default initialize rpc structures (moneromooo-monero)
ef93b099 various: remove unused variables (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r-- | src/cryptonote_basic/cryptonote_stat_info.h | 3 | ||||
-rw-r--r-- | src/cryptonote_basic/miner.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/cryptonote_basic/cryptonote_stat_info.h b/src/cryptonote_basic/cryptonote_stat_info.h index c0be2144e..a09fa850b 100644 --- a/src/cryptonote_basic/cryptonote_stat_info.h +++ b/src/cryptonote_basic/cryptonote_stat_info.h @@ -34,7 +34,7 @@ namespace cryptonote { - struct core_stat_info + struct core_stat_info_t { uint64_t tx_pool_size; uint64_t blockchain_height; @@ -50,4 +50,5 @@ namespace cryptonote KV_SERIALIZE(top_block_id_str) END_KV_SERIALIZE_MAP() }; + typedef epee::misc_utils::struct_init<core_stat_info_t> core_stat_info; } diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index d29a3dcd6..3a51c6ea4 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -305,7 +305,8 @@ namespace cryptonote } m_config_folder_path = boost::filesystem::path(command_line::get_arg(vm, arg_extra_messages)).parent_path().string(); m_config = AUTO_VAL_INIT(m_config); - epee::serialization::load_t_from_json_file(m_config, m_config_folder_path + "/" + MINER_CONFIG_FILE_NAME); + const std::string filename = m_config_folder_path + "/" + MINER_CONFIG_FILE_NAME; + CHECK_AND_ASSERT_MES(epee::serialization::load_t_from_json_file(m_config, filename), false, "Failed to load data from " << filename); MINFO("Loaded " << m_extra_messages.size() << " extra messages, current index " << m_config.current_extra_message_index); } |