diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-22 16:13:31 +0000 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-22 16:13:31 +0000 |
| commit | f0989893961d16baec0d4474d0bbc46f0416ff37 (patch) | |
| tree | 1cad9e1a380e83aff2760063f801de264b0491fd /src/cryptonote_core/cryptonote_core.cpp | |
| parent | 71ac698b78acd3719d572a881c377db62c15c62f (diff) | |
| download | monzero-core-f0989893961d16baec0d4474d0bbc46f0416ff37.tar.gz monzero-core-f0989893961d16baec0d4474d0bbc46f0416ff37.tar.xz monzero-core-f0989893961d16baec0d4474d0bbc46f0416ff37.zip | |
core: cache tx hashes of failing semantics txes
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 5294431d6..a92cd2df3 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -487,6 +487,13 @@ namespace cryptonote } //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(); const size_t max_tx_version = version == 1 ? 1 : 2; if (tx.version == 0 || tx.version > max_tx_version) @@ -522,6 +529,7 @@ namespace cryptonote if(!check_tx_semantic(tx, keeped_by_block)) { 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; return false; } |
