30 #include <boost/multi_index_container.hpp> 31 #include <boost/multi_index/member.hpp> 32 #include <boost/multi_index/ordered_index.hpp> 33 #include <boost/multi_index/hashed_index.hpp> 34 #include <boost/multi_index/mem_fun.hpp> 36 namespace graphene {
namespace chain {
37 using boost::multi_index_container;
43 :num(d.block_num()),id(d.id()),data(
std::move(d) ){}
47 weak_ptr< fork_item >
prev;
54 uint64_t next_block_aslot = 0;
75 const static int MAX_BLOCK_REORDERING = 1024;
82 void set_head(shared_ptr<fork_item> h);
84 shared_ptr<fork_item> fetch_block(
const block_id_type&
id)
const;
85 vector<item_ptr> fetch_block_by_number(uint32_t n)
const;
91 shared_ptr<fork_item>
head()
const {
return _head; }
103 typedef multi_index_container<
107 ordered_non_unique<tag<block_num>, member<fork_item,uint32_t,&fork_item::num>>
111 void set_max_size( uint32_t s );
115 void _push_block(
const item_ptr& b );
116 void _push_next(
const item_ptr& newly_inserted);
118 uint32_t _max_size = 1024;
120 fork_multi_index_type _index;
121 shared_ptr<fork_item> _head;
shared_ptr< fork_item > item_ptr
block_id_type previous_id() const
shared_ptr< fork_item > head() const
fork_item(signed_block d)
weak_ptr< fork_item > prev
shared_ptr< vector< pair< witness_id_type, public_key_type > > > scheduled_witnesses
fc::time_point_sec next_block_time
multi_index_container< item_ptr, indexed_by< hashed_unique< tag< block_id >, member< fork_item, block_id_type, &fork_item::id >, std::hash< fc::ripemd160 > >, ordered_non_unique< tag< block_num >, member< fork_item, uint32_t,&fork_item::num > > > > fork_multi_index_type
at< List, 0 > first
Get the type at the beginning of the list.
vector< item_ptr > branch_type