diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 792bee8d..e377c0f5 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -4171,6 +4171,15 @@ void Blockchain::load_compiled_in_block_hashes() } #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() { m_blockchain_lock.lock(); diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h index 564b53af..bd8a8313 100644 --- a/src/cryptonote_core/blockchain.h +++ b/src/cryptonote_core/blockchain.h @@ -865,6 +865,9 @@ namespace cryptonote cryptonote::blobdata get_txpool_tx_blob(const crypto::hash& txid) const; bool for_all_txpool_txes(std::function, 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 unlock(); diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index a4df27cd..13e5badd 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -562,7 +562,11 @@ namespace cryptonote rv.outPk[n].dest = rct::pk2rct(boost::get(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"); tvc.m_verifivation_failed = true;