mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
blockchain: skip checking tx semantics in embedded block hash range
If the txes are bad, this'll be picked up by the block hash mismatch since the tx merkle root is part of the block hash.
This commit is contained in:
parent
ab594cfee9
commit
5d91b26c0f
3 changed files with 17 additions and 1 deletions
|
@ -4154,6 +4154,15 @@ void Blockchain::load_compiled_in_block_hashes()
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool Blockchain::is_within_compiled_block_hash_area(uint64_t height) const
|
||||||
|
{
|
||||||
|
#if defined(PER_BLOCK_CHECKPOINT)
|
||||||
|
return height < m_blocks_hash_check.size();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void Blockchain::lock()
|
void Blockchain::lock()
|
||||||
{
|
{
|
||||||
m_blockchain_lock.lock();
|
m_blockchain_lock.lock();
|
||||||
|
|
|
@ -865,6 +865,9 @@ namespace cryptonote
|
||||||
cryptonote::blobdata get_txpool_tx_blob(const crypto::hash& txid) const;
|
cryptonote::blobdata get_txpool_tx_blob(const crypto::hash& txid) const;
|
||||||
bool for_all_txpool_txes(std::function<bool(const crypto::hash&, const txpool_tx_meta_t&, const cryptonote::blobdata*)>, bool include_blob = false) const;
|
bool for_all_txpool_txes(std::function<bool(const crypto::hash&, const txpool_tx_meta_t&, const cryptonote::blobdata*)>, bool include_blob = false) const;
|
||||||
|
|
||||||
|
bool is_within_compiled_block_hash_area(uint64_t height) const;
|
||||||
|
bool is_within_compiled_block_hash_area() const { return is_within_compiled_block_hash_area(m_db->height()); }
|
||||||
|
|
||||||
void lock();
|
void lock();
|
||||||
void unlock();
|
void unlock();
|
||||||
|
|
||||||
|
|
|
@ -564,7 +564,11 @@ namespace cryptonote
|
||||||
rv.outPk[n].dest = rct::pk2rct(boost::get<txout_to_key>(tx.vout[n].target).key);
|
rv.outPk[n].dest = rct::pk2rct(boost::get<txout_to_key>(tx.vout[n].target).key);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_tx_semantic(tx, keeped_by_block))
|
if (keeped_by_block && get_blockchain_storage().is_within_compiled_block_hash_area())
|
||||||
|
{
|
||||||
|
MTRACE("Skipping semantics check for tx kept by block in embedded hash area");
|
||||||
|
}
|
||||||
|
else if(!check_tx_semantic(tx, keeped_by_block))
|
||||||
{
|
{
|
||||||
LOG_PRINT_L1("WRONG TRANSACTION BLOB, Failed to check tx " << tx_hash << " semantic, rejected");
|
LOG_PRINT_L1("WRONG TRANSACTION BLOB, Failed to check tx " << tx_hash << " semantic, rejected");
|
||||||
tvc.m_verifivation_failed = true;
|
tvc.m_verifivation_failed = true;
|
||||||
|
|
Loading…
Reference in a new issue