diff options
| author | selsta <selsta@sent.at> | 2026-05-21 21:35:57 +0200 |
|---|---|---|
| committer | selsta <selsta@sent.at> | 2026-06-28 13:55:46 +0200 |
| commit | 839dba22c3a39eec92d2c6be7972df6dc6d57bab (patch) | |
| tree | 359c521d00df7123449a6e64b1fb16dc31ef2dbe /src/wallet/wallet2.h | |
| parent | 71d2d3728ea3454c02e7de851abda54b87915a6a (diff) | |
| download | monzero-core-839dba22c3a39eec92d2c6be7972df6dc6d57bab.tar.gz monzero-core-839dba22c3a39eec92d2c6be7972df6dc6d57bab.tar.xz monzero-core-839dba22c3a39eec92d2c6be7972df6dc6d57bab.zip | |
wallet2: avoid linear scans in pool state updates
Diffstat (limited to 'src/wallet/wallet2.h')
| -rw-r--r-- | src/wallet/wallet2.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index 074755002..b18e9d8c6 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -31,6 +31,7 @@ #pragma once #include <memory> +#include <unordered_set> #include <boost/program_options/options_description.hpp> #include <boost/program_options/variables_map.hpp> @@ -1649,6 +1650,7 @@ private: void update_pool_state(std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &process_txs, bool refreshed = false, bool try_incremental = false); void process_pool_state(const std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &txs); void remove_obsolete_pool_txs(const std::vector<crypto::hash> &tx_hashes, bool remove_if_found); + void remove_obsolete_pool_txs(const std::unordered_set<crypto::hash> &tx_hashes, bool remove_if_found); std::string encrypt(const char *plaintext, size_t len, const crypto::secret_key &skey, bool authenticated = true) const; std::string encrypt(const epee::span<char> &span, const crypto::secret_key &skey, bool authenticated = true) const; @@ -1869,7 +1871,7 @@ private: void fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history, bool force = false); void pull_and_parse_next_blocks(bool first, bool try_incremental, uint64_t start_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history, const std::vector<cryptonote::block_complete_entry> &prev_blocks, const std::vector<parsed_block> &prev_parsed_blocks, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<parsed_block> &parsed_blocks, bool &last, bool &error, std::exception_ptr &exception); void process_parsed_blocks(uint64_t start_height, const std::vector<cryptonote::block_complete_entry> &blocks, const std::vector<parsed_block> &parsed_blocks, uint64_t& blocks_added, std::map<std::pair<uint64_t, uint64_t>, size_t> *output_tracker_cache = NULL); - bool accept_pool_tx_for_processing(const crypto::hash &txid); + bool accept_pool_tx_for_processing(const crypto::hash &txid, const std::unordered_set<crypto::hash> &payments_tx_hashes); void process_unconfirmed_transfer(bool incremental, const crypto::hash &txid, wallet2::unconfirmed_transfer_details &tx_details, bool seen_in_pool, std::chrono::system_clock::time_point now, bool refreshed); void process_pool_info_extent(const cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response &res, std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &process_txs, bool refreshed); void update_pool_state_by_pool_query(std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> &process_txs, bool refreshed = false); |
