Skip to content

Commit c2a4724

Browse files
committed
Optimization: use usec in expiration and reuse nNow
1 parent e9b4780 commit c2a4724

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5975,15 +5975,15 @@ bool SendMessages(CNode* pto)
59755975
nRelayedTransactions++;
59765976
{
59775977
// Expire old relay messages
5978-
while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime())
5978+
while (!vRelayExpiration.empty() && vRelayExpiration.front().first < nNow)
59795979
{
59805980
mapRelay.erase(vRelayExpiration.front().second);
59815981
vRelayExpiration.pop_front();
59825982
}
59835983

59845984
auto ret = mapRelay.insert(std::make_pair(hash, std::move(txinfo.tx)));
59855985
if (ret.second) {
5986-
vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, ret.first));
5986+
vRelayExpiration.push_back(std::make_pair(nNow + 15 * 60 * 1000000, ret.first));
59875987
}
59885988
}
59895989
if (vInv.size() == MAX_INV_SZ) {

0 commit comments

Comments
 (0)