aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-01-29 17:15:09 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-01-29 17:21:25 +0000
commit94b98fb5fa98ca317664b96d6a564159945de95e (patch)
treed0b53033cc335f33dd383ae38188ff7af5a072f0 /src/cryptonote_core/tx_pool.h
parenttx_pool: fix use of invalidated iterator (diff)
downloadmonero-94b98fb5fa98ca317664b96d6a564159945de95e.tar.xz
tx_pool: do not accept txes not in a block if they timed out before
This is intended to avoid cases where a timed out tx will be re-relayed by another peer for which it has not timed out yet, which would cause the tx to stay in the network's pool for a long time (until all peers time it out before another one tries to relay it again).
Diffstat (limited to 'src/cryptonote_core/tx_pool.h')
-rw-r--r--src/cryptonote_core/tx_pool.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h
index 3832ccb64..34dc1f72f 100644
--- a/src/cryptonote_core/tx_pool.h
+++ b/src/cryptonote_core/tx_pool.h
@@ -110,7 +110,7 @@ namespace cryptonote
/*bool flush_pool(const std::strig& folder);
bool inflate_pool(const std::strig& folder);*/
-#define CURRENT_MEMPOOL_ARCHIVE_VER 9
+#define CURRENT_MEMPOOL_ARCHIVE_VER 10
template<class archive_t>
void serialize(archive_t & a, const unsigned int version)
@@ -120,6 +120,7 @@ namespace cryptonote
CRITICAL_REGION_LOCAL(m_transactions_lock);
a & m_transactions;
a & m_spent_key_images;
+ a & m_timed_out_transactions;
}
struct tx_details
@@ -162,6 +163,8 @@ namespace cryptonote
sorted_tx_container::iterator find_tx_in_sorted_container(const crypto::hash& id) const;
+ std::unordered_set<crypto::hash> m_timed_out_transactions;
+
//transactions_container m_alternative_transactions;
std::string m_config_folder;