|
|
|
@ -1963,7 +1963,7 @@ void Blockchain::get_output_key_mask_unlocked(const uint64_t& amount, const uint
|
|
|
|
|
unlocked = is_tx_spendtime_unlocked(m_db->get_tx_unlock_time(toi.first));
|
|
|
|
|
}
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height, uint64_t &start_height, std::vector<uint64_t> &distribution, uint64_t &base) const
|
|
|
|
|
bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height, uint64_t to_height, uint64_t &start_height, std::vector<uint64_t> &distribution, uint64_t &base) const
|
|
|
|
|
{
|
|
|
|
|
// rct outputs don't exist before v3
|
|
|
|
|
if (amount == 0)
|
|
|
|
@ -1984,22 +1984,7 @@ bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height,
|
|
|
|
|
if (from_height > start_height)
|
|
|
|
|
start_height = from_height;
|
|
|
|
|
|
|
|
|
|
distribution.clear();
|
|
|
|
|
uint64_t db_height = m_db->height();
|
|
|
|
|
if (start_height >= db_height)
|
|
|
|
|
return false;
|
|
|
|
|
distribution.resize(db_height - start_height, 0);
|
|
|
|
|
bool r = for_all_outputs(amount, [&](uint64_t height) {
|
|
|
|
|
CHECK_AND_ASSERT_MES(height >= real_start_height && height <= db_height, false, "Height not in expected range");
|
|
|
|
|
if (height >= start_height)
|
|
|
|
|
distribution[height - start_height]++;
|
|
|
|
|
else
|
|
|
|
|
base++;
|
|
|
|
|
return true;
|
|
|
|
|
});
|
|
|
|
|
if (!r)
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
return m_db->get_output_distribution(amount, start_height, to_height, distribution, base);
|
|
|
|
|
}
|
|
|
|
|
//------------------------------------------------------------------
|
|
|
|
|
// This function takes a list of block hashes from another node
|
|
|
|
@ -3944,7 +3929,7 @@ MWARNING("first_index: " << first_index << " - " << last_index);
|
|
|
|
|
// add to the known hashes array
|
|
|
|
|
if (!valid)
|
|
|
|
|
{
|
|
|
|
|
MWARNING("invalid hash for blocks " << n * HASH_OF_HASHES_STEP << " - " << (n * HASH_OF_HASHES_STEP + HASH_OF_HASHES_STEP - 1));
|
|
|
|
|
MDEBUG("invalid hash for blocks " << n * HASH_OF_HASHES_STEP << " - " << (n * HASH_OF_HASHES_STEP + HASH_OF_HASHES_STEP - 1));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|