core, wallet: faster tx pool scanning

Includes a new RPC to get tx pool hashes fast.
This commit is contained in:
moneromooo-monero 2017-03-22 18:03:23 +00:00
parent f065234b71
commit 558cfc31ca
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
8 changed files with 166 additions and 104 deletions

View file

@ -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
{