How do I figure out the current number of blocks?
2 Answers
You don't need to modify the bitcoin client at all - you can use JSON-RPC and call getblockcount.
-
It's altcoin-dev, I need height to recalculate difficulty after fork. Commented May 31, 2013 at 17:57
-
I don't understand your problem. There's no variable nHeight in ComputeMinWork. Commented Jun 2, 2013 at 18:29
-
It's true. It's not possible, because, does not have position on blockchain yet. Thanks. Commented Jun 3, 2013 at 19:05
If you don't mind using someone else's server you can just use the response from a HTTP call to http://blockexplorer.com/q/getblockcount