You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess the function GetUptime() shall be called at least once in the startup phase to initialize the static variable g_startup_time.
Also rpc_uptime.py could be updated with dedicated check.
If ok, I would be happy to contribute with a PR for this.
Thank you for the feedback.
I did a test calling the function in AppInitMain, right before Step 4a code, and it works fine.
Would it be a good solution?
Is there already a plan for fixing this issue?
Thanks @carloantinarella, looks like we all misunderstood your original report.
I pushed a fix to #34437, added you as coauthor.
Thanks for testing it, keep it up!
@carloantinarella out of curiosity what is your usecase for the uptime RPC? Any reason you prefer it over querying your OS for the uptime of the bitcoind process?
Activity
carloantinarella commentedon Jan 27, 2026
Probably caused by changes introduced in #34328
I guess the function
GetUptime()shall be called at least once in the startup phase to initialize the static variableg_startup_time.Also
rpc_uptime.pycould be updated with dedicated check.If ok, I would be happy to contribute with a PR for this.
maflcko commentedon Jan 27, 2026
Right, good catch. I think this was introduced by me in #34328 (comment)
carloantinarella commentedon Jan 28, 2026
Thank you for the feedback.
I did a test calling the function in
AppInitMain, right before Step 4a code, and it works fine.Would it be a good solution?
Is there already a plan for fixing this issue?
l0rinc commentedon Jan 28, 2026
Thanks @carloantinarella, looks like we all misunderstood your original report.
I pushed a fix to #34437, added you as coauthor.
Thanks for testing it, keep it up!
dergoegge commentedon Jan 29, 2026
@carloantinarella out of curiosity what is your usecase for the
uptimeRPC? Any reason you prefer it over querying your OS for the uptime of the bitcoind process?carloantinarella commentedon Jan 29, 2026
No special needs, I just use it to check if the node is up and running. It's os agnostic and returns plain number (good for quick scripting).
Merge bitcoin#34437: rpc: `uptime` should begin on application start