Skip to content
This repository was archived by the owner on Oct 4, 2019. It is now read-only.

Commit 1f4ca70

Browse files
committed
Return upvote lockout. #461
1 parent c89b709 commit 1f4ca70

6 files changed

Lines changed: 9 additions & 19 deletions

File tree

libraries/chain/hardfork.d/0_17.hf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#define STEEMIT_HARDFORK_0_17__431 (STEEMIT_HARDFORK_0_17) // Single cachout window
55
#define STEEMIT_HARDFORK_0_17__432 (STEEMIT_HARDFORK_0_17) // Comment reward beneficiaries
66
#define STEEMIT_HARDFORK_0_17__433 (STEEMIT_HARDFORK_0_17) // Linear reward curve
7-
#define STEEMIT_HARDFORK_0_17__454 (STEEMIT_HARDFORK_0_17) // Upvote lockout
87

98
#ifdef STEEMIT_BUILD_TESTNET
109
#define STEEMIT_HARDFORK_0_17_TIME 1519894800 // 1 mar 2018 12:00:00 MSK

libraries/chain/steem_evaluator.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,12 +1216,9 @@ namespace golos {
12161216
int64_t rshares = o.weight < 0 ? -abs_rshares : abs_rshares;
12171217

12181218
if (rshares > 0) {
1219-
if( _db.has_hardfork(STEEMIT_HARDFORK_0_17__454)) {
1220-
FC_ASSERT(_db.head_block_time() < comment.cashout_time - STEEMIT_UPVOTE_LOCKOUT_HF17,
1221-
"Cannot increase payout within last twelve hours before payout.");
1222-
} else if (_db.has_hardfork(STEEMIT_HARDFORK_0_7)) {
1219+
if (_db.has_hardfork(STEEMIT_HARDFORK_0_7)) {
12231220
FC_ASSERT(_db.head_block_time() <
1224-
_db.calculate_discussion_payout_time(comment) - STEEMIT_UPVOTE_LOCKOUT_HF7,
1221+
_db.calculate_discussion_payout_time(comment) - STEEMIT_UPVOTE_LOCKOUT,
12251222
"Cannot increase reward of post within the last minute before payout.");
12261223
}
12271224
}
@@ -1430,12 +1427,9 @@ namespace golos {
14301427
int64_t rshares = o.weight < 0 ? -abs_rshares : abs_rshares;
14311428

14321429
if (itr->rshares < rshares) {
1433-
if( _db.has_hardfork(STEEMIT_HARDFORK_0_17__454)) {
1434-
FC_ASSERT(_db.head_block_time() < comment.cashout_time - STEEMIT_UPVOTE_LOCKOUT_HF17,
1435-
"Cannot increase payout within last twelve hours before payout.");
1436-
} else if (_db.has_hardfork(STEEMIT_HARDFORK_0_7)) {
1430+
if (_db.has_hardfork(STEEMIT_HARDFORK_0_7)) {
14371431
FC_ASSERT(_db.head_block_time() <
1438-
_db.calculate_discussion_payout_time(comment) - STEEMIT_UPVOTE_LOCKOUT_HF7,
1432+
_db.calculate_discussion_payout_time(comment) - STEEMIT_UPVOTE_LOCKOUT,
14391433
"Cannot increase reward of post within the last minute before payout.");
14401434
}
14411435
}

libraries/protocol/get_config.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ namespace golos {
113113
result["STEEMIT_START_VESTING_BLOCK"] = STEEMIT_START_VESTING_BLOCK;
114114
result["STEEMIT_SYMBOL"] = STEEMIT_SYMBOL;
115115
result["STEEMIT_TEMP_ACCOUNT"] = STEEMIT_TEMP_ACCOUNT;
116-
result["STEEMIT_UPVOTE_LOCKOUT_HF7"] = STEEMIT_UPVOTE_LOCKOUT_HF7;
117-
result["STEEMIT_UPVOTE_LOCKOUT_HF17"] = STEEMIT_UPVOTE_LOCKOUT_HF17;
116+
result["STEEMIT_UPVOTE_LOCKOUT"] = STEEMIT_UPVOTE_LOCKOUT;
118117
result["STEEMIT_VESTING_WITHDRAW_INTERVALS"] = STEEMIT_VESTING_WITHDRAW_INTERVALS;
119118
result["STEEMIT_VESTING_WITHDRAW_INTERVAL_SECONDS"] = STEEMIT_VESTING_WITHDRAW_INTERVAL_SECONDS;
120119
result["STEEMIT_VOTE_CHANGE_LOCKOUT_PERIOD"] = STEEMIT_VOTE_CHANGE_LOCKOUT_PERIOD;

libraries/protocol/include/golos/protocol/config.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@
6464
#define STEEMIT_SAVINGS_WITHDRAW_REQUEST_LIMIT 100
6565
#define STEEMIT_VOTE_REGENERATION_SECONDS (5*60*60*24) // 5 day
6666
#define STEEMIT_MAX_VOTE_CHANGES 5
67-
#define STEEMIT_UPVOTE_LOCKOUT_HF7 (fc::minutes(1))
68-
#define STEEMIT_UPVOTE_LOCKOUT_HF17 (fc::minutes(5))
67+
#define STEEMIT_UPVOTE_LOCKOUT (fc::minutes(1))
6968
#define STEEMIT_REVERSE_AUCTION_WINDOW_SECONDS (60*30) /// 30 minutes
7069
#define STEEMIT_MIN_VOTE_INTERVAL_SEC 3
7170
#define STEEMIT_MAX_COMMENT_BENEFICIARIES 8
@@ -265,8 +264,7 @@
265264
#define STEEMIT_SAVINGS_WITHDRAW_REQUEST_LIMIT 100
266265
#define STEEMIT_VOTE_REGENERATION_SECONDS (5*60*60*24) // 5 day
267266
#define STEEMIT_MAX_VOTE_CHANGES 5
268-
#define STEEMIT_UPVOTE_LOCKOUT_HF7 (fc::minutes(1))
269-
#define STEEMIT_UPVOTE_LOCKOUT_HF17 (fc::hours(12))
267+
#define STEEMIT_UPVOTE_LOCKOUT (fc::minutes(1))
270268
#define STEEMIT_REVERSE_AUCTION_WINDOW_SECONDS (60*30) /// 30 minutes
271269
#define STEEMIT_MIN_VOTE_INTERVAL_SEC 3
272270
#define STEEMIT_MAX_COMMENT_BENEFICIARIES 64

tests/tests/operation_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ BOOST_FIXTURE_TEST_SUITE(operation_tests, clean_database_fixture)
967967
BOOST_TEST_MESSAGE("--- Test failure when increasing rshares within lockout period");
968968

969969
generate_blocks(fc::time_point_sec(
970-
(new_bob_comment.cashout_time - STEEMIT_UPVOTE_LOCKOUT_HF17).sec_since_epoch() +
970+
(new_bob_comment.cashout_time - STEEMIT_UPVOTE_LOCKOUT).sec_since_epoch() +
971971
STEEMIT_BLOCK_INTERVAL), true);
972972

973973
op.weight = STEEMIT_100_PERCENT;

tests/tests/operation_time_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ BOOST_AUTO_TEST_CASE( comment_payout )
111111

112112
generate_blocks(
113113
db->get_comment( "bob", string( "test" ) ).cashout_time -
114-
STEEMIT_MIN_VOTE_INTERVAL_SEC - STEEMIT_BLOCK_INTERVAL- STEEMIT_UPVOTE_LOCKOUT_HF17,
114+
STEEMIT_MIN_VOTE_INTERVAL_SEC - STEEMIT_BLOCK_INTERVAL- STEEMIT_UPVOTE_LOCKOUT,
115115
true);
116116

117117
// broken checks after switching to single window cashout

0 commit comments

Comments
 (0)