Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jun 23, 2022

Currently it uses GetTimeMicros, which is the system time. Using steady time instead, makes the code type safe and avoids spurious offsets when the system time adjusts.

@maflcko maflcko force-pushed the 2206-rpc-steady-duration- branch from fabef13 to fabae35 Compare June 23, 2022 13:32
@laanwj
Copy link
Member

laanwj commented Jun 23, 2022

Code review ACK fabae35

Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review ACK fabae35

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review ACK fabae35

  • I agree with using steady_clock::now for getrpcinfo instead of system_clock::now, for the reason given in the description.
  • Here is a helpful article I found regarding the difference between the two, and it helps explains why steady_clock is the better choice in this case.

@maflcko maflcko merged commit 1da1c0d into bitcoin:master Jun 24, 2022
@maflcko maflcko deleted the 2206-rpc-steady-duration-🎴 branch June 24, 2022 15:30
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jun 27, 2022
fabae35 rpc: Use steady_clock for getrpcinfo durations (MacroFake)

Pull request description:

  Currently it uses `GetTimeMicros`, which is the system time. Using steady time instead, makes the code type safe and avoids spurious offsets when the system time adjusts.

ACKs for top commit:
  laanwj:
    Code review ACK fabae35
  w0xlt:
    Code Review ACK bitcoin@fabae35
  shaavan:
    Code Review ACK fabae35

Tree-SHA512: eb25fe3e69bf42ec8a2d4aaa69b435de7654b0d07218ce3e0c03ebaef6eb7f713128779057d012621773a34675a81f5757e7b2502c13b82adaf6e2df970d8c66
maflcko pushed a commit that referenced this pull request Jul 12, 2022
…s(Dur2 d)`

c6c35db wallet: change `ScanForWalletTransactions` to use `Ticks()` (w0xlt)

Pull request description:

  This PR changes `ScanForWalletTransactions()` to use the `Ticks(Dur2 d)` function (introduced in #25456).

ACKs for top commit:
  MarcoFalke:
    cr ACK c6c35db

Tree-SHA512: 864e136b470baf22293dc03ae3400bbb34955389a1efc83862f006cfac84da9128c3a201ef051606c06f782a1fde84129261dd4b417cbfff854d5c359a92703e
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 12, 2022
…e `Ticks(Dur2 d)`

c6c35db wallet: change `ScanForWalletTransactions` to use `Ticks()` (w0xlt)

Pull request description:

  This PR changes `ScanForWalletTransactions()` to use the `Ticks(Dur2 d)` function (introduced in bitcoin#25456).

ACKs for top commit:
  MarcoFalke:
    cr ACK c6c35db

Tree-SHA512: 864e136b470baf22293dc03ae3400bbb34955389a1efc83862f006cfac84da9128c3a201ef051606c06f782a1fde84129261dd4b417cbfff854d5c359a92703e
@bitcoin bitcoin locked and limited conversation to collaborators Jun 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants