forked from lthn/blockchain
compilation fix for blockchain_storage::get_assets()
This commit is contained in:
parent
9f8ce4cc09
commit
63dadb37c6
1 changed files with 4 additions and 2 deletions
|
|
@ -3813,7 +3813,8 @@ bool blockchain_storage::get_asset_info(const crypto::public_key& asset_id, asse
|
|||
uint64_t blockchain_storage::get_assets(uint64_t offset, uint64_t count, std::list<asset_descriptor_with_id>& assets) const
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(m_read_lock);
|
||||
m_db_assets.enumerate_items([&](uint64_t i, const crypto::public_key& asset_id, const std::list<asset_descriptor_base>& asset_descriptor_history)
|
||||
assets.clear();
|
||||
m_db_assets.enumerate_items([&](uint64_t i, const crypto::public_key& asset_id, const std::list<asset_descriptor_operation>& asset_descriptor_history)
|
||||
{
|
||||
if (i < offset)
|
||||
{
|
||||
|
|
@ -3822,7 +3823,7 @@ uint64_t blockchain_storage::get_assets(uint64_t offset, uint64_t count, std::li
|
|||
|
||||
CHECK_AND_ASSERT_THROW_MES(asset_descriptor_history.size(), "asset_descriptor_history unexpectedly have 0 size");
|
||||
assets.push_back(asset_descriptor_with_id());
|
||||
static_cast<asset_descriptor_base&>(assets.back()) = asset_descriptor_history.back();
|
||||
static_cast<asset_descriptor_base&>(assets.back()) = asset_descriptor_history.back().descriptor;
|
||||
assets.back().asset_id = asset_id;
|
||||
if (i + count > offset)
|
||||
{
|
||||
|
|
@ -3830,6 +3831,7 @@ uint64_t blockchain_storage::get_assets(uint64_t offset, uint64_t count, std::li
|
|||
}
|
||||
return true;
|
||||
});
|
||||
return assets.size();
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
uint64_t blockchain_storage::get_assets_count() const
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue