mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-27 05:13:25 +01:00
cryptonote_core: remove unused functions with off by one bugs
This commit is contained in:
parent
b1634aa3e8
commit
24f584d90d
@ -2053,49 +2053,6 @@ bool Blockchain::get_transactions(const t_ids_container& txs_ids, t_tx_container
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
void Blockchain::print_blockchain(uint64_t start_index, uint64_t end_index) const
|
|
||||||
{
|
|
||||||
LOG_PRINT_L3("Blockchain::" << __func__);
|
|
||||||
std::stringstream ss;
|
|
||||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
|
||||||
auto h = m_db->height();
|
|
||||||
if(start_index > h)
|
|
||||||
{
|
|
||||||
MERROR("Wrong starter index set: " << start_index << ", expected max index " << h);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(size_t i = start_index; i <= h && i != end_index; i++)
|
|
||||||
{
|
|
||||||
ss << "height " << i << ", timestamp " << m_db->get_block_timestamp(i) << ", cumul_dif " << m_db->get_block_cumulative_difficulty(i) << ", size " << m_db->get_block_size(i) << "\nid\t\t" << m_db->get_block_hash_from_height(i) << "\ndifficulty\t\t" << m_db->get_block_difficulty(i) << ", nonce " << m_db->get_block_from_height(i).nonce << ", tx_count " << m_db->get_block_from_height(i).tx_hashes.size() << std::endl;
|
|
||||||
}
|
|
||||||
MCINFO("globlal", "Current blockchain:" << std::endl << ss.str());
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
void Blockchain::print_blockchain_index() const
|
|
||||||
{
|
|
||||||
LOG_PRINT_L3("Blockchain::" << __func__);
|
|
||||||
std::stringstream ss;
|
|
||||||
CRITICAL_REGION_LOCAL(m_blockchain_lock);
|
|
||||||
auto height = m_db->height();
|
|
||||||
if (height != 0)
|
|
||||||
{
|
|
||||||
for(uint64_t i = 0; i <= height; i++)
|
|
||||||
{
|
|
||||||
ss << "height: " << i << ", hash: " << m_db->get_block_hash_from_height(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MINFO("Current blockchain index:" << std::endl << ss.str());
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
//TODO: remove this function and references to it
|
|
||||||
void Blockchain::print_blockchain_outs(const std::string& file) const
|
|
||||||
{
|
|
||||||
LOG_PRINT_L3("Blockchain::" << __func__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//------------------------------------------------------------------
|
|
||||||
// Find the split point between us and foreign blockchain and return
|
// Find the split point between us and foreign blockchain and return
|
||||||
// (by reference) the most recent common block hash along with up to
|
// (by reference) the most recent common block hash along with up to
|
||||||
// BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT additional (more recent) hashes.
|
// BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT additional (more recent) hashes.
|
||||||
|
@ -679,32 +679,6 @@ namespace cryptonote
|
|||||||
|
|
||||||
//debug functions
|
//debug functions
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief prints data about a snippet of the blockchain
|
|
||||||
*
|
|
||||||
* if start_index is greater than the blockchain height, do nothing
|
|
||||||
*
|
|
||||||
* @param start_index height on chain to start at
|
|
||||||
* @param end_index height on chain to end at
|
|
||||||
*/
|
|
||||||
void print_blockchain(uint64_t start_index, uint64_t end_index) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief prints every block's hash
|
|
||||||
*
|
|
||||||
* WARNING: This function will absolutely crush a terminal in prints, so
|
|
||||||
* it is recommended to redirect this output to a log file (or null sink
|
|
||||||
* if a log file is already set up, as should be the default)
|
|
||||||
*/
|
|
||||||
void print_blockchain_index() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief currently does nothing, candidate for removal
|
|
||||||
*
|
|
||||||
* @param file
|
|
||||||
*/
|
|
||||||
void print_blockchain_outs(const std::string& file) const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief check the blockchain against a set of checkpoints
|
* @brief check the blockchain against a set of checkpoints
|
||||||
*
|
*
|
||||||
|
@ -1052,21 +1052,6 @@ namespace cryptonote
|
|||||||
return m_blockchain_storage.find_blockchain_supplement(req_start_block, qblock_ids, blocks, total_height, start_height, max_count);
|
return m_blockchain_storage.find_blockchain_supplement(req_start_block, qblock_ids, blocks, total_height, start_height, max_count);
|
||||||
}
|
}
|
||||||
//-----------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------
|
||||||
void core::print_blockchain(uint64_t start_index, uint64_t end_index) const
|
|
||||||
{
|
|
||||||
m_blockchain_storage.print_blockchain(start_index, end_index);
|
|
||||||
}
|
|
||||||
//-----------------------------------------------------------------------------------------------
|
|
||||||
void core::print_blockchain_index() const
|
|
||||||
{
|
|
||||||
m_blockchain_storage.print_blockchain_index();
|
|
||||||
}
|
|
||||||
//-----------------------------------------------------------------------------------------------
|
|
||||||
void core::print_blockchain_outs(const std::string& file)
|
|
||||||
{
|
|
||||||
m_blockchain_storage.print_blockchain_outs(file);
|
|
||||||
}
|
|
||||||
//-----------------------------------------------------------------------------------------------
|
|
||||||
bool core::get_random_outs_for_amounts(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res) const
|
bool core::get_random_outs_for_amounts(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res) const
|
||||||
{
|
{
|
||||||
return m_blockchain_storage.get_random_outs_for_amounts(req, res);
|
return m_blockchain_storage.get_random_outs_for_amounts(req, res);
|
||||||
|
@ -600,20 +600,6 @@ namespace cryptonote
|
|||||||
*/
|
*/
|
||||||
const Blockchain& get_blockchain_storage()const{return m_blockchain_storage;}
|
const Blockchain& get_blockchain_storage()const{return m_blockchain_storage;}
|
||||||
|
|
||||||
/**
|
|
||||||
* @copydoc Blockchain::print_blockchain
|
|
||||||
*
|
|
||||||
* @note see Blockchain::print_blockchain
|
|
||||||
*/
|
|
||||||
void print_blockchain(uint64_t start_index, uint64_t end_index) const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @copydoc Blockchain::print_blockchain_index
|
|
||||||
*
|
|
||||||
* @note see Blockchain::print_blockchain_index
|
|
||||||
*/
|
|
||||||
void print_blockchain_index() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc tx_memory_pool::print_pool
|
* @copydoc tx_memory_pool::print_pool
|
||||||
*
|
*
|
||||||
@ -621,13 +607,6 @@ namespace cryptonote
|
|||||||
*/
|
*/
|
||||||
std::string print_pool(bool short_format) const;
|
std::string print_pool(bool short_format) const;
|
||||||
|
|
||||||
/**
|
|
||||||
* @copydoc Blockchain::print_blockchain_outs
|
|
||||||
*
|
|
||||||
* @note see Blockchain::print_blockchain_outs
|
|
||||||
*/
|
|
||||||
void print_blockchain_outs(const std::string& file);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @copydoc miner::on_synchronized
|
* @copydoc miner::on_synchronized
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user