diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-22 18:03:23 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-03-23 09:25:22 +0000 |
commit | 558cfc31caeb88398fe5bab9292246739586374d (patch) | |
tree | 4efe29371b0a9dd3d195d01ccff51a9d9b5b2a7b /src/cryptonote_core/tx_pool.cpp | |
parent | core: cache tx and block hashes in the respective classes (diff) | |
download | monero-558cfc31caeb88398fe5bab9292246739586374d.tar.xz |
core, wallet: faster tx pool scanning
Includes a new RPC to get tx pool hashes fast.
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index ea19b6b48..b2a7120cb 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -423,6 +423,13 @@ namespace cryptonote txs.push_back(tx_vt.second.tx); } //------------------------------------------------------------------ + void tx_memory_pool::get_transaction_hashes(std::vector<crypto::hash>& txs) const + { + CRITICAL_REGION_LOCAL(m_transactions_lock); + for(const auto& tx_vt: m_transactions) + txs.push_back(get_transaction_hash(tx_vt.second.tx)); + } + //------------------------------------------------------------------ //TODO: investigate whether boolean return is appropriate bool tx_memory_pool::get_transactions_and_spent_keys_info(std::vector<tx_info>& tx_infos, std::vector<spent_key_image_info>& key_image_infos) const { |