remove unused code

This commit is contained in:
moneromooo-monero 2019-04-29 16:53:38 +00:00
parent 25a7cfdb4a
commit 1a66a86f94
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
6 changed files with 2 additions and 13 deletions

View File

@ -897,7 +897,6 @@ void cn_slow_hash(const void *data, size_t length, char *hash, int variant, int
// locals to avoid constant TLS dereferencing // locals to avoid constant TLS dereferencing
uint8_t *local_hp_state = hp_state; uint8_t *local_hp_state = hp_state;
v4_random_math_JIT_func local_hp_jitfunc = hp_jitfunc;
/* CryptoNight Step 1: Use Keccak1600 to initialize the 'state' (and 'text') buffers from the data. */ /* CryptoNight Step 1: Use Keccak1600 to initialize the 'state' (and 'text') buffers from the data. */
if (prehashed) { if (prehashed) {

View File

@ -2032,7 +2032,6 @@ bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height,
if (to_height > 0 && to_height < from_height) if (to_height > 0 && to_height < from_height)
return false; return false;
const uint64_t real_start_height = start_height;
if (from_height > start_height) if (from_height > start_height)
start_height = from_height; start_height = from_height;
@ -2046,7 +2045,7 @@ bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height,
{ {
std::vector<uint64_t> heights; std::vector<uint64_t> heights;
heights.reserve(to_height + 1 - start_height); heights.reserve(to_height + 1 - start_height);
uint64_t real_start_height = start_height > 0 ? start_height-1 : start_height; const uint64_t real_start_height = start_height > 0 ? start_height-1 : start_height;
for (uint64_t h = real_start_height; h <= to_height; ++h) for (uint64_t h = real_start_height; h <= to_height; ++h)
heights.push_back(h); heights.push_back(h);
distribution = m_db->get_block_cumulative_rct_outputs(heights); distribution = m_db->get_block_cumulative_rct_outputs(heights);
@ -3247,7 +3246,6 @@ uint64_t Blockchain::get_dynamic_base_fee(uint64_t block_reward, size_t median_b
bool Blockchain::check_fee(size_t tx_weight, uint64_t fee) const bool Blockchain::check_fee(size_t tx_weight, uint64_t fee) const
{ {
const uint8_t version = get_current_hard_fork_version(); const uint8_t version = get_current_hard_fork_version();
const uint64_t blockchain_height = m_db->height();
uint64_t median = 0; uint64_t median = 0;
uint64_t already_generated_coins = 0; uint64_t already_generated_coins = 0;
@ -3955,14 +3953,12 @@ bool Blockchain::update_next_cumulative_weight_limit(uint64_t *long_term_effecti
const uint64_t db_height = m_db->height(); const uint64_t db_height = m_db->height();
const uint8_t hf_version = get_current_hard_fork_version(); const uint8_t hf_version = get_current_hard_fork_version();
uint64_t full_reward_zone = get_min_block_weight(hf_version); uint64_t full_reward_zone = get_min_block_weight(hf_version);
uint64_t long_term_block_weight;
if (hf_version < HF_VERSION_LONG_TERM_BLOCK_WEIGHT) if (hf_version < HF_VERSION_LONG_TERM_BLOCK_WEIGHT)
{ {
std::vector<uint64_t> weights; std::vector<uint64_t> weights;
get_last_n_blocks_weights(weights, CRYPTONOTE_REWARD_BLOCKS_WINDOW); get_last_n_blocks_weights(weights, CRYPTONOTE_REWARD_BLOCKS_WINDOW);
m_current_block_cumul_weight_median = epee::misc_utils::median(weights); m_current_block_cumul_weight_median = epee::misc_utils::median(weights);
long_term_block_weight = weights.back();
} }
else else
{ {
@ -3987,7 +3983,7 @@ bool Blockchain::update_next_cumulative_weight_limit(uint64_t *long_term_effecti
m_long_term_effective_median_block_weight = std::max<uint64_t>(CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5, long_term_median); m_long_term_effective_median_block_weight = std::max<uint64_t>(CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5, long_term_median);
uint64_t short_term_constraint = m_long_term_effective_median_block_weight + m_long_term_effective_median_block_weight * 2 / 5; uint64_t short_term_constraint = m_long_term_effective_median_block_weight + m_long_term_effective_median_block_weight * 2 / 5;
long_term_block_weight = std::min<uint64_t>(block_weight, short_term_constraint); uint64_t long_term_block_weight = std::min<uint64_t>(block_weight, short_term_constraint);
if (new_weights.empty()) if (new_weights.empty())
new_weights.resize(1); new_weights.resize(1);

View File

@ -447,7 +447,6 @@ rct::key straus(const std::vector<MultiexpData> &data, const std::shared_ptr<str
{ {
CHECK_AND_ASSERT_THROW_MES(cache == NULL || cache->size >= data.size(), "Cache is too small"); CHECK_AND_ASSERT_THROW_MES(cache == NULL || cache->size >= data.size(), "Cache is too small");
MULTIEXP_PERF(PERF_TIMER_UNIT(straus, 1000000)); MULTIEXP_PERF(PERF_TIMER_UNIT(straus, 1000000));
bool HiGi = cache != NULL;
STEP = STEP ? STEP : 192; STEP = STEP ? STEP : 192;
MULTIEXP_PERF(PERF_TIMER_START_UNIT(setup, 1000000)); MULTIEXP_PERF(PERF_TIMER_START_UNIT(setup, 1000000));

View File

@ -190,7 +190,6 @@ namespace rct {
int byte, i, j; int byte, i, j;
for (j = 0; j < 8; j++) { for (j = 0; j < 8; j++) {
byte = 0; byte = 0;
i = 8 * j;
for (i = 7; i > -1; i--) { for (i = 7; i > -1; i--) {
byte = byte * 2 + amountb2[8 * j + i]; byte = byte * 2 + amountb2[8 * j + i];
} }

View File

@ -7714,7 +7714,6 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
uint64_t num_found = 0; uint64_t num_found = 0;
// if we have a known ring, use it // if we have a known ring, use it
bool existing_ring_found = false;
if (td.m_key_image_known && !td.m_key_image_partial) if (td.m_key_image_known && !td.m_key_image_partial)
{ {
std::vector<uint64_t> ring; std::vector<uint64_t> ring;
@ -7726,7 +7725,6 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
std::to_string(ring.size()) + ", it cannot be spent now with ring size " + std::to_string(ring.size()) + ", it cannot be spent now with ring size " +
std::to_string(fake_outputs_count + 1) + " as it is smaller: use a higher ring size"); std::to_string(fake_outputs_count + 1) + " as it is smaller: use a higher ring size");
bool own_found = false; bool own_found = false;
existing_ring_found = true;
for (const auto &out: ring) for (const auto &out: ring)
{ {
MINFO("Ring has output " << out); MINFO("Ring has output " << out);
@ -7969,7 +7967,6 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
outs.back().push_back(std::make_tuple(td.m_global_output_index, boost::get<txout_to_key>(td.m_tx.vout[td.m_internal_output_index].target).key, mask)); outs.back().push_back(std::make_tuple(td.m_global_output_index, boost::get<txout_to_key>(td.m_tx.vout[td.m_internal_output_index].target).key, mask));
// then pick outs from an existing ring, if any // then pick outs from an existing ring, if any
bool existing_ring_found = false;
if (td.m_key_image_known && !td.m_key_image_partial) if (td.m_key_image_known && !td.m_key_image_partial)
{ {
std::vector<uint64_t> ring; std::vector<uint64_t> ring;

View File

@ -56,7 +56,6 @@ TEST(varint, equal)
ASSERT_TRUE (bytes > 0 && bytes <= sizeof(buf)); ASSERT_TRUE (bytes > 0 && bytes <= sizeof(buf));
uint64_t idx2; uint64_t idx2;
bufptr = buf;
std::string s(buf, bytes); std::string s(buf, bytes);
int read = tools::read_varint(s.begin(), s.end(), idx2); int read = tools::read_varint(s.begin(), s.end(), idx2);
ASSERT_EQ (read, bytes); ASSERT_EQ (read, bytes);