diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-21 20:30:10 +0000 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-21 20:30:10 +0000 |
| commit | 7c3f79cb9fcd51ade2b25c700567bdc101250ce1 (patch) | |
| tree | f21c018eb4462f4b20df08987a03c570f2b271bd | |
| parent | 6cc7d261406ad38071065a79f66c4366f65b65ba (diff) | |
| download | monzero-core-7c3f79cb9fcd51ade2b25c700567bdc101250ce1.tar.gz monzero-core-7c3f79cb9fcd51ade2b25c700567bdc101250ce1.tar.xz monzero-core-7c3f79cb9fcd51ade2b25c700567bdc101250ce1.zip | |
core: early out in handle_incoming_tx if already in pool or blockchain
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 5294431d6..5be25a410 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -496,6 +496,18 @@ namespace cryptonote return false; } + if(m_mempool.have_tx(tx_hash)) + { + LOG_PRINT_L2("tx " << tx_hash << "already have transaction in tx_pool"); + return true; + } + + if(m_blockchain_storage.have_tx(tx_hash)) + { + LOG_PRINT_L2("tx " << tx_hash << " already have transaction in blockchain"); + return true; + } + if(!check_tx_syntax(tx)) { LOG_PRINT_L1("WRONG TRANSACTION BLOB, Failed to check tx " << tx_hash << " syntax, rejected"); |
