|
|
|
@ -2742,7 +2742,7 @@ void wallet2::process_pool_info_extent(const cryptonote::COMMAND_RPC_GET_BLOCKS_
|
|
|
|
|
update_pool_state_from_pool_data(res.pool_info_extent == COMMAND_RPC_GET_BLOCKS_FAST::INCREMENTAL, res.removed_pool_txids, added_pool_txs, process_txs, refreshed);
|
|
|
|
|
}
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
|
void wallet2::pull_blocks(bool first, bool try_incremental, uint64_t start_height, uint64_t &blocks_start_height, const std::list<crypto::hash> &short_chain_history, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> &o_indices, uint64_t ¤t_height)
|
|
|
|
|
void wallet2::pull_blocks(bool first, bool try_incremental, uint64_t start_height, uint64_t &blocks_start_height, const std::list<crypto::hash> &short_chain_history, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> &o_indices, uint64_t ¤t_height, std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>>& process_pool_txs)
|
|
|
|
|
{
|
|
|
|
|
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::request req = AUTO_VAL_INIT(req);
|
|
|
|
|
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response res = AUTO_VAL_INIT(res);
|
|
|
|
@ -2786,14 +2786,14 @@ void wallet2::pull_blocks(bool first, bool try_incremental, uint64_t start_heigh
|
|
|
|
|
{
|
|
|
|
|
if (res.pool_info_extent != COMMAND_RPC_GET_BLOCKS_FAST::NONE)
|
|
|
|
|
{
|
|
|
|
|
process_pool_info_extent(res, m_process_pool_txs, true);
|
|
|
|
|
process_pool_info_extent(res, process_pool_txs, true);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// If we did not get any pool info, neither incremental nor the whole pool, we probably talk
|
|
|
|
|
// to a daemon that does not yet support giving back pool info with the 'getblocks' call,
|
|
|
|
|
// and we have to update in the "old way"
|
|
|
|
|
update_pool_state_by_pool_query(m_process_pool_txs, true);
|
|
|
|
|
update_pool_state_by_pool_query(process_pool_txs, true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3051,7 +3051,7 @@ void check_block_hard_fork_version(cryptonote::network_type nettype, uint8_t hf_
|
|
|
|
|
daemon_is_outdated = height < start_height || height >= end_height;
|
|
|
|
|
}
|
|
|
|
|
//----------------------------------------------------------------------------------------------------
|
|
|
|
|
void wallet2::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 wallet2::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, std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>>& process_pool_txs, bool &last, bool &error, std::exception_ptr &exception)
|
|
|
|
|
{
|
|
|
|
|
error = false;
|
|
|
|
|
last = false;
|
|
|
|
@ -3073,7 +3073,7 @@ void wallet2::pull_and_parse_next_blocks(bool first, bool try_incremental, uint6
|
|
|
|
|
// pull the new blocks
|
|
|
|
|
std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> o_indices;
|
|
|
|
|
uint64_t current_height;
|
|
|
|
|
pull_blocks(first, try_incremental, start_height, blocks_start_height, short_chain_history, blocks, o_indices, current_height);
|
|
|
|
|
pull_blocks(first, try_incremental, start_height, blocks_start_height, short_chain_history, blocks, o_indices, current_height, process_pool_txs);
|
|
|
|
|
THROW_WALLET_EXCEPTION_IF(blocks.size() != o_indices.size(), error::wallet_internal_error, "Mismatched sizes of blocks and o_indices");
|
|
|
|
|
|
|
|
|
|
tools::threadpool& tpool = tools::threadpool::getInstanceForCompute();
|
|
|
|
@ -3711,7 +3711,7 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
|
|
|
|
|
|
|
|
|
|
auto scope_exit_handler_hwdev = epee::misc_utils::create_scope_leave_handler([&](){hwdev.computing_key_images(false);});
|
|
|
|
|
|
|
|
|
|
m_process_pool_txs.clear();
|
|
|
|
|
std::vector<std::tuple<cryptonote::transaction, crypto::hash, bool>> process_pool_txs;
|
|
|
|
|
// Getting and processing the pool state has moved down into method 'pull_blocks' to
|
|
|
|
|
// allow for "conventional" as well as "incremental" update. However the following
|
|
|
|
|
// principle of getting all info first (pool AND blocks) and only process txs afterwards
|
|
|
|
@ -3743,7 +3743,7 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (!last)
|
|
|
|
|
tpool.submit(&waiter, [&]{pull_and_parse_next_blocks(first, try_incremental, start_height, next_blocks_start_height, short_chain_history, blocks, parsed_blocks, next_blocks, next_parsed_blocks, last, error, exception);});
|
|
|
|
|
tpool.submit(&waiter, [&]{pull_and_parse_next_blocks(first, try_incremental, start_height, next_blocks_start_height, short_chain_history, blocks, parsed_blocks, next_blocks, next_parsed_blocks, process_pool_txs, last, error, exception);});
|
|
|
|
|
|
|
|
|
|
if (!first)
|
|
|
|
|
{
|
|
|
|
@ -3862,8 +3862,8 @@ void wallet2::refresh(bool trusted_daemon, uint64_t start_height, uint64_t & blo
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
// If stop() is called we don't need to check pending transactions
|
|
|
|
|
if (check_pool && m_run.load(std::memory_order_relaxed) && !m_process_pool_txs.empty())
|
|
|
|
|
process_pool_state(m_process_pool_txs);
|
|
|
|
|
if (check_pool && m_run.load(std::memory_order_relaxed) && !process_pool_txs.empty())
|
|
|
|
|
process_pool_state(process_pool_txs);
|
|
|
|
|
}
|
|
|
|
|
catch (...)
|
|
|
|
|
{
|
|
|
|
|