Skip to content

Commit 405a7b5

Browse files
codablockDuddino
authored andcommitted
More logging for object request handling
1 parent 064c741 commit 405a7b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/net_processing.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ static void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vec
542542
void EraseObjectRequest(CNodeState* nodestate, const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
543543
{
544544
AssertLockHeld(cs_main);
545+
LogPrint(BCLog::NET, "%s -- inv=(%s)\n", __func__, inv.ToString());
545546
g_already_asked_for.erase(inv.hash);
546547
g_erased_object_requests.insert(std::make_pair(inv.hash, GetTimeMillis()));
547548

@@ -642,6 +643,8 @@ void RequestObject(CNodeState* state, const CInv& inv, int64_t nNow) EXCLUSIVE_L
642643
int64_t process_time = CalculateObjectGetDataTime(inv, nNow, !state->fPreferredDownload);
643644

644645
peer_download_state.m_tx_process_time.emplace(process_time, inv);
646+
647+
LogPrint(BCLog::NET, "%s -- inv=(%s), nNow=%d, process_time=%d, delta=%d\n", __func__, inv.ToString(), nNow, process_time, process_time - nNow);
645648
}
646649

647650
void RequestObject(NodeId nodeId, const CInv& inv, int64_t nNow) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
@@ -2842,6 +2845,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
28422845
// processing at a later time, see below)
28432846
tx_process_time.erase(tx_process_time.begin());
28442847
if (g_erased_object_requests.count(inv.hash)) {
2848+
LogPrint(BCLog::NET, "%s -- GETDATA skipping inv=(%s), peer=%d\n", __func__, inv.ToString(), pto->GetId());
28452849
state.m_tx_download.m_tx_announced.erase(inv);
28462850
state.m_tx_download.m_tx_in_flight.erase(inv);
28472851
continue;
@@ -2866,11 +2870,13 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
28662870
// requests to outbound peers).
28672871
int64_t next_process_time = CalculateObjectGetDataTime(inv, nNow, !state.fPreferredDownload);
28682872
tx_process_time.emplace(next_process_time, inv);
2873+
LogPrint(BCLog::NET, "%s -- GETDATA re-queue inv=(%s), next_process_time=%d, delta=%d, peer=%d\n", __func__, inv.ToString(), next_process_time, next_process_time - nNow, pto->GetId());
28692874
}
28702875
} else {
28712876
// We have already seen this transaction, no need to download.
28722877
state.m_tx_download.m_tx_announced.erase(inv);
28732878
state.m_tx_download.m_tx_in_flight.erase(inv);
2879+
LogPrint(BCLog::NET, "%s -- GETDATA already seen inv=(%s), peer=%d\n", __func__, inv.ToString(), pto->GetId());
28742880
}
28752881
}
28762882
if (!vGetData.empty())

0 commit comments

Comments
 (0)