namecoin / namecoin-legacy

Legacy client. New version here: https://github.com/namecoin/namecoin-core Note the release branch! - Official website:
https://namecoin.org
MIT License
448 stars 177 forks source link

Get difficulty at arbitrary block height #112

Closed dlio closed 10 years ago

dlio commented 10 years ago

While namecoind getinfo and namecoind getdifficulty display the current difficulty, namecoind getblock <block_hash> does not return difficulty info for an arbitrary block in the past.

Is it possible to do this? There is some code I've written that works across dozens of other coin daemons that breaks with namecoin because of this missing difficulty field. I've patched together some workarounds for other issues but this one is a significant obstacle to the inclusion of namecoin in various multi-coin projects.

Any help would be much appreciated -- cheers.

domob1812 commented 10 years ago

Yes, should be possible to do. I'll give it a try and submit a patch if it is not too much work (which it isn't, presumably). I think this information is useful, also for all kinds of statistics.

phelixbtc commented 10 years ago

Done.

dlio commented 10 years ago

Awesome! Thanks a ton -- testing now.

dlio commented 10 years ago

Works like a charm; many thanks.