mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 09:24:47 +00:00
wallet2: remove obsolete pruned/unpruned case
All daemons will not support pruned blocks
This commit is contained in:
parent
0dddfeacc9
commit
ac09cfa6be
1 changed files with 1 additions and 28 deletions
|
@ -1753,34 +1753,7 @@ void wallet2::pull_blocks(uint64_t start_height, uint64_t &blocks_start_height,
|
||||||
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response res = AUTO_VAL_INIT(res);
|
cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::response res = AUTO_VAL_INIT(res);
|
||||||
req.block_ids = short_chain_history;
|
req.block_ids = short_chain_history;
|
||||||
|
|
||||||
uint32_t rpc_version;
|
req.prune = true;
|
||||||
boost::optional<std::string> result = m_node_rpc_proxy.get_rpc_version(rpc_version);
|
|
||||||
// no error
|
|
||||||
if (!!result)
|
|
||||||
{
|
|
||||||
// empty string -> not connection
|
|
||||||
THROW_WALLET_EXCEPTION_IF(result->empty(), tools::error::no_connection_to_daemon, "getversion");
|
|
||||||
THROW_WALLET_EXCEPTION_IF(*result == CORE_RPC_STATUS_BUSY, tools::error::daemon_busy, "getversion");
|
|
||||||
if (*result != CORE_RPC_STATUS_OK)
|
|
||||||
{
|
|
||||||
MDEBUG("Cannot determine daemon RPC version, not asking for pruned blocks");
|
|
||||||
req.prune = false; // old daemon
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (rpc_version >= MAKE_CORE_RPC_VERSION(1, 7))
|
|
||||||
{
|
|
||||||
MDEBUG("Daemon is recent enough, asking for pruned blocks");
|
|
||||||
req.prune = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MDEBUG("Daemon is too old, not asking for pruned blocks");
|
|
||||||
req.prune = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
req.start_height = start_height;
|
req.start_height = start_height;
|
||||||
req.no_miner_tx = m_refresh_type == RefreshNoCoinbase;
|
req.no_miner_tx = m_refresh_type == RefreshNoCoinbase;
|
||||||
m_daemon_rpc_mutex.lock();
|
m_daemon_rpc_mutex.lock();
|
||||||
|
|
Loading…
Reference in a new issue