aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-05-18 09:38:38 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-05-18 09:39:56 +0100
commit16e209e08dcb0e8ee49115071809e6540dc57ec1 (patch)
tree5348f86bc1b9917a3cdc108f0795a3b11cf0ee37
parentMerge pull request #3794 (diff)
downloadmonero-16e209e08dcb0e8ee49115071809e6540dc57ec1.tar.xz
core: lock incoming tx lock when checking the txpool and chain
This gets rid of an innocuous race trying to add the same tx twice to the txpool
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index ce75f74d8..d723d3567 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -675,6 +675,7 @@ namespace cryptonote
bool core::handle_incoming_txs(const std::list<blobdata>& tx_blobs, std::vector<tx_verification_context>& tvc, bool keeped_by_block, bool relayed, bool do_not_relay)
{
TRY_ENTRY();
+ CRITICAL_REGION_LOCAL(m_incoming_tx_lock);
struct result { bool res; cryptonote::transaction tx; crypto::hash hash; crypto::hash prefix_hash; bool in_txpool; bool in_blockchain; };
std::vector<result> results(tx_blobs.size());