mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-07-15 17:11:21 +02:00
test: Drop ++ from NodeClockContext default constructor
The increment was originally added so that mocked time would not appear to go backward relative to real-clock timestamps captured before construction, since Now<NodeSeconds>() rounds the current time down to a whole second. In practice the tests do not mix real and mocked timestamps in a way that exposes this, so the increment is unnecessary.
This commit is contained in:
@@ -44,8 +44,8 @@ public:
|
||||
/// Initialize with the given time.
|
||||
explicit NodeClockContext(NodeSeconds init_time) { set(init_time); }
|
||||
explicit NodeClockContext(std::chrono::seconds init_time) { set(init_time); }
|
||||
/// Initialize with current time, using the next tick to avoid going back by rounding to seconds.
|
||||
explicit NodeClockContext() { set(++Now<NodeSeconds>().time_since_epoch()); }
|
||||
/// Initialize with current time.
|
||||
explicit NodeClockContext() { set(Now<NodeSeconds>()); }
|
||||
|
||||
/// Unset mocktime.
|
||||
~NodeClockContext() { set(0s); }
|
||||
|
||||
Reference in New Issue
Block a user