...instead of 0, which can not ever be true
GUI RPC Console: if there is no current block number available display N/A on totalBlocks label,... #1258
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:RPCCon_never_0_Blocks changing 1 files +2 −1-
Diapolo commented at 10:31 AM on May 11, 2012: none
-
if there is no current block number available display N/A on totalBlocks label, instead of 0, which can not ever be true 66331f2b51
-
sipa commented at 10:34 AM on May 11, 2012: member
The number reported by peers is actually the highest block height they have available, and this can in fact be 0 (the genesis block has number 0).
-
sipa commented at 10:37 AM on May 11, 2012: member
That said, N/A is probably better UI-wise.
-
Diapolo commented at 10:39 AM on May 11, 2012: none
That's a fact I didn't know ... but it looks kind of weird to display 0. So all nodes have at least the genesis block, which should read 1 as minimum then. How is this handled in the core?
Edit: It would be easy to change the N/A into 1.
-
sipa commented at 10:45 AM on May 11, 2012: member
No, the genesis block has height 0. getnumofpeers actually returns the median reported height reported peers. This can be 0 if most peers report 0.
But keep this pull as it is; if the number is zero it most likely means there are no peers that reported any meaningful number at all, so N/A makes that clear.
-
laanwj commented at 1:33 PM on May 11, 2012: member
On the testnet it will show 0 before connecting to any peers. On the normal net it defaults to the last checkpoint (so it would only go to 0 if many peers report 0). So this is mostly useful on the testnet.
-
Diapolo commented at 1:35 PM on May 11, 2012: none
You are free to take or discard this, as always :).
-
laanwj commented at 1:39 PM on May 11, 2012: member
Nah it's fine, I'll merge it. Tho we should be careful not to introduce too many translation strings in what is effectively a debugging tool.
- laanwj referenced this in commit 2692ed3f01 on May 11, 2012
- laanwj merged this on May 11, 2012
- laanwj closed this on May 11, 2012
-
laanwj commented at 1:43 PM on May 11, 2012: member
Uhm, right, of course "N/A" is already in the translation, so that isn't even a valid point here :)
- coblee referenced this in commit 94171c7a2f on Jul 17, 2012
- suprnurd referenced this in commit 621f9ebeca on Dec 5, 2017
- lateminer referenced this in commit 9e1d7f97c9 on Jan 22, 2019
- lateminer referenced this in commit be05f52000 on May 6, 2020
- DrahtBot locked this on Sep 8, 2021