mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Add unit test for stale tip checking
This commit is contained in:
@@ -550,6 +550,15 @@ void FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<con
|
||||
|
||||
} // namespace
|
||||
|
||||
// This function is used for testing the stale tip eviction logic, see
|
||||
// DoS_tests.cpp
|
||||
void UpdateLastBlockAnnounceTime(NodeId node, int64_t time_in_seconds)
|
||||
{
|
||||
LOCK(cs_main);
|
||||
CNodeState *state = State(node);
|
||||
if (state) state->m_last_block_announcement = time_in_seconds;
|
||||
}
|
||||
|
||||
// Returns true for outbound peers, excluding manual connections, feelers, and
|
||||
// one-shots
|
||||
bool IsOutboundDisconnectionCandidate(const CNode *node)
|
||||
|
||||
Reference in New Issue
Block a user