mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-08 09:21:06 +02:00
wallet, refactor: Make GetOldestKeyPoolTime return type std::optional
This change gets rid of the magic number 0 in the DescriptorScriptPubKeyMan::GetOldestKeyPoolTime() function. No behavior change.
This commit is contained in:
@ -2169,14 +2169,14 @@ bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& des
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t CWallet::GetOldestKeyPoolTime() const
|
||||
std::optional<int64_t> CWallet::GetOldestKeyPoolTime() const
|
||||
{
|
||||
LOCK(cs_wallet);
|
||||
int64_t oldestKey = std::numeric_limits<int64_t>::max();
|
||||
std::optional<int64_t> oldest_key{std::numeric_limits<int64_t>::max()};
|
||||
for (const auto& spk_man_pair : m_spk_managers) {
|
||||
oldestKey = std::min(oldestKey, spk_man_pair.second->GetOldestKeyPoolTime());
|
||||
oldest_key = std::min(oldest_key, spk_man_pair.second->GetOldestKeyPoolTime());
|
||||
}
|
||||
return oldestKey;
|
||||
return oldest_key;
|
||||
}
|
||||
|
||||
void CWallet::MarkDestinationsDirty(const std::set<CTxDestination>& destinations) {
|
||||
|
Reference in New Issue
Block a user