2

How I can calculate Estimated Confirmation Duration

or

Can someone give me a formula to calculate Estimated Confirmation Duration of a pending transaction like etherscan.io do?

image of a pending transaction

1

There is no formula.

You are waiting for a miner to pick up your transaction and include it in a block. They are under no obligation to that. They are financially incentivized to do that by the gasPrice you offered them. If it's taking too long, then offer isn't good enough.

The best you can do is compare to historical norms for similarly-priced transactions. As Nikita pointed out, EthGasStation reports such statistics. It will be a curve, with some completing faster than others.

In a situation like yours with a stalled transaction, you can't be sure it won't mine. You would want to be sure of that before you, say, send it again with a higher gas price.

Have a look over here for a way to get a confirmation that you have cancelled it. Canceling / overwriting a pending transaction using geth JSON RPC

Hope it helps.

| improve this answer | |
1

At EthGasStation.info, they have this calculator. On youtube you can find many tutorials how to properly use this tool, although it should be self explanatory.

| improve this answer | |
  • 1
    Thanks! But I want to calculate Estimated Confirmation Duration in my own block explorer, so I need a math formula. – Bach Duong Jul 16 '18 at 15:58
  • So it's a private net ? Then it's easy, it all depends on the amount of miners and transactions. If the block size fits all the transactions, you will hardly ever wait longer than a maximum of two blocks, often times it will only be one. – Nikita Fuchs Jul 16 '18 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.