diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-10-30 22:19:22 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-11-03 10:35:47 +0200 |
commit | 3e4f069d23cd2ea5de8fa3c4b1a761ab097ad56f (patch) | |
tree | adb1abecbd5e4f80994e48d8f44e10f767d0e8c7 /src/wallet/wallet.cpp | |
parent | 7efc628539573af4b4a76d93b853cc46e9e52eae (diff) |
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.
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 4eb9d5560d..904154c91d 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -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) { |