Skip to content

Commit

Permalink
Merge pull request #2483 from steemit/2019-PR
Browse files Browse the repository at this point in the history
Reduce the comment interval from 20 seconds to 3 seconds
  • Loading branch information
Michael Vandeberg committed May 22, 2018
2 parents 07dfc32 + 4e0c6be commit 0d70c98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,15 @@ void comment_evaluator::do_apply( const comment_operation& o )
FC_ASSERT( _db.calculate_discussion_payout_time( *parent ) != fc::time_point_sec::maximum(), "Discussion is frozen." );
}

if( _db.has_hardfork( STEEM_HARDFORK_0_12__176 ) )
FC_TODO( "Cleanup this logic after HF 20. Old ops don't need to check pre-hf20 times." )
if( _db.has_hardfork( STEEM_HARDFORK_0_20__2019 ) )
{
if( o.parent_author == STEEM_ROOT_POST_PARENT )
FC_ASSERT( ( now - auth.last_root_post ) > STEEM_MIN_ROOT_COMMENT_INTERVAL, "You may only post once every 5 minutes.", ("now",now)("last_root_post", auth.last_root_post) );
else
FC_ASSERT( (now - auth.last_post) >= STEEM_MIN_REPLY_INTERVAL_HF20, "You may only comment once every 3 seconds.", ("now",now)("auth.last_post",auth.last_post) );
}
else if( _db.has_hardfork( STEEM_HARDFORK_0_12__176 ) )
{
if( o.parent_author == STEEM_ROOT_POST_PARENT )
FC_ASSERT( ( now - auth.last_root_post ) > STEEM_MIN_ROOT_COMMENT_INTERVAL, "You may only post once every 5 minutes.", ("now",now)("last_root_post", auth.last_root_post) );
Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/get_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ fc::variant_object get_config()
result["STEEM_MIN_CURATE_REWARD"] = STEEM_MIN_CURATE_REWARD;
result["STEEM_MIN_PERMLINK_LENGTH"] = STEEM_MIN_PERMLINK_LENGTH;
result["STEEM_MIN_REPLY_INTERVAL"] = STEEM_MIN_REPLY_INTERVAL;
result["STEEM_MIN_REPLY_INTERVAL_HF20"] = STEEM_MIN_REPLY_INTERVAL_HF20;
result["STEEM_MIN_ROOT_COMMENT_INTERVAL"] = STEEM_MIN_ROOT_COMMENT_INTERVAL;
result["STEEM_MIN_VOTE_INTERVAL_SEC"] = STEEM_MIN_VOTE_INTERVAL_SEC;
result["STEEM_MINER_ACCOUNT"] = STEEM_MINER_ACCOUNT;
Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/hardfork.d/0_20.hf
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define STEEM_HARDFORK_0_20__1782 (STEEM_HARDFORK_0_20)
#define STEEM_HARDFORK_0_20__1811 (STEEM_HARDFORK_0_20)
#define STEEM_HARDFORK_0_20__1815 (STEEM_HARDFORK_0_20)
#define STEEM_HARDFORK_0_20__2019 (STEEM_HARDFORK_0_20)

#define STEEM_HARDFORK_0_20_VERSION hardfork_version( 0, 20 )

Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/include/steem/protocol/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@

#define STEEM_MIN_ROOT_COMMENT_INTERVAL (fc::seconds(60*5)) // 5 minutes
#define STEEM_MIN_REPLY_INTERVAL (fc::seconds(20)) // 20 seconds
#define STEEM_MIN_REPLY_INTERVAL_HF20 (fc::seconds(3)) // 3 seconds
#define STEEM_POST_AVERAGE_WINDOW (60*60*24u) // 1 day
#define STEEM_POST_WEIGHT_CONSTANT (uint64_t(4*STEEM_100_PERCENT) * (4*STEEM_100_PERCENT))// (4*STEEM_100_PERCENT) -> 2 posts per 1 days, average 1 every 12 hours

Expand Down

0 comments on commit 0d70c98

Please sign in to comment.