diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-09-22 20:43:19 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-09-27 22:46:30 +0100 |
commit | 4bbf944df083689aac23a35f78da0147852f54af (patch) | |
tree | f62f9a5e5186ef6dd2d94f8728bce92d2e0e5ed8 /src/cryptonote_core/blockchain.cpp | |
parent | hardfork: change window semantics to not count the newly added block (diff) | |
download | monero-4bbf944df083689aac23a35f78da0147852f54af.tar.xz |
blockchain: on hardfork 2, allow miners to claim less money than allowed
So they can avoid dust if they so wish
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index c6e9b7684..14ee36911 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -963,10 +963,14 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl LOG_PRINT_L1("coinbase transaction spend too much money (" << print_money(money_in_use) << "). Block reward is " << print_money(base_reward + fee) << "(" << print_money(base_reward) << "+" << print_money(fee) << ")"); return false; } - if(base_reward + fee != money_in_use) + // From hard fork 2, we allow a miner to claim less block reward than is allowed, in case a miner wants less dust + if (m_hardfork->get_current_version() < 2) { - LOG_PRINT_L1("coinbase transaction doesn't use full amount of block reward: spent: " << money_in_use << ", block reward " << base_reward + fee << "(" << base_reward << "+" << fee << ")"); - return false; + if(base_reward + fee != money_in_use) + { + LOG_PRINT_L1("coinbase transaction doesn't use full amount of block reward: spent: " << money_in_use << ", block reward " << base_reward + fee << "(" << base_reward << "+" << fee << ")"); + return false; + } } return true; } |