I looked through the documentation but there doesnt seem to be mention of this. I tried to debug it and look at the status of the transaction receipt but it is always null. Is there any way to do this?


Generally, what people mean when they count the number of confirmations is how many blocks there have been since the one the given transaction was in.

So all you need to do is find out the current block number (web3.eth.getBlockNumber(function (err, number) { ... });) and then subtract the block number from your transaction receipt.

  • So once you get the transaction receipt, by the fact that youve gotten it, means its been accepted into the blockchain? – yemista Jan 14 '18 at 6:09
  • Yes, that's right. – user19510 Jan 14 '18 at 6:10
  • 1
    But in the case that two miners mined a block at just about the same time, it's unclear which one will win (and perhaps only one includes your transaction). The more blocks that get added after the one including your transaction, the more certain you can be that your block will stay. – user19510 Jan 14 '18 at 6:11

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.