@@ -2132,6 +2132,8 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
21322132
21332133 // Address refresh broadcast
21342134 int64_t nNow = GetTimeMicros ();
2135+ auto current_time = GetTime<std::chrono::microseconds>();
2136+
21352137 if (!IsInitialBlockDownload () && pto->nNextLocalAddrSend < nNow) {
21362138 AdvertiseLocal (pto);
21372139 pto->nNextLocalAddrSend = PoissonNextSend (nNow, AVG_LOCAL_ADDRESS_BROADCAST_INTERVAL);
@@ -2214,10 +2216,10 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
22142216
22152217 // Check whether periodic send should happen
22162218 bool fSendTrickle = pto->fWhitelisted ;
2217- if (pto->nNextInvSend < nNow ) {
2219+ if (pto->nNextInvSend < current_time ) {
22182220 fSendTrickle = true ;
22192221 // Use half the delay for outbound peers, as there is less privacy concern for them.
2220- pto->nNextInvSend = PoissonNextSend (nNow, INVENTORY_BROADCAST_INTERVAL >> !pto->fInbound );
2222+ pto->nNextInvSend = PoissonNextSend (current_time, std::chrono::seconds{ INVENTORY_BROADCAST_INTERVAL >> !pto->fInbound } );
22212223 }
22222224
22232225 // Time to send but the peer has requested we not relay transactions.
@@ -2301,6 +2303,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
23012303 connman->PushMessage (pto, msgMaker.Make (NetMsgType::INV, vInv));
23022304
23032305 // Detect whether we're stalling
2306+ current_time = GetTime<std::chrono::microseconds>();
23042307 nNow = GetTimeMicros ();
23052308 if (state.nStallingSince && state.nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT) {
23062309 // Stalling only triggers when the block download window cannot move. During normal steady state,
0 commit comments