1

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? – soc1c Feb 9 '17 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 – Chris Hafey Feb 9 '17 at 13:39
2

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.

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.