diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-06 16:22:19 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-10-11 13:02:55 +0100 |
commit | ac90d488e75592f215e8604e5faaf02c1d9cbfc3 (patch) | |
tree | e1279eaa4bb507416096820e2e12763d85403450 /src/cryptonote_core/blockchain.cpp | |
parent | from hard fork 2, claim a quantized reward in coinbase (diff) | |
download | monero-ac90d488e75592f215e8604e5faaf02c1d9cbfc3.tar.xz |
from hard fork 2, all outputs must be decomposed
The wallet decomposes fully as of now too.
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r-- | src/cryptonote_core/blockchain.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index b76cce9d1..e06c3c08c 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1972,6 +1972,23 @@ bool Blockchain::check_tx_inputs(const transaction& tx, uint64_t& max_used_block return true; } //------------------------------------------------------------------ +bool Blockchain::check_tx_outputs(const transaction& tx) +{ + LOG_PRINT_L3("Blockchain::" << __func__); + CRITICAL_REGION_LOCAL(m_blockchain_lock); + + // from hard fork 2, we forbid dust and compound outputs + if (m_hardfork->get_current_version() >= 2) { + BOOST_FOREACH(auto &o, tx.vout) { + if (!is_valid_decomposed_amount(o.amount)) { + return false; + } + } + } + + return true; +} +//------------------------------------------------------------------ bool Blockchain::have_tx_keyimges_as_spent(const transaction &tx) const { LOG_PRINT_L3("Blockchain::" << __func__); |