net: improve nLastBlockTime and nLastTXTime documentation
Co-authored-by: John Newbery <john@johnnewbery.com>
This commit is contained in:
2 files changed
+12
-3
No files matched your search
+2
-2
@@ -904,10 +904,10 @@ bool CConnman::AttemptToEvictConnection()
|
|||||||
// Protect the 8 nodes with the lowest minimum ping time.
|
// Protect the 8 nodes with the lowest minimum ping time.
|
||||||
// An attacker cannot manipulate this metric without physically moving nodes closer to the target.
|
// An attacker cannot manipulate this metric without physically moving nodes closer to the target.
|
||||||
EraseLastKElements(vEvictionCandidates, ReverseCompareNodeMinPingTime, 8);
|
EraseLastKElements(vEvictionCandidates, ReverseCompareNodeMinPingTime, 8);
|
||||||
// Protect 4 nodes that most recently sent us transactions.
|
// Protect 4 nodes that most recently sent us novel transactions accepted into our mempool.
|
||||||
// An attacker cannot manipulate this metric without performing useful work.
|
// An attacker cannot manipulate this metric without performing useful work.
|
||||||
EraseLastKElements(vEvictionCandidates, CompareNodeTXTime, 4);
|
EraseLastKElements(vEvictionCandidates, CompareNodeTXTime, 4);
|
||||||
// Protect 4 nodes that most recently sent us blocks.
|
// Protect 4 nodes that most recently sent us novel blocks.
|
||||||
// An attacker cannot manipulate this metric without performing useful work.
|
// An attacker cannot manipulate this metric without performing useful work.
|
||||||
EraseLastKElements(vEvictionCandidates, CompareNodeBlockTime, 4);
|
EraseLastKElements(vEvictionCandidates, CompareNodeBlockTime, 4);
|
||||||
// Protect the half of the remaining nodes which have been connected the longest.
|
// Protect the half of the remaining nodes which have been connected the longest.
|
||||||
|
|||||||
@@ -932,8 +932,17 @@ public:
|
|||||||
// Used for headers announcements - unfiltered blocks to relay
|
// Used for headers announcements - unfiltered blocks to relay
|
||||||
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);
|
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);
|
||||||
|
|
||||||
// Block and TXN accept times
|
/** UNIX epoch time of the last block received from this peer that we had
|
||||||
|
* not yet seen (e.g. not already received from another peer), that passed
|
||||||
|
* preliminary validity checks and was saved to disk, even if we don't
|
||||||
|
* connect the block or it eventually fails connection. Used as an inbound
|
||||||
|
* peer eviction criterium in CConnman::AttemptToEvictConnection. */
|
||||||
std::atomic<int64_t> nLastBlockTime{0};
|
std::atomic<int64_t> nLastBlockTime{0};
|
||||||
|
|
||||||
|
/** UNIX epoch time of the last transaction received from this peer that we
|
||||||
|
* had not yet seen (e.g. not already received from another peer) and that
|
||||||
|
* was accepted into our mempool. Used as an inbound peer eviction criterium
|
||||||
|
* in CConnman::AttemptToEvictConnection. */
|
||||||
std::atomic<int64_t> nLastTXTime{0};
|
std::atomic<int64_t> nLastTXTime{0};
|
||||||
|
|
||||||
// Ping time measurement:
|
// Ping time measurement:
|
||||||
|
|||||||
Reference in new issue
Block a user