mirror of
https://github.com/wownero/wownero.git
synced 2026-11-18 14:24:42 +01:00
Merge pull request #10599
f4795a0 Remove obsolete test-drop-download debug options (selsta)
This commit is contained in:
@@ -135,16 +135,6 @@ namespace cryptonote
|
||||
"sync-pruned-blocks"
|
||||
, "Allow syncing from nodes with only pruned blocks"
|
||||
};
|
||||
|
||||
static const command_line::arg_descriptor<bool> arg_test_drop_download = {
|
||||
"test-drop-download"
|
||||
, "For net tests: in download, discard ALL blocks instead checking/saving them (very fast)"
|
||||
};
|
||||
static const command_line::arg_descriptor<uint64_t> arg_test_drop_download_height = {
|
||||
"test-drop-download-height"
|
||||
, "Like test-drop-download but discards only after around certain height"
|
||||
, 0
|
||||
};
|
||||
static const command_line::arg_descriptor<int> arg_test_dbg_lock_sleep = {
|
||||
"test-dbg-lock-sleep"
|
||||
, "Sleep time in ms, defaults to 0 (off), used to debug before/after locking mutex. Values 100 to 1000 are good for tests."
|
||||
@@ -322,9 +312,6 @@ namespace cryptonote
|
||||
{
|
||||
command_line::add_arg(desc, arg_data_dir);
|
||||
|
||||
command_line::add_arg(desc, arg_test_drop_download);
|
||||
command_line::add_arg(desc, arg_test_drop_download_height);
|
||||
|
||||
command_line::add_arg(desc, arg_testnet_on);
|
||||
command_line::add_arg(desc, arg_stagenet_on);
|
||||
command_line::add_arg(desc, arg_regtest_on);
|
||||
@@ -392,13 +379,9 @@ namespace cryptonote
|
||||
|
||||
|
||||
set_enforce_dns_checkpoints(command_line::get_arg(vm, arg_dns_checkpoints));
|
||||
test_drop_download_height(command_line::get_arg(vm, arg_test_drop_download_height));
|
||||
m_offline = get_arg(vm, arg_offline);
|
||||
m_disable_dns_checkpoints = get_arg(vm, arg_disable_dns_checkpoints);
|
||||
|
||||
if (command_line::get_arg(vm, arg_test_drop_download) == true)
|
||||
test_drop_download();
|
||||
|
||||
epee::debug::g_test_dbg_lock_sleep() = command_line::get_arg(vm, arg_test_dbg_lock_sleep);
|
||||
|
||||
return true;
|
||||
@@ -795,32 +778,6 @@ namespace cryptonote
|
||||
return true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
void core::test_drop_download()
|
||||
{
|
||||
m_test_drop_download = false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
void core::test_drop_download_height(uint64_t height)
|
||||
{
|
||||
m_test_drop_download_height = height;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
bool core::get_test_drop_download() const
|
||||
{
|
||||
return m_test_drop_download;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
bool core::get_test_drop_download_height() const
|
||||
{
|
||||
if (m_test_drop_download_height == 0)
|
||||
return true;
|
||||
|
||||
if (get_blockchain_storage().get_current_blockchain_height() <= m_test_drop_download_height)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
bool core::handle_incoming_tx(const blobdata& tx_blob, tx_verification_context& tvc, relay_method tx_relay, bool relayed)
|
||||
{
|
||||
tvc = {};
|
||||
|
||||
@@ -316,35 +316,6 @@ namespace cryptonote
|
||||
*/
|
||||
bool deinit();
|
||||
|
||||
/**
|
||||
* @brief sets to drop blocks downloaded (for testing)
|
||||
*/
|
||||
void test_drop_download();
|
||||
|
||||
/**
|
||||
* @brief sets to drop blocks downloaded below a certain height
|
||||
*
|
||||
* @param height height below which to drop blocks
|
||||
*/
|
||||
void test_drop_download_height(uint64_t height);
|
||||
|
||||
/**
|
||||
* @brief gets whether or not to drop blocks (for testing)
|
||||
*
|
||||
* @return whether or not to drop blocks
|
||||
*/
|
||||
bool get_test_drop_download() const;
|
||||
|
||||
/**
|
||||
* @brief gets whether or not to drop blocks
|
||||
*
|
||||
* If the current blockchain height <= our block drop threshold
|
||||
* and test drop blocks is set, return true
|
||||
*
|
||||
* @return see above
|
||||
*/
|
||||
bool get_test_drop_download_height() const;
|
||||
|
||||
/**
|
||||
* @copydoc Blockchain::get_current_blockchain_height
|
||||
*
|
||||
@@ -1069,10 +1040,6 @@ namespace cryptonote
|
||||
*/
|
||||
bool recalculate_difficulties();
|
||||
|
||||
bool m_test_drop_download = true; //!< whether or not to drop incoming blocks (for testing)
|
||||
|
||||
uint64_t m_test_drop_download_height = 0; //!< height under which to drop incoming blocks, if doing so
|
||||
|
||||
BlockchainAndPool m_bap; //! Contains owned instances of Blockchain and tx_memory_pool
|
||||
tx_memory_pool& m_mempool; //!< ref to transaction pool instance in m_bap
|
||||
Blockchain& m_blockchain_storage; //!< ref to Blockchain instance in m_bap
|
||||
|
||||
@@ -1281,10 +1281,6 @@ namespace cryptonote
|
||||
|
||||
const crypto::hash last_block_hash = cryptonote::get_block_hash(b);
|
||||
context.m_last_known_hash = last_block_hash;
|
||||
|
||||
if (!m_core.get_test_drop_download() || !m_core.get_test_drop_download_height()) { // DISCARD BLOCKS for testing
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
try_add_next_blocks(context);
|
||||
|
||||
Reference in New Issue
Block a user