node uptime wrong #34326

issue embetrix openend this issue on January 17, 2026
  1. embetrix commented at 3:56 pm on January 17, 2026: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    System is freshly booted but bitcoind show wrong uptime:

    0root@raspberrypi5-c8-bf-64:~# bitcoin-cli -conf=/etc/bitcoin/bitcoin.conf uptime
    120120688
    

    My real uptime:

    0root@raspberrypi5-c8-bf-64:~# uptime 
    1 15:53:22 up 10 min,  0 user,  load average: 0.61, 0.56, 0.31
    

    version:

     0root@raspberrypi5-c8-bf-64:~# bitcoind --version
     1Bitcoin Core daemon version v30.2.0 bitcoind
     2Copyright (C) 2009-2026 The Bitcoin Core developers
     3
     4Please contribute if you find Bitcoin Core useful. Visit
     5<https://bitcoincore.org/> for further information about the software.
     6The source code is available from <https://github.com/bitcoin/bitcoin>.
     7
     8This is experimental software.
     9Distributed under the MIT software license, see the accompanying file COPYING
    10or <https://opensource.org/license/MIT>
    

    bitcoin conf file:

     0root@raspberrypi5-c8-bf-64:~# cat /etc/bitcoin/bitcoin.conf 
     1#############################################################
     2# Bitcoin configuration file
     3#############################################################
     4pid=/run/bitcoin/bitcoind.pid
     5nodebuglogfile=1
     6datadir=/var/bitcoin
     7loglevel=info
     8proxy=127.0.0.1:9050
     9signer=/usr/bin/hwi
    10
    11# Settings for signet Network
    12signet=1
    13
    14[signet]
    15walletdir=/var/wallets
    16listen=1
    17bind=127.0.0.1
    18port=38333
    19
    20# RPC Settings
    21rpcuser=satobox
    22rpcport=38332
    23rpcbind=127.0.0.1
    24rpcallowip=127.0.0.1
    25rpcauth=satobox:3381456077fa06cabce053c62a368693$263f4f1cbdc1b4b25233385b931807508f5d8bd59d2c46dc418e4ea2b23dfd09
    26rpccookiefile=/run/bitcoin/cookie
    27rpccookieperms=group
    28server=1
    29deprecatedrpc=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

  2. pinheadmz commented at 4:10 pm on January 17, 2026: member
    Just to be sure… is the clock on your system correct?
  3. embetrix commented at 4:15 pm on January 17, 2026: none
    @pinheadmz correct the rpi5 does not have an RTC backed up with a battery so if bitcoind start before the NTP is synchronized the bitcoin-cli uptime shows incorrect uptime
  4. pinheadmz commented at 5:02 pm on January 17, 2026: member
    What happens if the clock is correct when you start Bitcoin and still correct when you make the RPC?
  5. l0rinc commented at 5:07 pm on January 17, 2026: contributor

    I was able to reproduce the reported behavior on an RPi5 by simulating a large clock correction using regtest setmocktime (and also via explicit timedatectl set-ntp false)

     0$ cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && ninja -C build bitcoind bitcoin-cli -j$(nproc)
     1# ...
     2$ DATA_DIR=$(mktemp -d)
     3$ ./build/bin/bitcoind -regtest -datadir="$DATA_DIR" -connect=0 -daemon
     4Bitcoin Core starting
     5$ ./build/bin/bitcoin-cli -regtest -datadir="$DATA_DIR" -rpcwait uptime
     61
     7$ ./build/bin/bitcoin-cli -regtest -datadir="$DATA_DIR" setmocktime $(( $(date +%s) + 20000000 ))
     8$ ./build/bin/bitcoin-cli -regtest -datadir="$DATA_DIR" uptime
     920000001
    10$ ./build/bin/bitcoin-cli -regtest -datadir="$DATA_DIR" stop
    11Bitcoin Core stopping
    

    I will push a fix for this to use a std::chrono::steady_clock instead.

  6. l0rinc commented at 8:02 pm on January 17, 2026: contributor
    Thanks for the report, fixed it in #34328 - if you can, please try it out locally to confirm
  7. willcl-ark added the label Bug on Jan 20, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-01-27 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me