简体   繁体   中英

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!

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM