mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
Merge pull request #1615
f0989893
core: cache tx hashes of failing semantics txes (moneromooo-monero)
This commit is contained in:
commit
9c06a7fd04
2 changed files with 10 additions and 0 deletions
|
@ -487,6 +487,13 @@ namespace cryptonote
|
||||||
}
|
}
|
||||||
//std::cout << "!"<< tx.vin.size() << std::endl;
|
//std::cout << "!"<< tx.vin.size() << std::endl;
|
||||||
|
|
||||||
|
if (bad_semantics_txes.find(tx_hash) != bad_semantics_txes.end())
|
||||||
|
{
|
||||||
|
LOG_PRINT_L1("Transaction already seen with bad semantics, rejected");
|
||||||
|
tvc.m_verifivation_failed = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t version = m_blockchain_storage.get_current_hard_fork_version();
|
uint8_t version = m_blockchain_storage.get_current_hard_fork_version();
|
||||||
const size_t max_tx_version = version == 1 ? 1 : 2;
|
const size_t max_tx_version = version == 1 ? 1 : 2;
|
||||||
if (tx.version == 0 || tx.version > max_tx_version)
|
if (tx.version == 0 || tx.version > max_tx_version)
|
||||||
|
@ -534,6 +541,7 @@ namespace cryptonote
|
||||||
if(!check_tx_semantic(tx, keeped_by_block))
|
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");
|
||||||
|
bad_semantics_txes.insert(tx_hash);
|
||||||
tvc.m_verifivation_failed = true;
|
tvc.m_verifivation_failed = true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -824,6 +824,8 @@ namespace cryptonote
|
||||||
size_t block_sync_size;
|
size_t block_sync_size;
|
||||||
|
|
||||||
time_t start_time;
|
time_t start_time;
|
||||||
|
|
||||||
|
std::unordered_set<crypto::hash> bad_semantics_txes;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue