Skip to content

Commit

Permalink
Change stakes user validation period according to STAKE_VALIDATION_PE…
Browse files Browse the repository at this point in the history
…RIOD and TRUSTED_RESTAKING_PERIOD constants
  • Loading branch information
LenyKholodov committed Mar 18, 2019
1 parent 595e3f0 commit a5002c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/cryptonote_core/blockchain_based_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ bool is_valid_stake(uint64_t block_height, uint64_t stake_block_height, uint64_t
if (block_height < stake_block_height)
return false; //stake transaction block is in future

uint64_t stake_first_valid_block = stake_block_height + config::graft::STAKE_VALIDATION_PERIOD,
stake_last_valid_block = stake_block_height + stake_unlock_time + config::graft::TRUSTED_RESTAKING_PERIOD;
uint64_t stake_first_valid_block = stake_block_height,
stake_last_valid_block = stake_block_height + stake_unlock_time;

if (stake_last_valid_block <= block_height)
return false; //stake transaction is not valid
Expand Down
8 changes: 4 additions & 4 deletions src/cryptonote_core/stake_transaction_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ void StakeTransactionStorage::update_supernode_stakes(uint64_t block_number)
{
new_stake.amount = tx.amount;
new_stake.tier = get_tier(new_stake.amount);
new_stake.block_height = tx.block_height;
new_stake.unlock_time = tx.unlock_time;
new_stake.block_height = tx.block_height + config::graft::STAKE_VALIDATION_PERIOD;
new_stake.unlock_time = tx.unlock_time + config::graft::TRUSTED_RESTAKING_PERIOD - config::graft::STAKE_VALIDATION_PERIOD;
}

new_stake.supernode_public_id = tx.supernode_public_id;
Expand All @@ -214,8 +214,8 @@ void StakeTransactionStorage::update_supernode_stakes(uint64_t block_number)

stake.amount = tx.amount;
stake.tier = get_tier(stake.amount);
stake.block_height = tx.block_height;
stake.unlock_time = tx.unlock_time;
stake.block_height = tx.block_height + config::graft::STAKE_VALIDATION_PERIOD;
stake.unlock_time = tx.unlock_time + config::graft::TRUSTED_RESTAKING_PERIOD - config::graft::STAKE_VALIDATION_PERIOD;

continue;
}
Expand Down

0 comments on commit a5002c8

Please sign in to comment.