Skip to content

Why we have to wait one block? #3716

Answered by krakxn
Dashingbanda asked this question in Q&A
Discussion options

You must be logged in to vote

@Dashingbanda

Blocks contain transactions. Blocks containing these transactions are mined by miners. What .wait() here does is that it waits for the block to be mined. A blockchain is a "tree" of blocks, essentially transactions.

However, waiting one block is only sufficient for networks where the volume is not significant at all (e.g. a testing environment on your computer, where volume is negligible). This is why we wait for one block here.

You would have noticed that we wait 6 blocks instead for testnets (such as Goerli); why? this is so because they have lots of transactions which are mined. Therefore, it follows that one block is not sufficient for your transaction to be included in …

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@moayuisuda
Comment options

@tarunkotagiri0
Comment options

@Dashingbanda
Comment options

@Dashingbanda
Comment options

@tarunkotagiri0
Comment options

Answer selected by Dashingbanda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants