current block height

2

How do I figure out the current number of blocks?

user1497250

Posted 2013-05-31T14:31:06.373

Reputation: 181

Answers

2

You don't need to modify the bitcoin client at all - you can use JSON-RPC and call getblockcount.

Nick ODell

Posted 2013-05-31T14:31:06.373

Reputation: 26 536

It's altcoin-dev, I need height to recalculate difficulty after fork.user1497250 2013-05-31T17:57:25.347

I don't understand your problem. There's no variable nHeight in ComputeMinWork.Nick ODell 2013-06-02T18:29:50.103

It's true. It's not possible, because, does not have position on blockchain yet. Thanks.user1497250 2013-06-03T19:05:24.560

1

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

jgm

Posted 2013-05-31T14:31:06.373

Reputation: 1 487