Scorum
committee.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <set>
4 
6 
10 
11 namespace scorum {
12 namespace chain {
13 namespace committee {
14 
15 template <typename MemberIndexType>
16 std::set<account_name_type> lookup_members(const database& db, const std::string& lower_bound_name, uint32_t limit)
17 {
18  std::set<account_name_type> ret;
19 
20  const auto& committee_members = db.get_index<MemberIndexType>().indices().template get<by_account_name>();
21 
22  for (auto it = committee_members.lower_bound(lower_bound_name); it != committee_members.end(); ++it)
23  {
24  ret.insert(std::cref(it->account));
25 
26  if (ret.size() >= limit)
27  break;
28  }
29 
30  return ret;
31 }
32 
33 } // namespace committee
34 } // namespace chain
35 } // namespace scorum
tracks the blockchain state in an extensible manner
Definition: database.hpp:52
std::set< account_name_type > lookup_members(const database &db, const std::string &lower_bound_name, uint32_t limit)
Definition: committee.hpp:16
Definition: asset.cpp:15