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:
Hennadii Stepanov
2021-10-30 22:19:22 +03:00
parent 7efc628539
commit 3e4f069d23
5 changed files with 15 additions and 15 deletions

View File

@@ -19,6 +19,7 @@
#include <boost/signals2/signal.hpp>
#include <optional>
#include <unordered_map>
enum class OutputType;
@@ -203,7 +204,7 @@ public:
//! The action to do when the DB needs rewrite
virtual void RewriteDB() {}
virtual int64_t GetOldestKeyPoolTime() const { return GetTime(); }
virtual std::optional<int64_t> GetOldestKeyPoolTime() const { return GetTime(); }
virtual unsigned int GetKeyPoolSize() const { return 0; }
@@ -371,7 +372,7 @@ public:
void RewriteDB() override;
int64_t GetOldestKeyPoolTime() const override;
std::optional<int64_t> GetOldestKeyPoolTime() const override;
size_t KeypoolCountExternalKeys() const;
unsigned int GetKeyPoolSize() const override;
@@ -577,7 +578,7 @@ public:
bool HavePrivateKeys() const override;
int64_t GetOldestKeyPoolTime() const override;
std::optional<int64_t> GetOldestKeyPoolTime() const override;
unsigned int GetKeyPoolSize() const override;
int64_t GetTimeFirstKey() const override;