| 3769 | } |
| 3770 | #if 1 |
| 3771 | static int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, CWalletDB& walletdb) { |
| 3772 | |
| 3773 | if (setKeyPool.empty()) { |
| 3774 | return GetTime(); |
| 3775 | } |
| 3776 | |
| 3777 | CKeyPool keypool; |
| 3778 | int64_t nIndex = *(setKeyPool.begin()); |
| 3779 | if (!walletdb.ReadPool(nIndex, keypool)) { |
| 3780 | throw std::runtime_error(std::string(__func__) + ": read oldest key in keypool failed"); |
| 3781 | } |
| 3782 | if (!keypool.vchPubKey.IsValid()) { |
| 3783 | LogPrintf("%s: vchPubKey is invalid\n",__func__); |
| 3784 | return GetTime(); |
| 3785 | } |
| 3786 | return keypool.nTime; |
| 3787 | } |
| 3788 | #endif |
| 3789 | int64_t CWallet::GetOldestKeyPoolTime() |
| 3790 | { |