Remove unnecessary or defunct code

This commit is contained in:
Thomas Winget
2015-10-07 22:25:06 -04:00
parent 3e3408eb45
commit 94f7615c57
2 changed files with 0 additions and 70 deletions

View File

@@ -100,55 +100,6 @@ m_is_blockchain_storing(false), m_enforce_dns_checkpoints(false), m_max_prepare_
LOG_PRINT_L3("Blockchain::" << __func__); LOG_PRINT_L3("Blockchain::" << __func__);
} }
//------------------------------------------------------------------ //------------------------------------------------------------------
//TODO: is this still needed? I don't think so - tewinget
template<class archive_t>
void Blockchain::serialize(archive_t & ar, const unsigned int version)
{
key_images_container dummy_key_images_container;
LOG_PRINT_L3("Blockchain::" << __func__);
if(version < 11)
return;
CRITICAL_REGION_LOCAL(m_blockchain_lock);
ar & m_blocks;
ar & m_blocks_index;
ar & m_transactions;
ar & dummy_key_images_container;
ar & m_alternative_chains;
ar & m_outputs;
ar & m_invalid_blocks;
ar & m_current_block_cumul_sz_limit;
/*serialization bug workaround*/
if(version > 11)
{
uint64_t total_check_count = m_db->height() + m_blocks_index.size() + m_transactions.size() + dummy_key_images_container.size() + m_alternative_chains.size() + m_outputs.size() + m_invalid_blocks.size() + m_current_block_cumul_sz_limit;
if(archive_t::is_saving::value)
{
ar & total_check_count;
}
else
{
uint64_t total_check_count_loaded = 0;
ar & total_check_count_loaded;
if(total_check_count != total_check_count_loaded)
{
LOG_ERROR("Blockchain storage data corruption detected. total_count loaded from file = " << total_check_count_loaded << ", expected = " << total_check_count);
LOG_PRINT_L0("Blockchain storage:" << std::endl << "m_blocks: " << m_db->height() << std::endl << "m_blocks_index: " << m_blocks_index.size() << std::endl << "m_transactions: " << m_transactions.size() << std::endl << "dummy_key_images_container: " << dummy_key_images_container.size() << std::endl << "m_alternative_chains: " << m_alternative_chains.size() << std::endl << "m_outputs: " << m_outputs.size() << std::endl << "m_invalid_blocks: " << m_invalid_blocks.size() << std::endl << "m_current_block_cumul_sz_limit: " << m_current_block_cumul_sz_limit);
throw std::runtime_error("Blockchain data corruption");
}
}
}
if (version > 12)
{
ar & *m_hardfork;
}
LOG_PRINT_L3("Blockchain storage:" << std::endl << "m_blocks: " << m_db->height() << std::endl << "m_blocks_index: " << m_blocks_index.size() << std::endl << "m_transactions: " << m_transactions.size() << std::endl << "dummy_key_images_container: " << dummy_key_images_container.size() << std::endl << "m_alternative_chains: " << m_alternative_chains.size() << std::endl << "m_outputs: " << m_outputs.size() << std::endl << "m_invalid_blocks: " << m_invalid_blocks.size() << std::endl << "m_current_block_cumul_sz_limit: " << m_current_block_cumul_sz_limit);
}
//------------------------------------------------------------------
bool Blockchain::have_tx(const crypto::hash &id) const bool Blockchain::have_tx(const crypto::hash &id) const
{ {
LOG_PRINT_L3("Blockchain::" << __func__); LOG_PRINT_L3("Blockchain::" << __func__);

View File

@@ -420,9 +420,6 @@ namespace cryptonote
*/ */
bool handle_get_objects(NOTIFY_REQUEST_GET_OBJECTS::request& arg, NOTIFY_RESPONSE_GET_OBJECTS::request& rsp); bool handle_get_objects(NOTIFY_REQUEST_GET_OBJECTS::request& arg, NOTIFY_RESPONSE_GET_OBJECTS::request& rsp);
//FIXME: function declared, but never defined or used. Candidate for removal.
bool handle_get_objects(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res);
/** /**
* @brief gets random outputs to mix with * @brief gets random outputs to mix with
* *
@@ -887,9 +884,6 @@ namespace cryptonote
*/ */
bool validate_miner_transaction(const block& b, size_t cumulative_block_size, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins); bool validate_miner_transaction(const block& b, size_t cumulative_block_size, uint64_t fee, uint64_t& base_reward, uint64_t already_generated_coins);
//FIXME: function declared but neither defined nor used, candidate for removal
bool validate_transaction(const block& b, uint64_t height, const transaction& tx);
/** /**
* @brief reverts the blockchain to its previous state following a failed switch * @brief reverts the blockchain to its previous state following a failed switch
* *
@@ -904,18 +898,6 @@ namespace cryptonote
*/ */
bool rollback_blockchain_switching(std::list<block>& original_chain, uint64_t rollback_height); bool rollback_blockchain_switching(std::list<block>& original_chain, uint64_t rollback_height);
//FIXME: function declared but neither defined nor used, candidate for removal,
// remnant from old blockchain_storage implementation
bool add_transaction_from_block(const transaction& tx, const crypto::hash& tx_id, const crypto::hash& bl_id, uint64_t bl_height);
//FIXME: function declared but neither defined nor used, candidate for removal,
// remnant from old blockchain_storage implementation
bool push_transaction_to_global_outs_index(const transaction& tx, const crypto::hash& tx_id, std::vector<uint64_t>& global_indexes);
//FIXME: function declared but neither defined nor used, candidate for removal,
// remnant from old blockchain_storage implementation
bool pop_transaction_from_global_index(const transaction& tx, const crypto::hash& tx_id);
/** /**
* @brief gets recent block sizes for median calculation * @brief gets recent block sizes for median calculation
* *
@@ -1043,9 +1025,6 @@ namespace cryptonote
*/ */
bool check_for_double_spend(const transaction& tx, key_images_container& keys_this_block) const; bool check_for_double_spend(const transaction& tx, key_images_container& keys_this_block) const;
//FIXME: function declared but neither defined nor used, candidate for removal,
void get_timestamp_and_difficulty(uint64_t &timestamp, difficulty_type &difficulty, const int offset) const;
/** /**
* @brief validates a transaction input's ring signature * @brief validates a transaction input's ring signature
* *