Author

Topic: Namecoin - Determine Block Height from Block Hash (Read 494 times)

member
Activity: 105
Merit: 59
I've written a patch that adds this and a few other properties to Namecoin's getblock RPC call.

https://github.com/namecoin/namecoin/issues/87
https://gist.github.com/ryancdotorg/5e610e9ee546beed367d
full member
Activity: 221
Merit: 100
Is it possible to use namecoind to determine the block number from a block hash?
going the other way is easy:

Code:
namecoind getblockhash

but getting the height from the hash appears to be impossible...

Height is not an attribute on each block and no method appears to return it.

The closest two are:

Code:
namecoind getblockcount
which:
"Returns the number of blocks in the longest block chain."
 and
namecoind getblocknumber
which:
"Returns the block number of the latest block in the longest block chain."

So there are two methods which do the same thing and no methods that take a block hash and return that block's height, nor is block height a block attribute.

Is there something I'm missing here?  Other coins do not appear to lack this basic functionality.
Jump to: