mirror of
https://github.com/monero-project/monero.git
synced 2025-08-01 17:26:08 -04:00
protocol: pass blockchain cumulative difficulty when syncing
Not used yet.
This commit is contained in:
parent
9e6bcbc014
commit
827afcb7ea
8 changed files with 30 additions and 0 deletions
|
@ -2038,6 +2038,7 @@ bool Blockchain::find_blockchain_supplement(const std::list<crypto::hash>& qbloc
|
|||
{
|
||||
resp.m_block_ids.push_back(m_db->get_block_hash_from_height(i));
|
||||
}
|
||||
resp.cumulative_difficulty = m_db->get_block_cumulative_difficulty(m_db->height() - 1);
|
||||
m_db->block_txn_stop();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -826,6 +826,16 @@ namespace cryptonote
|
|||
*/
|
||||
bool for_all_outputs(std::function<bool(uint64_t amount, const crypto::hash &tx_hash, size_t tx_idx)>) const;
|
||||
|
||||
/**
|
||||
* @brief get a reference to the BlockchainDB in use by Blockchain
|
||||
*
|
||||
* @return a reference to the BlockchainDB instance
|
||||
*/
|
||||
const BlockchainDB& get_db() const
|
||||
{
|
||||
return *m_db;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief get a reference to the BlockchainDB in use by Blockchain
|
||||
*
|
||||
|
|
|
@ -1103,6 +1103,11 @@ namespace cryptonote
|
|||
return m_blockchain_storage.get_tail_id();
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
difficulty_type core::get_block_cumulative_difficulty(uint64_t height) const
|
||||
{
|
||||
return m_blockchain_storage.get_db().get_block_cumulative_difficulty(height);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
size_t core::get_pool_transactions_count() const
|
||||
{
|
||||
return m_mempool.get_transactions_count();
|
||||
|
|
|
@ -520,6 +520,13 @@ namespace cryptonote
|
|||
*/
|
||||
crypto::hash get_tail_id() const;
|
||||
|
||||
/**
|
||||
* @copydoc Blockchain::get_block_cumulative_difficulty
|
||||
*
|
||||
* @note see Blockchain::get_block_cumulative_difficulty
|
||||
*/
|
||||
difficulty_type get_block_cumulative_difficulty(uint64_t height) const;
|
||||
|
||||
/**
|
||||
* @copydoc Blockchain::get_random_outs_for_amounts
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue