HomePhabricator

Use std::chrono for the time to rotate destination of addr messages + tests

Description

Use std::chrono for the time to rotate destination of addr messages + tests

Summary:
Before this change, 24 hours was defined as uint. I replaced it with std::chrono, which is mockable and type-safe.

Check that within 24h addr of a given node is forwarded to the same peer(s), and then the destination is rotated every 24h.

Co-authored-by: Jon Atack <jon@atack.com>

This is a backport of core#18642

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14829

Details

Provenance
Gleb Naumenko <naumenko.gs@gmail.com>Authored on Apr 15 2020, 01:02
PiRKCommitted on Nov 22 2023, 11:50
PiRKPushed on Nov 22 2023, 11:50
Reviewer
Restricted Project
Differential Revision
D14829: Use std::chrono for the time to rotate destination of addr messages + tests
Parents
rABCe041fc0369a2: refactor: make GetRand a template, remove GetRandInt
Branches
Unknown
Tags
Unknown