mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
fix: use std::chrono::seconds
This commit is contained in:
parent
d6fe7146ff
commit
d41d87a5be
@ -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) {
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user