How can a miner know how many blocks mined by him?

1

I am working on an altcoin based on bitcoin-core, version 0.12.1 (this version including setgenerate). Is their an option for a miner to know (using bitcoin-cli) how many blocks mined by him (after setgenerate was set to true), had been accepted by the network and had been inserted to the blockchain?

Yosi Karl

Posted 2018-06-19T05:15:36.807

Reputation: 13

Question was closed 2019-07-17T17:30:49.677

You wait for a sufficient number of new blocks to be mined on top of your block and see if the chain includes your block. For bitcoin, this is 6 blocks. If you see a chain with a different block at the height you submitted, your block was dropped.Raghav Sood 2018-06-19T05:30:18.803

OK, but is their a way to get the number of blocks which meets that definition by a command (or a set of commands) ? somethonk like getblockcount, but counted only for a specific miner.Yosi Karl 2018-06-19T05:39:05.077

No, you will have to maintain an index separately. Additionally, it may not always be possible to tell is multiple blocks were mined by the same minerRaghav Sood 2018-06-19T05:47:18.927

Can you elaborate about how to maintain this index? thanksYosi Karl 2018-06-19T06:39:06.910

@RaghavSood For bitcoin, it's 100 blocks, I believe.

MCCCS 2018-06-20T06:14:38.333

No answers