Fix build; #262
This commit is contained in:
parent
b50409de37
commit
cfb2718a1e
2 changed files with 9 additions and 13 deletions
|
|
@ -65,7 +65,7 @@ class database_api_impl : public std::enable_shared_from_this<database_api_impl>
|
||||||
|
|
||||||
// Blocks and transactions
|
// Blocks and transactions
|
||||||
optional<block_header> get_block_header(uint32_t block_num)const;
|
optional<block_header> get_block_header(uint32_t block_num)const;
|
||||||
map<uint32_t,block_header> get_block_header_batch(const vector<uint32_t> block_num)const;
|
map<uint32_t, optional<block_header>> get_block_header_batch(const vector<uint32_t> block_nums)const;
|
||||||
optional<signed_block> get_block(uint32_t block_num)const;
|
optional<signed_block> get_block(uint32_t block_num)const;
|
||||||
processed_transaction get_transaction( uint32_t block_num, uint32_t trx_in_block )const;
|
processed_transaction get_transaction( uint32_t block_num, uint32_t trx_in_block )const;
|
||||||
|
|
||||||
|
|
@ -363,21 +363,17 @@ optional<block_header> database_api_impl::get_block_header(uint32_t block_num) c
|
||||||
return *result;
|
return *result;
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
map<uint32_t,block_header> database_api::get_block_header_batch(const vector<uint32_t> block_num)const
|
map<uint32_t, optional<block_header>> database_api::get_block_header_batch(const vector<uint32_t> block_nums)const
|
||||||
{
|
{
|
||||||
return my->get_block_header_batch( block_num );
|
return my->get_block_header_batch( block_nums );
|
||||||
}
|
}
|
||||||
|
|
||||||
map<uint32_t,block_header> database_api_impl::get_block_header_batch(const vector<uint32_t> block_num) const
|
map<uint32_t, optional<block_header>> database_api_impl::get_block_header_batch(const vector<uint32_t> block_nums) const
|
||||||
{
|
{
|
||||||
map<uint32_t,block_header> results;
|
map<uint32_t, optional<block_header>> results;
|
||||||
for (const uint32_t& i : block_num) {
|
for (const uint32_t block_num : block_nums)
|
||||||
auto result = _db.fetch_block_by_number(i);
|
{
|
||||||
if (result)
|
results[block_num] = get_block_header(block_num);
|
||||||
results[i] = *result;
|
|
||||||
else
|
|
||||||
results[i] = {};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ class database_api
|
||||||
* @param block_num vector containing heights of the block whose header should be returned
|
* @param block_num vector containing heights of the block whose header should be returned
|
||||||
* @return array of headers of the referenced blocks, or null if no matching block was found
|
* @return array of headers of the referenced blocks, or null if no matching block was found
|
||||||
*/
|
*/
|
||||||
map<uint32_t,block_header> get_block_header_batch(const vector<uint32_t> block_num)const;
|
map<uint32_t, optional<block_header>> get_block_header_batch(const vector<uint32_t> block_nums)const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue