aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain_storage.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-11-18 10:37:22 +0200
committerRiccardo Spagni <ric@spagni.net>2015-11-18 10:37:27 +0200
commit0d09e15a1c0cc02255bf0c091efd3b28bbeb0a9f (patch)
tree1947d9588336b76724e9f046d97ede321cafe572 /src/cryptonote_core/blockchain_storage.cpp
parentbc7aa988a67f1762a79015c5647aa8d2783be405 (diff)
parentbaf101ef4a05ae4d24ed717c16be929456775969 (diff)
downloadmonzero-core-0d09e15a1c0cc02255bf0c091efd3b28bbeb0a9f.tar.gz
monzero-core-0d09e15a1c0cc02255bf0c091efd3b28bbeb0a9f.tar.xz
monzero-core-0d09e15a1c0cc02255bf0c091efd3b28bbeb0a9f.zip
Merge pull request #490
baf101e More changes for 2-min blocks Use the correct block time for realtime fuzz on locktime Use the correct block time to calculate next_difficulty on alt chains (will not work as-is with voting) Lock unit tests to original block time for now (Javier Smooth) 4fea1a5 Adjust difficulty target (2 min) and full reward zone (60 kbytes) for block version 2 (Javier Smooth)
Diffstat (limited to 'src/cryptonote_core/blockchain_storage.cpp')
-rw-r--r--src/cryptonote_core/blockchain_storage.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp
index fa63efe0b..f7c9ffb78 100644
--- a/src/cryptonote_core/blockchain_storage.cpp
+++ b/src/cryptonote_core/blockchain_storage.cpp
@@ -430,7 +430,7 @@ difficulty_type blockchain_storage::get_difficulty_for_next_block() const
timestamps.push_back(m_blocks[offset].bl.timestamp);
commulative_difficulties.push_back(m_blocks[offset].cumulative_difficulty);
}
- return next_difficulty(timestamps, commulative_difficulties);
+ return next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1);
}
//------------------------------------------------------------------
bool blockchain_storage::rollback_blockchain_switching(std::list<block>& original_chain, size_t rollback_height)
@@ -571,7 +571,7 @@ difficulty_type blockchain_storage::get_next_difficulty_for_alternative_chain(co
break;
}
}
- return next_difficulty(timestamps, commulative_difficulties);
+ return next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1);
}
//------------------------------------------------------------------
bool blockchain_storage::prevalidate_miner_transaction(const block& b, uint64_t height) const
@@ -606,7 +606,7 @@ bool blockchain_storage::validate_miner_transaction(const block& b, size_t cumul
std::vector<size_t> last_blocks_sizes;
get_last_n_blocks_sizes(last_blocks_sizes, CRYPTONOTE_REWARD_BLOCKS_WINDOW);
- if (!get_block_reward(epee::misc_utils::median(last_blocks_sizes), cumulative_block_size, already_generated_coins, base_reward)) {
+ if (!get_block_reward(epee::misc_utils::median(last_blocks_sizes), cumulative_block_size, already_generated_coins, base_reward,0)) {
LOG_PRINT_L1("block size " << cumulative_block_size << " is bigger than allowed for this blockchain");
return false;
}
@@ -1505,7 +1505,7 @@ bool blockchain_storage::is_tx_spendtime_unlocked(uint64_t unlock_time) const
{
//interpret as time
uint64_t current_time = static_cast<uint64_t>(time(NULL));
- if(current_time + CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS >= unlock_time)
+ if(current_time + CRYPTONOTE_LOCKED_TX_ALLOWED_DELTA_SECONDS_V1 >= unlock_time)
return true;
else
return false;