It appears that geth waits for 5 blocks to confirm a block. Is there any way to change the number of blocks to wait for confirmation?

  • Where do you see the number 5?
    – q9f
    Commented Feb 9, 2017 at 13:14
  • In the geth log: I0208 21:57:10.985738 miner/unconfirmed.go:105] 🔗 mined block #5037 [ebe74549…] reached canonical chain I0208 21:57:10.985765 miner/unconfirmed.go:83] 🔨 mined potential block #5042 [a1b97df2…], waiting for 5 blocks to confirm I0208 21:57:10.986022 miner/worker.go:514] commit new work on block 5043 with 0 txs & 0 uncles. Took 231.449µs Commented Feb 9, 2017 at 13:39

1 Answer 1


This is hard-coded, so the only way to change it would be to edit the source yourself, and rebuild.

In Geth's miner package, in worker.go, each worker is started with the following values. The 5 represents the depth of the chain of unconfirmed blocks that are kept locally.

unconfirmed:    newUnconfirmedBlocks(eth.BlockChain(), 5),

If any further blocks are mined, the older, still-unconfirmed blocks are removed from the local chain.

The value of 5 seems to be arbitrarily set and...

It is used by the miner to provide logs to the user when a previously mined block has a high enough guarantee to not be reorganised out of the canonical chain.

I don't know what effect changing it would have. Presumably in a live public network it'd be unlikely that more than 5 consecutive blocks would be mined by the same miner.

  • Why is it significant for the blocks to be consecutively mined by the same miner? Different miners mining block simultaneously at equal intervals can also result in a fork right? If the forked chains grow together continuously at the same pace for, say, 100 blocks - what would happen? Obviously they'd slip by the 5 confirmation check, yes?
    – anotherDev
    Commented Aug 8, 2021 at 10:33

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.