forked from lthn/blockchain
fixed #71
This commit is contained in:
parent
431b5e539e
commit
2b1c3c77bb
2 changed files with 9 additions and 3 deletions
|
|
@ -70,8 +70,7 @@ namespace currency
|
|||
iv = *((crypto::chacha8_iv*)&pass_hash);
|
||||
crypto::chacha8(scr_data, src_length, key, iv, (char*)dst_data);
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
std::string account_base::get_seed_phrase(const std::string& password) const
|
||||
{
|
||||
if (m_keys_seed_binary.empty())
|
||||
|
|
|
|||
|
|
@ -65,7 +65,14 @@ namespace nodetool
|
|||
CHECK_AND_ASSERT_MES(r, false, "Failed to parse P2P_MAINTAINERS_PUB_KEY = " << P2P_MAINTAINERS_PUB_KEY);
|
||||
|
||||
std::string state_file_path = m_config_folder + "/" + P2P_NET_DATA_FILENAME;
|
||||
tools::unserialize_obj_from_file(*this, state_file_path);
|
||||
boost::system::error_code ec = AUTO_VAL_INIT(ec);
|
||||
std::time_t last_update_time = boost::filesystem::last_write_time(state_file_path, ec);
|
||||
//let's assume that if p2p peer list file stored more then 2 weeks ago,
|
||||
//then it outdated and we need to fetch peerlist from seed nodes
|
||||
if (!ec && time(nullptr) - last_update_time < 86400 * 14)
|
||||
{
|
||||
tools::unserialize_obj_from_file(*this, state_file_path);
|
||||
}
|
||||
|
||||
//always use new id, to be able differ cloned computers
|
||||
m_config.m_peer_id = crypto::rand<uint64_t>();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue