|
|
|
@ -3761,14 +3761,14 @@ void CWallet::ListLockedCoins(std::vector<COutPoint>& vOutpts) const
|
|
|
|
|
|
|
|
|
|
/** @} */ // end of Actions
|
|
|
|
|
|
|
|
|
|
void CWallet::GetKeyBirthTimes(interfaces::Chain::Lock& locked_chain, std::map<CTxDestination, int64_t>& mapKeyBirth) const {
|
|
|
|
|
void CWallet::GetKeyBirthTimes(interfaces::Chain::Lock& locked_chain, std::map<CKeyID, int64_t>& mapKeyBirth) const {
|
|
|
|
|
AssertLockHeld(cs_wallet);
|
|
|
|
|
mapKeyBirth.clear();
|
|
|
|
|
|
|
|
|
|
// get birth times for keys with metadata
|
|
|
|
|
for (const auto& entry : mapKeyMetadata) {
|
|
|
|
|
if (entry.second.nCreateTime) {
|
|
|
|
|
mapKeyBirth[PKHash(entry.first)] = entry.second.nCreateTime;
|
|
|
|
|
mapKeyBirth[entry.first] = entry.second.nCreateTime;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3777,7 +3777,7 @@ void CWallet::GetKeyBirthTimes(interfaces::Chain::Lock& locked_chain, std::map<C
|
|
|
|
|
const int max_height = tip_height && *tip_height > 144 ? *tip_height - 144 : 0; // the tip can be reorganized; use a 144-block safety margin
|
|
|
|
|
std::map<CKeyID, int> mapKeyFirstBlock;
|
|
|
|
|
for (const CKeyID &keyid : GetKeys()) {
|
|
|
|
|
if (mapKeyBirth.count(PKHash(keyid)) == 0)
|
|
|
|
|
if (mapKeyBirth.count(keyid) == 0)
|
|
|
|
|
mapKeyFirstBlock[keyid] = max_height;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3805,7 +3805,7 @@ void CWallet::GetKeyBirthTimes(interfaces::Chain::Lock& locked_chain, std::map<C
|
|
|
|
|
|
|
|
|
|
// Extract block timestamps for those keys
|
|
|
|
|
for (const auto& entry : mapKeyFirstBlock)
|
|
|
|
|
mapKeyBirth[PKHash(entry.first)] = locked_chain.getBlockTime(entry.second) - TIMESTAMP_WINDOW; // block times can be 2h off
|
|
|
|
|
mapKeyBirth[entry.first] = locked_chain.getBlockTime(entry.second) - TIMESTAMP_WINDOW; // block times can be 2h off
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|