mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-26 21:03:28 +01:00
Merge pull request #5865
11f13da
blockchain: fix logging bad number of blocks if first one fails (moneromooo-monero)19bfe7e
simplewallet: fix warnings about useless std::move (moneromooo-monero)
This commit is contained in:
commit
4a39e1a4a5
@ -616,7 +616,7 @@ bool Blockchain::deinit()
|
|||||||
// It starts a batch and calls private method pop_block_from_blockchain().
|
// It starts a batch and calls private method pop_block_from_blockchain().
|
||||||
void Blockchain::pop_blocks(uint64_t nblocks)
|
void Blockchain::pop_blocks(uint64_t nblocks)
|
||||||
{
|
{
|
||||||
uint64_t i;
|
uint64_t i = 0;
|
||||||
CRITICAL_REGION_LOCAL(m_tx_pool);
|
CRITICAL_REGION_LOCAL(m_tx_pool);
|
||||||
CRITICAL_REGION_LOCAL1(m_blockchain_lock);
|
CRITICAL_REGION_LOCAL1(m_blockchain_lock);
|
||||||
|
|
||||||
@ -627,9 +627,10 @@ void Blockchain::pop_blocks(uint64_t nblocks)
|
|||||||
const uint64_t blockchain_height = m_db->height();
|
const uint64_t blockchain_height = m_db->height();
|
||||||
if (blockchain_height > 0)
|
if (blockchain_height > 0)
|
||||||
nblocks = std::min(nblocks, blockchain_height - 1);
|
nblocks = std::min(nblocks, blockchain_height - 1);
|
||||||
for (i=0; i < nblocks; ++i)
|
while (i < nblocks)
|
||||||
{
|
{
|
||||||
pop_block_from_blockchain();
|
pop_block_from_blockchain();
|
||||||
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
|
@ -4461,7 +4461,7 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
|||||||
}
|
}
|
||||||
success_msg_writer() << "**********************************************************************";
|
success_msg_writer() << "**********************************************************************";
|
||||||
|
|
||||||
return std::move(password);
|
return password;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
||||||
@ -4510,7 +4510,7 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return std::move(password);
|
return password;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -4553,7 +4553,7 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::move(password);
|
return password;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::program_options::variables_map& vm,
|
||||||
@ -4608,7 +4608,7 @@ boost::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::pr
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::move(password);
|
return password;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
boost::optional<epee::wipeable_string> simple_wallet::open_wallet(const boost::program_options::variables_map& vm)
|
boost::optional<epee::wipeable_string> simple_wallet::open_wallet(const boost::program_options::variables_map& vm)
|
||||||
@ -4711,7 +4711,7 @@ boost::optional<epee::wipeable_string> simple_wallet::open_wallet(const boost::p
|
|||||||
tr("Use the \"help\" command to see the list of available commands.\n") <<
|
tr("Use the \"help\" command to see the list of available commands.\n") <<
|
||||||
tr("Use \"help <command>\" to see a command's documentation.\n") <<
|
tr("Use \"help <command>\" to see a command's documentation.\n") <<
|
||||||
"**********************************************************************";
|
"**********************************************************************";
|
||||||
return std::move(password);
|
return password;
|
||||||
}
|
}
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
bool simple_wallet::close_wallet()
|
bool simple_wallet::close_wallet()
|
||||||
|
Loading…
Reference in New Issue
Block a user