diff options
| author | Pieter Wuille <[email protected]> | 2016-05-31 20:35:44 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-06-06 02:02:24 +0200 |
| commit | c2a4724642400bc9200aeef4c725b5c07eee9d90 (patch) | |
| tree | 3d128b1410ca27c670fd7c21f9fdd433aac8fd9f /src/main.cpp | |
| parent | Optimization: don't check the mempool at all if no mempool req ever (diff) | |
| download | discoin-c2a4724642400bc9200aeef4c725b5c07eee9d90.tar.xz discoin-c2a4724642400bc9200aeef4c725b5c07eee9d90.zip | |
Optimization: use usec in expiration and reuse nNow
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 68368e402..db0580bda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5975,7 +5975,7 @@ bool SendMessages(CNode* pto) nRelayedTransactions++; { // Expire old relay messages - while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime()) + while (!vRelayExpiration.empty() && vRelayExpiration.front().first < nNow) { mapRelay.erase(vRelayExpiration.front().second); vRelayExpiration.pop_front(); @@ -5983,7 +5983,7 @@ bool SendMessages(CNode* pto) auto ret = mapRelay.insert(std::make_pair(hash, std::move(txinfo.tx))); if (ret.second) { - vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, ret.first)); + vRelayExpiration.push_back(std::make_pair(nNow + 15 * 60 * 1000000, ret.first)); } } if (vInv.size() == MAX_INV_SZ) { |