Repository navigation
Closed
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Current behaviour
System is freshly booted but bitcoind show wrong uptime:
root@raspberrypi5-c8-bf-64:~# bitcoin-cli -conf=/etc/bitcoin/bitcoin.conf uptime
20120688
My real uptime:
root@raspberrypi5-c8-bf-64:~# uptime
15:53:22 up 10 min, 0 user, load average: 0.61, 0.56, 0.31
version:
root@raspberrypi5-c8-bf-64:~# bitcoind --version
Bitcoin Core daemon version v30.2.0 bitcoind
Copyright (C) 2009-2026 The Bitcoin Core developers
Please contribute if you find Bitcoin Core useful. Visit
<https://bitcoincore.org/> for further information about the software.
The source code is available from <https://github.com/bitcoin/bitcoin>.
This is experimental software.
Distributed under the MIT software license, see the accompanying file COPYING
or <https://opensource.org/license/MIT>
bitcoin conf file:
root@raspberrypi5-c8-bf-64:~# cat /etc/bitcoin/bitcoin.conf
#############################################################
# Bitcoin configuration file
#############################################################
pid=/run/bitcoin/bitcoind.pid
nodebuglogfile=1
datadir=/var/bitcoin
loglevel=info
proxy=127.0.0.1:9050
signer=/usr/bin/hwi
# Settings for signet Network
signet=1
[signet]
walletdir=/var/wallets
listen=1
bind=127.0.0.1
port=38333
# RPC Settings
rpcuser=satobox
rpcport=38332
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
rpcauth=satobox:3381456077fa06cabce053c62a368693$263f4f1cbdc1b4b25233385b931807508f5d8bd59d2c46dc418e4ea2b23dfd09
rpccookiefile=/run/bitcoin/cookie
rpccookieperms=group
server=1
deprecatedrpc=warnings
Expected behaviour
should show correct uptime
Steps to reproduce
just build new bitcoin core and test with commands above
Relevant log output
No response
How did you obtain Bitcoin Core
Compiled from source
What version of Bitcoin Core are you using?
v30.2
Operating system and version
linux
Machine specifications
raspberrypi5
Activity
pinheadmz commentedon Jan 17, 2026
Just to be sure... is the clock on your system correct?
embetrix commentedon Jan 17, 2026
@pinheadmz correct the rpi5 does not have an RTC backed up with a battery so if
bitcoindstart before the NTP is synchronized thebitcoin-cli uptimeshows incorrect uptimepinheadmz commentedon Jan 17, 2026
What happens if the clock is correct when you start Bitcoin and still correct when you make the RPC?
l0rinc commentedon Jan 17, 2026
I was able to reproduce the reported behavior on an RPi5 by simulating a large clock correction using regtest
setmocktime(and also via explicittimedatectl set-ntp false)I will push a fix for this to use a
std::chrono::steady_clockinstead.l0rinc commentedon Jan 17, 2026
Thanks for the report, fixed it in #34328 - if you can, please try it out locally to confirm
Merge #34328: rpc: make `uptime` monotonic across NTP jumps
pinheadmz commentedon Jan 27, 2026
Was this closed by #34328 ?
l0rinc commentedon Jan 27, 2026
yes, please close the issue.
dergoegge commentedon Jan 29, 2026
@embetrix 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?
embetrix commentedon Jan 29, 2026
@dergoegge : I started a project recently : https://github.com/embetrix/satobox it implement a full node built completely from sources (including OS and all packages).
It runs actually on RPI5 but not exclusivly.
I have hw wallet management system using Specter-Desktop and it showed previously wrong uptime when bitcoin was started before NTP sync.
I mitigated that by adding systemd requirement on NTP : https://github.com/embetrix/satobox/blob/scarthgap/meta-satobox/recipes-bitcoin/bitcoin/bitcoin/bitcoind.service.in#L3
but the fix proposed by @l0rinc is cleaner and I can remove this dependency with future bitcoin core releases to have a quicker start of the node.
Merge bitcoin/bitcoin#34328: rpc: make `uptime` monotonic across NTP …
Merge bitcoin/bitcoin#34328: rpc: make `uptime` monotonic across NTP …
Merge bitcoin/bitcoin#34328: rpc: make `uptime` monotonic across NTP …