MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetOldestKeyTimeInPool

Function GetOldestKeyTimeInPool

src/wallet/scriptpubkeyman.cpp:540–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

538}
539
540static int64_t GetOldestKeyTimeInPool(const std::set<int64_t>& setKeyPool, WalletBatch& batch) {
541 if (setKeyPool.empty()) {
542 return GetTime();
543 }
544
545 CKeyPool keypool;
546 int64_t nIndex = *(setKeyPool.begin());
547 if (!batch.ReadPool(nIndex, keypool)) {
548 throw std::runtime_error(std::string(__func__) + ": read oldest key in keypool failed");
549 }
550 assert(keypool.vchPubKey.IsValid());
551 return keypool.nTime;
552}
553
554std::optional<int64_t> LegacyScriptPubKeyMan::GetOldestKeyPoolTime() const
555{

Callers 1

GetOldestKeyPoolTimeMethod · 0.85

Calls 5

GetTimeFunction · 0.85
ReadPoolMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected