mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-15 04:30:42 +02:00
wallet: Make GetOldestKeyPoolTime return nullopt for blank wallets
This change suppress the "keypoololdest" field in the getwalletinfo RPC response for blank descriptor wallets.
This commit is contained in:
parent
3e4f069d23
commit
ee03c782ba
@ -2172,6 +2172,10 @@ bool CWallet::GetNewChangeDestination(const OutputType type, CTxDestination& des
|
|||||||
std::optional<int64_t> CWallet::GetOldestKeyPoolTime() const
|
std::optional<int64_t> CWallet::GetOldestKeyPoolTime() const
|
||||||
{
|
{
|
||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
|
if (m_spk_managers.empty()) {
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
std::optional<int64_t> oldest_key{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) {
|
for (const auto& spk_man_pair : m_spk_managers) {
|
||||||
oldest_key = std::min(oldest_key, spk_man_pair.second->GetOldestKeyPoolTime());
|
oldest_key = std::min(oldest_key, spk_man_pair.second->GetOldestKeyPoolTime());
|
||||||
|
Loading…
Reference in New Issue
Block a user