mirror of
https://github.com/monero-project/monero.git
synced 2024-12-13 11:56:31 +02:00
Cleanup test impact of adding safesyncmode() method
This commit is contained in:
parent
9a859844f4
commit
c22d22e2db
@ -1037,6 +1037,11 @@ namespace cryptonote
|
||||
m_miner.on_synchronized();
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
void core::safesyncmode(const bool onoff)
|
||||
{
|
||||
m_blockchain_storage.safesyncmode(onoff);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
bool core::add_new_block(const block& b, block_verification_context& bvc)
|
||||
{
|
||||
return m_blockchain_storage.add_new_block(b, bvc);
|
||||
|
@ -613,6 +613,13 @@ namespace cryptonote
|
||||
*/
|
||||
void on_synchronized();
|
||||
|
||||
/**
|
||||
* @copydoc Blockchain::safesyncmode
|
||||
*
|
||||
* 2note see Blockchain::safesyncmode
|
||||
*/
|
||||
void safesyncmode(const bool onoff);
|
||||
|
||||
/**
|
||||
* @brief sets the target blockchain height
|
||||
*
|
||||
|
@ -295,7 +295,7 @@ namespace cryptonote
|
||||
<< " [Your node is " << std::abs(diff) << " blocks (" << ((abs(diff) - diff_v2) / (24 * 60 * 60 / DIFFICULTY_TARGET_V1)) + (diff_v2 / (24 * 60 * 60 / DIFFICULTY_TARGET_V2)) << " days) "
|
||||
<< (0 <= diff ? std::string("behind") : std::string("ahead"))
|
||||
<< "] " << ENDL << "SYNCHRONIZATION started");
|
||||
m_core.get_blockchain_storage().safesyncmode(false);
|
||||
m_core.safesyncmode(false);
|
||||
}
|
||||
LOG_PRINT_L1("Remote blockchain height: " << hshd.current_height << ", id: " << hshd.top_id);
|
||||
context.m_state = cryptonote_connection_context::state_synchronizing;
|
||||
@ -1474,7 +1474,7 @@ skip:
|
||||
<< "**********************************************************************");
|
||||
m_core.on_synchronized();
|
||||
}
|
||||
m_core.get_blockchain_storage().safesyncmode(true);
|
||||
m_core.safesyncmode(true);
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -66,6 +66,7 @@ namespace tests
|
||||
|
||||
public:
|
||||
void on_synchronized(){}
|
||||
void safesyncmode(const bool){}
|
||||
uint64_t get_current_blockchain_height(){return 1;}
|
||||
void set_target_blockchain_height(uint64_t) {}
|
||||
bool init(const boost::program_options::variables_map& vm);
|
||||
|
@ -43,6 +43,7 @@ class test_core
|
||||
{
|
||||
public:
|
||||
void on_synchronized(){}
|
||||
void safesyncmode(const bool){}
|
||||
uint64_t get_current_blockchain_height() const {return 1;}
|
||||
void set_target_blockchain_height(uint64_t) {}
|
||||
bool init(const boost::program_options::variables_map& vm) {return true ;}
|
||||
|
Loading…
Reference in New Issue
Block a user