Skip to content

Commit

Permalink
fix: use std::chrono::seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Aug 12, 2024
1 parent 9450b66 commit 057aff3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ void CGovernanceManager::CheckAndRemove()
// forget about expired requests
auto r_it = m_requested_hash_time.begin();
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++);
} else {
++r_it;
Expand Down Expand Up @@ -847,7 +847,7 @@ bool CGovernanceManager::ConfirmInventoryRequest(const CInv& inv)
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);

if (inserted) {
Expand Down
2 changes: 1 addition & 1 deletion src/governance/governance.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ class CGovernanceManager : public GovernanceStore
int nCachedBlockHeight;
std::map<uint256, CGovernanceObject> mapPostponedObjects;
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;
std::optional<uint256> votedFundingYesTriggerHash;
std::map<uint256, std::shared_ptr<CSuperblock>> mapTrigger;
Expand Down

0 comments on commit 057aff3

Please sign in to comment.