0

I am listening to the even using Nethereum.

May I know if an event is received means the transaction is confirmed?

If not? How can I know it is failed and perform a rollback?

1 Answer 1

3

"Confirmed" can mean a few different things.

When you see an event, it means the transaction was successfully mined into a block.

Because there's a race to add a block to the end of the blockchain, it's always possible that there are two competing chains for a while. By definition, the longest blockchain is the truth, but if two blocks are mined at almost the same time, it's unclear which will win. This issue settles itself over time as more blocks get added.

People often talk about the "number of confirmations" being the number of blocks that have been added after the block that included your transaction. The more blocks that have been added, the less likely it is that there are two competing chains. It's up to you to decide how many confirmations to wait for.

So a simple answer is "Yes," seeing a transaction receipt (or an event) means that the transaction happened. But the more complex answer is "Blocks can actually disappear if a different chain becomes the longest one," so you may want to wait for a few more blocks before you consider a transaction "confirmed."

1
  • That is absolutely correct and i read that Ethereum itself suggest to finalize the transaction on 24th confirmation.
    – logeekal
    Commented May 22, 2019 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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