bitcoin core – How does CBlockLocator class works?

on

|

views

and

comments


Does the vHave comprises an inventory of contiguous block hashes earlier to A and A itself?

Just about.

CBlockLocators are only a record of block hashes, with most up-to-date blocks first. After all, it will be costly to ship the entire block hashes that precede A, so the record comprises hashes farther and farther aside because the blocks become older.

It begins with A and the 9 blocks that got here earlier than it. The overwhelming majority of reorgs will probably be inside these 10 blocks, so it simply lists all 10 and there is a fairly excessive chance that the forking level will probably be in there. However after that, hashes begin being spaced out exponentially. It begins with 2 blocks earlier than the final within the record, then 4, then 8, and so forth, till the genesis block is reached.

The record finally ends up having ceil(log2(n)) + 11 hashes. At present that is 31 block hashes.

Share this
Tags

Must-read

Waymo raises $16bn to gas international robotaxi enlargement | Know-how

Self-driving automobile firm Waymo on Monday stated it raised $16bn in a funding spherical that valued the Alphabet subsidiary at $126bn.Waymo co-chief executives...

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here