@@ -40,9 +40,9 @@ static constexpr int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
40
40
/* * Minimum time between orphan transactions expire time checks in seconds */
41
41
static constexpr int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60 ;
42
42
/* * How long to cache transactions in mapRelay for normal relay */
43
- static constexpr std::chrono::seconds RELAY_TX_CACHE_TIME = std::chrono::minutes{ 15 } ;
43
+ static constexpr auto RELAY_TX_CACHE_TIME = 15min ;
44
44
/* * How long a transaction has to be in the mempool before it can unconditionally be relayed (even when not in mapRelay). */
45
- static constexpr std::chrono::seconds UNCONDITIONAL_RELAY_DELAY = std::chrono::minutes{ 2 } ;
45
+ static constexpr auto UNCONDITIONAL_RELAY_DELAY = 2min ;
46
46
/* * Headers download timeout.
47
47
* Timeout = base + per_header * (expected number of headers) */
48
48
static constexpr auto HEADERS_DOWNLOAD_TIMEOUT_BASE = 15min;
@@ -467,7 +467,7 @@ class PeerManagerImpl final : public PeerManager
467
467
typedef std::map<uint256, CTransactionRef> MapRelay;
468
468
MapRelay mapRelay GUARDED_BY (cs_main);
469
469
/* * Expiration-time ordered list of (expire time, relay map entry) pairs. */
470
- std::deque<std::pair<int64_t , MapRelay::iterator>> vRelayExpiration GUARDED_BY (cs_main);
470
+ std::deque<std::pair<std::chrono::microseconds , MapRelay::iterator>> g_relay_expiration GUARDED_BY (cs_main);
471
471
472
472
/* *
473
473
* When a peer sends us a valid block, instruct it to announce blocks to us
@@ -4763,20 +4763,20 @@ bool PeerManagerImpl::SendMessages(CNode* pto)
4763
4763
nRelayedTransactions++;
4764
4764
{
4765
4765
// Expire old relay messages
4766
- while (!vRelayExpiration .empty () && vRelayExpiration .front ().first < count_microseconds ( current_time) )
4766
+ while (!g_relay_expiration .empty () && g_relay_expiration .front ().first < current_time)
4767
4767
{
4768
- mapRelay.erase (vRelayExpiration .front ().second );
4769
- vRelayExpiration .pop_front ();
4768
+ mapRelay.erase (g_relay_expiration .front ().second );
4769
+ g_relay_expiration .pop_front ();
4770
4770
}
4771
4771
4772
4772
auto ret = mapRelay.emplace (txid, std::move (txinfo.tx ));
4773
4773
if (ret.second ) {
4774
- vRelayExpiration .emplace_back (count_microseconds ( current_time + std::chrono::microseconds{ RELAY_TX_CACHE_TIME}) , ret.first );
4774
+ g_relay_expiration .emplace_back (current_time + RELAY_TX_CACHE_TIME, ret.first );
4775
4775
}
4776
4776
// Add wtxid-based lookup into mapRelay as well, so that peers can request by wtxid
4777
4777
auto ret2 = mapRelay.emplace (wtxid, ret.first ->second );
4778
4778
if (ret2.second ) {
4779
- vRelayExpiration .emplace_back (count_microseconds ( current_time + std::chrono::microseconds{ RELAY_TX_CACHE_TIME}) , ret2.first );
4779
+ g_relay_expiration .emplace_back (current_time + RELAY_TX_CACHE_TIME, ret2.first );
4780
4780
}
4781
4781
}
4782
4782
if (vInv.size () == MAX_INV_SZ) {
0 commit comments