from hard fork 2, all outputs must be decomposed

The wallet decomposes fully as of now too.
This commit is contained in:
moneromooo-monero
2015-10-06 16:22:19 +01:00
parent 90ccad1236
commit ac90d488e7
6 changed files with 67 additions and 48 deletions

View File

@@ -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__);