-
Notifications
You must be signed in to change notification settings - Fork 1.2k
refactor: use SteadyClock instead of SystemClock for duration measurements in Dash-specific code #7283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
refactor: use SteadyClock instead of SystemClock for duration measurements in Dash-specific code #7283
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -784,7 +784,7 @@ class CNode | |
| // Setting fDisconnect to true will cause the node to be disconnected the | ||
| // next time DisconnectNodes() runs | ||
| std::atomic_bool fDisconnect{false}; | ||
| std::atomic<int64_t> nDisconnectLingerTime{0}; | ||
| std::atomic<SteadyClock::time_point> nDisconnectLingerTime{SteadyClock::time_point{}}; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💬 Nitpick: std::atomicSteadyClock::time_point lock-freedom is not asserted
source: ['claude'] |
||
| std::atomic_bool fSocketShutdown{false}; | ||
| std::atomic_bool fOtherSideDisconnected { false }; | ||
| // If 'true' this node will be disconnected on CMasternodeMan::ProcessMasternodeConnections() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 Nitpick: Default-constructed time_point used as sentinel
The
== SteadyClock::time_point{}check preserves the prior== 0sentinel semantics and is correct in practice (a running process'sSteadyClock::now()is never the epoch). It is slightly less self-documenting thanstd::optional<SteadyClock::time_point>or a namedkUnsetconstant. Low priority — a short comment at the declaration site would be enough to document the idiom.source: ['claude']