fix: use std::chrono::seconds

This commit is contained in:
UdjinM6 2024-08-12 23:32:48 +03:00
parent d6fe7146ff
commit d41d87a5be
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9
2 changed files with 3 additions and 3 deletions

View File

@ -455,7 +455,7 @@ void CGovernanceManager::CheckAndRemove()
// forget about expired requests // forget about expired requests
auto r_it = m_requested_hash_time.begin(); auto r_it = m_requested_hash_time.begin();
while (r_it != m_requested_hash_time.end()) { while (r_it != m_requested_hash_time.end()) {
if (r_it->second < nNow) { if (r_it->second < std::chrono::seconds(nNow)) {
m_requested_hash_time.erase(r_it++); m_requested_hash_time.erase(r_it++);
} else { } else {
++r_it; ++r_it;
@ -847,7 +847,7 @@ bool CGovernanceManager::ConfirmInventoryRequest(const CInv& inv)
return false; return false;
} }
const auto valid_until = GetTime<std::chrono::seconds>().count() + RELIABLE_PROPAGATION_TIME; const auto valid_until = GetTime<std::chrono::seconds>() + std::chrono::seconds(RELIABLE_PROPAGATION_TIME);
const auto& [_itr, inserted] = m_requested_hash_time.emplace(inv.hash, valid_until); const auto& [_itr, inserted] = m_requested_hash_time.emplace(inv.hash, valid_until);
if (inserted) { if (inserted) {

View File

@ -270,7 +270,7 @@ private:
int nCachedBlockHeight; int nCachedBlockHeight;
std::map<uint256, CGovernanceObject> mapPostponedObjects; std::map<uint256, CGovernanceObject> mapPostponedObjects;
hash_s_t setAdditionalRelayObjects; hash_s_t setAdditionalRelayObjects;
std::map<uint256, int64_t> m_requested_hash_time; std::map<uint256, std::chrono::seconds> m_requested_hash_time;
bool fRateChecksEnabled; bool fRateChecksEnabled;
std::optional<uint256> votedFundingYesTriggerHash; std::optional<uint256> votedFundingYesTriggerHash;
std::map<uint256, std::shared_ptr<CSuperblock>> mapTrigger; std::map<uint256, std::shared_ptr<CSuperblock>> mapTrigger;