Page MenuHomePhabricator

Remove GetAdjustedTime from init.cpp
ClosedPublic

Authored by Fabien on Nov 21 2022, 13:00.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC8406fa2d0d0a: Remove GetAdjustedTime from init.cpp
Summary
It seems confusing to call GetAdjustedTime there, because no offset could have been retrieved from the network at this point. Even if connman was started, timedata needs at least 5 peer connections to calculate an offset.

Fix the confusion by replacing GetAdjustedTime with GetTime, which does not change behavior.

Also:

    Replace magic number with MAX_FUTURE_BLOCK_TIME to clarify the context
    Add test, which passes both on current master and this pull request
    An unrelated refactoring commit, happy to drop

Backport of core#23636.

Depends on D12548 and D12552.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable