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?

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."

|improve this answer|||||
  • That is absolutely correct and i read that Ethereum itself suggest to finalize the transaction on 24th confirmation. – logeekal May 22 '19 at 12:15

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.