Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Thura on January 27, 2016, 05:58:09 PM



Title: What is the "best block" ?
Post by: Thura on January 27, 2016, 05:58:09 PM
Bitcoin core 0.11.2 (bitcoind --help) prints the following:

Code:
-blocknotify=<cmd>
       Execute command when the best block changes (%s in cmd is replaced by
       block hash)

I was wondering what this "best block" would be, but funny: I did not find anything about it in the internet.

So does anyone know what this 'best block' is?

Why should one use the notification for it? I enabled it to notify me via email, but it spams, so I disabled it.


Title: Re: What is the "best block" ?
Post by: -XXIII- on January 27, 2016, 06:06:27 PM
I understand it to be the 'last block' according to this post:

https://bitcointalk.org/index.php?topic=563671.msg6146723#msg6146723


Title: Re: What is the "best block" ?
Post by: bassguitarman on January 27, 2016, 07:22:38 PM
Bitcoin core 0.11.2 (bitcoind --help) prints the following:

Code:
-blocknotify=<cmd>
       Execute command when the best block changes (%s in cmd is replaced by
       block hash)

I was wondering what this "best block" would be, but funny: I did not find anything about it in the internet.

So does anyone know what this 'best block' is?

Why should one use the notification for it? I enabled it to notify me via email, but it spams, so I disabled it.

I believe the "best block" is the valid block with the highest height.


Title: Re: What is the "best block" ?
Post by: achow101 on January 27, 2016, 08:27:34 PM
Bitcoin core 0.11.2 (bitcoind --help) prints the following:

Code:
-blocknotify=<cmd>
       Execute command when the best block changes (%s in cmd is replaced by
       block hash)

I was wondering what this "best block" would be, but funny: I did not find anything about it in the internet.

So does anyone know what this 'best block' is?

Why should one use the notification for it? I enabled it to notify me via email, but it spams, so I disabled it.

I believe the "best block" is the valid block with the highest height.
Not necessarily. The best block is the block whose blockchain has the highest sum of work. The block has a parameter to indicate its difficulty and the longest blockchain is the blockchain that has the highest sum of those parameters. The best block would then be the block at the tip of that blockchain.