diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-21 00:26:48 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-11-21 00:56:21 +0000 |
commit | 932994c0cb25d21ccc5795c23b0e342427260625 (patch) | |
tree | 70c92777fc82a486b459d89dac53bdfd4bbbc377 /tests | |
parent | Merge pull request #490 (diff) | |
download | monero-932994c0cb25d21ccc5795c23b0e342427260625.tar.xz |
Relay transactions when they linger too long in the pool
The last relayed time of a transaction is maintained, and
transactions will be relayed again if they are still in the
pool after a certain amount of time, which increases with
the transaction's age. All such transactions are resent,
whether or not they originated on the local node.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/core_proxy/core_proxy.cpp | 2 | ||||
-rw-r--r-- | tests/core_proxy/core_proxy.h | 2 | ||||
-rw-r--r-- | tests/core_tests/chaingen.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/tests/core_proxy/core_proxy.cpp b/tests/core_proxy/core_proxy.cpp index b942ed5c5..5c851d774 100644 --- a/tests/core_proxy/core_proxy.cpp +++ b/tests/core_proxy/core_proxy.cpp @@ -167,7 +167,7 @@ string tx2str(const cryptonote::transaction& tx, const cryptonote::hash256& tx_h return ss.str(); }*/ -bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block) { +bool tests::proxy_core::handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relayed) { if (!keeped_by_block) return true; diff --git a/tests/core_proxy/core_proxy.h b/tests/core_proxy/core_proxy.h index 6b131e9eb..54025bbf5 100644 --- a/tests/core_proxy/core_proxy.h +++ b/tests/core_proxy/core_proxy.h @@ -75,7 +75,7 @@ namespace tests bool get_stat_info(cryptonote::core_stat_info& st_inf){return true;} bool have_block(const crypto::hash& id); bool get_blockchain_top(uint64_t& height, crypto::hash& top_id); - bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block); + bool handle_incoming_tx(const cryptonote::blobdata& tx_blob, cryptonote::tx_verification_context& tvc, bool keeped_by_block, bool relaued); bool handle_incoming_block(const cryptonote::blobdata& block_blob, cryptonote::block_verification_context& bvc, bool update_miner_blocktemplate = true); void pause_mine(){} void resume_mine(){} diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h index d187f36ca..0c33b942e 100644 --- a/tests/core_tests/chaingen.h +++ b/tests/core_tests/chaingen.h @@ -364,7 +364,7 @@ public: cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); size_t pool_size = m_c.get_pool_transactions_count(); - m_c.handle_incoming_tx(t_serializable_object_to_blob(tx), tvc, m_txs_keeped_by_block); + m_c.handle_incoming_tx(t_serializable_object_to_blob(tx), tvc, m_txs_keeped_by_block, false); bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count(); bool r = check_tx_verification_context(tvc, tx_added, m_ev_index, tx, m_validator); CHECK_AND_NO_ASSERT_MES(r, false, "tx verification context check failed"); @@ -421,7 +421,7 @@ public: cryptonote::tx_verification_context tvc = AUTO_VAL_INIT(tvc); size_t pool_size = m_c.get_pool_transactions_count(); - m_c.handle_incoming_tx(sr_tx.data, tvc, m_txs_keeped_by_block); + m_c.handle_incoming_tx(sr_tx.data, tvc, m_txs_keeped_by_block, false); bool tx_added = pool_size + 1 == m_c.get_pool_transactions_count(); cryptonote::transaction tx; |