Class Ledger
class Ledger
;
Constructors
Name | Description |
---|---|
this
(params, database, storage, validator_set)
|
Constructor |
Fields
Name | Type | Description |
---|---|---|
params
|
immutable(ConsensusParams) | Consensus-critical constants used by this Ledger |
cached_coinbase
|
Ledger | Cache for Coinbase tx to be used during payout height |
engine
|
Engine | Script execution engine |
fee_man
|
FeeManager | The checker of transaction data payload |
last_block
|
Block | The last block in the ledger |
log
|
Logger | Logger instance |
rewards
|
Reward | Block rewards calculator |
stateDB
|
ManagedDatabase | The database in which the Ledger state is stored |
storage
|
IBlockStorage | data storage for all the blocks |
utxo_set
|
UTXOCache | UTXO set |
validator_set
|
ValidatorSet | The object controlling the validator set |
Methods
Name | Description |
---|---|
acceptBlock
(block)
|
Attempt to add a block to the Ledger .
|
addPreimage
(preimage)
|
Add a pre-image information to the validator data |
buildBlock
(txs, enrollments, missing_validators)
|
Create a new block based on the current previous block. |
expectedHeight
(utcTime)
|
Get the Height this Ledger should be at if fully synchronized
|
getBlocks
(rng)
|
Get a range of blocks, starting from the provided block height. |
getBlocksFrom
(start)
|
Get a range of blocks from start to Ledger
|
getEnrolledUTXOs
(height)
|
|
getExpectedBlockTime
(height)
|
Gets the expected block nomination time offset from Genesis start time. |
getLastPaidHeight
()
|
return the last paid out block before the current block |
getPenaltyDeposit
(utxo)
|
|
getUTXOFinder
()
|
Prepare tracking double-spent transactions and return the UTXOFinder delegate |
getValidators
(height, empty)
|
Expose the list of validators at a given height |
hasMajoritySignature
(header)
|
|
height
()
|
Returns the height at which this Ledger is currently at
|
isCoinbaseBlock
(height)
|
Check if this is the height for payouts of a payout period
|
isRelatedRewardBlock
(reward_height, coinbase_height)
|
Check if block is related to given payout block |
isStake
(hash, utxo)
|
|
lastBlock
()
|
Returns a reference to the last block in the Ledger
|
peekUTXO
(utxo, value)
|
Get an UTXO, no double-spend protection. |
updateBlockMultiSig
(header)
|
Update the Schnorr multi-signature for an externalized block in the Ledger. |
utxos
()
|
Expose an object that interacts with the UTXO set |
validateBlock
(block)
|
Check whether the block is valid. |
validateBlockSignature
(header)
|
Validate the signature of a block |
validatorCount
(height)
|
Get the count of active validators at a given height. |
addValidatedBlock
(block)
|
Add a validated block to the Ledger. |
applySlashing
(header)
|
Apply slashing to the current state |
getCoinbaseTX
(height)
|
Create the Coinbase transaction for this payout block and append it
to the transaction set
|
handleNotSignedByMajority
(header, validators)
|
Used to handle behaviour when less than half the validators have signed
the block. This is overridden in the ValidatingLedger
|
replayStoredBlock
(block)
|
Update the ledger state from a block which was read from storage |
updateUTXOSet
(block)
|
Update the UTXO set based on the block's transactions |
updateValidatorSet
(block)
|
Update the active validator set |
Inner structs
Name | Description |
---|---|
CachedCoinbase
|
Cache for Coinbase tx to be used during payout height |