Where i can find previous block for any blockhash

+1 vote
Where i can find previous block for any blockhash
asked May 16, 2019 by Sunita More

1 Answer

+1 vote

You can use:

multichain-cli getblock <block_hash_here>

This will return a JSON containing the height of the blockhash. So you can find the previous:

multichain-cli getblock <height-1 here>

I hope I understood correct the question :)

 

Edit:

Just tested it. Using getblock <blockhash> you get the JSON response in which you can find in the end of the response a key named: "previousblockhash"

So using getblock <value_of_previousblockhash> you can get the info you need.

answered May 17, 2019 by kgiannis
edited May 17, 2019 by kgiannis
...