Skip to content

Commit

Permalink
Merge pull request #135 from peerplays-network/SON11
Browse files Browse the repository at this point in the history
Add chain extension parameter to set SON count
  • Loading branch information
bobinson authored Sep 23, 2019
2 parents f8da541 + b853a82 commit 324923b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions libraries/chain/include/graphene/chain/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,4 @@
#define TOURNAMENT_MAX_START_DELAY (60*60*24*7) // 1 week
#define GPOS_PERIOD (60*60*24*30*6) // 6 months
#define GPOS_SUBPERIOD (60*60*24*30) // 1 month
#define MIN_SON_MEMBER_COUNT 15
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ namespace graphene { namespace chain {
optional < uint32_t > gpos_period;
optional < uint32_t > gpos_subperiod;
optional < uint32_t > gpos_period_start;
optional < uint16_t > son_count;
};

struct chain_parameters
Expand Down Expand Up @@ -121,6 +122,9 @@ namespace graphene { namespace chain {
inline uint32_t gpos_period_start()const {
return extensions.value.gpos_period_start.valid() ? *extensions.value.gpos_period_start : HARDFORK_GPOS_TIME.sec_since_epoch(); /// current period start date
}
inline uint16_t son_count()const {
return extensions.value.son_count.valid() ? *extensions.value.son_count : MIN_SON_MEMBER_COUNT;
}
};

} } // graphene::chain
Expand All @@ -134,6 +138,7 @@ FC_REFLECT( graphene::chain::parameter_extension,
(gpos_period)
(gpos_subperiod)
(gpos_period_start)
(son_count)
)

FC_REFLECT( graphene::chain::chain_parameters,
Expand Down

0 comments on commit 324923b

Please sign in to comment.