Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Is there a way to check the number of confirmations in a Blockchain hash? And check when the transaction is fully confirmed?

I’ve been trying to look for a way to get the number of confirmations in a certain blockchain hash, but have gotten nowhere.

I’m basically trying to find a way to print when the said transaction becomes 4/4.

Could anyone please give me a starting guide? Thanks!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Edit:

I’ve tried things like https://blockchain.info/rawtx/$tx_hash using requests, I still cannot find a way to get the amount of confirmations and wait til it hits 4.

>Solution :

There is a method to get transaction confirmations by using getrawtransaction rpc method with verbose flag set to true. Part of the json output looks like:

  "blockhash" : "hex",               (string) the block hash
  "confirmations" : n,               (numeric) The confirmations
  "blocktime" : xxx,                 (numeric) The block time expressed in UNIX epoch time
  "time" : n                         (numeric) Same as "blocktime"

The full docs how to use it is here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading