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

Commit

Permalink
added hardfork verification for db changes #971
Browse files Browse the repository at this point in the history
  • Loading branch information
e-schepachev committed Oct 23, 2018
1 parent 3a3fe74 commit 810663d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions libraries/chain/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2240,8 +2240,11 @@ namespace golos { namespace chain {
if (a.withdrawn >= a.to_withdraw || a.vesting_shares.amount == 0) {
a.vesting_withdraw_rate.amount = 0;
a.next_vesting_withdrawal = fc::time_point_sec::maximum();
a.withdrawn = 0;
a.to_withdraw = 0;

if (has_hardfork(STEEMIT_HARDFORK_0_19__971)) {
a.withdrawn = 0;
a.to_withdraw = 0;
}
} else {
a.next_vesting_withdrawal += fc::seconds(STEEMIT_VESTING_WITHDRAW_INTERVAL_SECONDS);
}
Expand Down
1 change: 1 addition & 0 deletions libraries/chain/hardfork.d/0_19.hf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define STEEMIT_HARDFORK_0_19__295 (STEEMIT_HARDFORK_0_19) // Referral program implemented
#define STEEMIT_HARDFORK_0_19__533 (STEEMIT_HARDFORK_0_19) // Leaky algorithm for comment and vote bandwidth
#define STEEMIT_HARDFORK_0_19__756 (STEEMIT_HARDFORK_0_19) // Vesting shares delegation with interest
#define STEEMIT_HARDFORK_0_19__971 (STEEMIT_HARDFORK_0_19) // Withdraw vests to another account resests on account recover

#ifdef STEEMIT_BUILD_TESTNET
#define STEEMIT_HARDFORK_0_19_TIME 1534755600 // 20 aug 2018 12:00:00 MSK
Expand Down
4 changes: 3 additions & 1 deletion libraries/chain/steem_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,9 @@ namespace {
a.last_account_recovery = now;
});

reset_vesting_withdraw(_db, account);
if (_db.has_hardfork(STEEMIT_HARDFORK_0_19__971)) {
reset_vesting_withdraw(_db, account);
}
}

void change_recovery_account_evaluator::do_apply(const change_recovery_account_operation& o) {
Expand Down

0 comments on commit 810663d

Please sign in to comment.