btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.09k stars 2.31k forks source link

btcctl uptime command returns the current time, not the uptime #2202

Closed cec489 closed 1 day ago

cec489 commented 4 days ago

I'm using utreexod, which is based on btcd. The uptime command returns the current time:

~/utreexod/utreexod$ ./utreexoctl --datadir=/mnt/T9/utreexod/bridge-assume-prune uptime 1719253093 ~/utreexod/utreexod$ date +%s 1719253095

Looks like this happens because the startupTime in the server struct is 0 when its set in the rpc server config. startupTime is set later when the server Start() is called.

cec489 commented 4 days ago

... same for btcd master branch

~/btcd/btcd$ ./btcctl uptime 1719255124

chrisguida commented 3 days ago

Confirmed, I'm also seeing this

cec489 commented 1 day ago

PR was merged