aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.h
diff options
context:
space:
mode:
authorfluffypony <ric@spagni.net>2014-06-15 09:48:13 +0200
committerfluffypony <ric@spagni.net>2014-06-15 09:48:13 +0200
commit3bc16dc0e6bd38fbec51a054e640bacdb17a9a82 (patch)
tree314428685a9d8b6ce6471761c7775dc93cb19073 /src/cryptonote_core/tx_pool.h
parentadded checkpoint @ 80000 (diff)
downloadmonero-3bc16dc0e6bd38fbec51a054e640bacdb17a9a82.tar.xz
proper tx_pool handling from CryptoZoidberg / BBR
Diffstat (limited to 'src/cryptonote_core/tx_pool.h')
-rw-r--r--src/cryptonote_core/tx_pool.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cryptonote_core/tx_pool.h b/src/cryptonote_core/tx_pool.h
index 26d273aa7..649af41a3 100644
--- a/src/cryptonote_core/tx_pool.h
+++ b/src/cryptonote_core/tx_pool.h
@@ -13,6 +13,7 @@
#include "string_tools.h"
#include "syncobj.h"
+#include "math_helper.h"
#include "cryptonote_basic_impl.h"
#include "verification_context.h"
#include "crypto/hash.h"
@@ -40,6 +41,7 @@ namespace cryptonote
bool on_blockchain_inc(uint64_t new_block_height, const crypto::hash& top_block_id);
bool on_blockchain_dec(uint64_t new_block_height, const crypto::hash& top_block_id);
+ void on_idle();
void lock();
void unlock();
@@ -59,7 +61,7 @@ namespace cryptonote
/*bool flush_pool(const std::strig& folder);
bool inflate_pool(const std::strig& folder);*/
-#define CURRENT_MEMPOOL_ARCHIVE_VER 7
+#define CURRENT_MEMPOOL_ARCHIVE_VER 8
template<class archive_t>
void serialize(archive_t & a, const unsigned int version)
@@ -82,9 +84,11 @@ namespace cryptonote
//
uint64_t last_failed_height;
crypto::hash last_failed_id;
+ time_t receive_time;
};
private:
+ bool remove_stuck_transactions();
bool is_transaction_ready_to_go(tx_details& txd);
typedef std::unordered_map<crypto::hash, tx_details > transactions_container;
typedef std::unordered_map<crypto::key_image, std::unordered_set<crypto::hash> > key_images_container;
@@ -92,6 +96,7 @@ namespace cryptonote
epee::critical_section m_transactions_lock;
transactions_container m_transactions;
key_images_container m_spent_key_images;
+ epee::math_helper::once_a_time_seconds<30> m_remove_stuck_tx_interval;
//transactions_container m_alternative_transactions;
@@ -159,6 +164,7 @@ namespace boost
ar & td.max_used_block_id;
ar & td.last_failed_height;
ar & td.last_failed_id;
+ ar & td.receive_time;
}
}