mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Add unit test for stale tip checking
This commit is contained in:
parent
83df25736e
commit
626291508c
2 changed files with 94 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue