Elixium Core v0.6.3 Elixium.Validator View Source
Responsible for implementing the consensus rules to all blocks and transactions
Link to this section Summary
Functions
A block is considered valid if the index is greater than the index of the previous block, the previous_hash is equal to the hash of the previous block, and the hash of the block, when recalculated, is the same as what the listed block hash is
Checks if a transaction is valid. A transaction is considered valid if 1) all of its inputs are currently in our UTXO pool and 2) all addresses listed in the inputs have a corresponding signature in the sig set of the transaction. pool_check is a function which tests whether or not a given input is in a pool (this is mostly used in the case of a fork), and this function must return a boolean
Link to this section Functions
A block is considered valid if the index is greater than the index of the previous block, the previous_hash is equal to the hash of the previous block, and the hash of the block, when recalculated, is the same as what the listed block hash is
passes_pool_check?(Elixium.Transaction, function()) :: :ok | {:error, :failed_pool_check}
utxo_amount_integer?(Elixium.Transaction) :: :ok | {:error, :utxo_amount_not_integer}
valid_coinbase?(Elixium.Block) :: :ok | {:error, :no_coinbase} | {:error, :too_many_coinbase}
Checks if a transaction is valid. A transaction is considered valid if 1) all of its inputs are currently in our UTXO pool and 2) all addresses listed in the inputs have a corresponding signature in the sig set of the transaction. pool_check is a function which tests whether or not a given input is in a pool (this is mostly used in the case of a fork), and this function must return a boolean.