From a5002c8d06704fa8ddb1fd8e35a92b744ff53c0e Mon Sep 17 00:00:00 2001 From: Leny Kholodov Date: Mon, 18 Mar 2019 12:31:03 +0200 Subject: [PATCH] Change stakes user validation period according to STAKE_VALIDATION_PERIOD and TRUSTED_RESTAKING_PERIOD constants --- src/cryptonote_core/blockchain_based_list.cpp | 4 ++-- src/cryptonote_core/stake_transaction_storage.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cryptonote_core/blockchain_based_list.cpp b/src/cryptonote_core/blockchain_based_list.cpp index 9ddc04696..747d5b59b 100644 --- a/src/cryptonote_core/blockchain_based_list.cpp +++ b/src/cryptonote_core/blockchain_based_list.cpp @@ -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 diff --git a/src/cryptonote_core/stake_transaction_storage.cpp b/src/cryptonote_core/stake_transaction_storage.cpp index f74f34d7b..c3ea2c4d8 100644 --- a/src/cryptonote_core/stake_transaction_storage.cpp +++ b/src/cryptonote_core/stake_transaction_storage.cpp @@ -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; @@ -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; }