Crate bitcoin_block
source ·Structs
| Block and header tip information
|
| Nodes collect new transactions into a block,
| hash them into a hash tree, and scan through
| nonce values to make the block’s hash satisfy
| proof-of-work requirements.
|
| When they solve the proof-of-work, they
| broadcast the block to everyone and the block
| is added to the block chain.
|
| The first transaction in the block is
| a special one that creates a new coin owned by
| the creator of the block.
|
| The block chain is a tree shaped structure
| starting with the genesis block at the
| root, with each block potentially having
| multiple candidates to be the next block.
| A blockindex may have multiple pprev
| pointing to it, but at most one of them
| can be part of the currently active branch.
|
| Describes a place in the block chain
| to another node such that if the other
| node doesn’t have the same branch, it
| can find a recent common trunk.
|
| The further back it is, the further before
| the fork it may be.
|
| Block tip (could be a header or not, depends
| on the subscribed signal).
|
| Used to track blocks whose transactions
| were applied to the UTXO state as a part
| of a single ActivateBestChainStep
| call.
|
| This class is single-use, once you call
| GetBlocksConnected() you have to throw
| it away and make a new one.
|
| Used to marshal pointers into hashes
| for db storage.
|
| FlatFileSeq represents a sequence
| of numbered files storing raw data.
| This class facilitates access to and
| efficient management of these files.
|
Enums
| A “reason” why a block was invalid, suitable
| for determining whether the provider
| of the block should be banned/ignored/disconnected/etc.
|
| These are much more granular than the
| rejection codes, which may be more useful
| for some other use-cases.
|
Constants
| Maximum gap between node time and block
| time used for the “Catching up…” mode
| in GUI.
|
| Ref: https://github.com/bitcoin/bitcoin/pull/1026
|
| Maximum amount of time that a block timestamp
| is allowed to exceed the current network-adjusted
| time before the block will be accepted.
|
| Timestamp window used as a grace period
| by code that compares external timestamps
| (such as timestamps passed to RPCs,
| or wallet key creation times) to block
| timestamps. This should be set at least
| as high as
|
| MAX_FUTURE_BLOCK_TIME.
|
Traits
Functions
| this function tries to make a particular
| range of a file allocated (corresponding
| to disk space) it is advisory, and the
| range specified in the arguments will
| never contain live data
|
| Sync directory contents. This is required
| on some environments to ensure that
| newly created files are committed to
| disk.
|
| Ensure file contents are fully committed
| to disk, using a platform-specific
| feature analogous to fsync().
|
| Compute what height to jump back to with
| the CBlockIndex::pskip pointer.
|
| Turn the lowest ‘1’ bit in the binary
| representation of a number into a ‘0’.
|
| Find the last common ancestor two blocks
| have.
|
| Both pa and pb must be non-nullptr.
|
| ie, find the forking point between two chain
| tips.
|