consensus

package
v1.0.0-release Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MineBlock

func MineBlock(currentBlock *block.Block, stop chan StopMiningSignal) (bool, *block.Block)

MineBlock performs the mining operation for a new block

func ValidateBlock

func ValidateBlock(currentBlock *block.Block, prevBlock *block.Block) bool

ValidateBlock validates the given block

func ValidateTransaction

func ValidateTransaction(tx transaction.Transaction) bool

Types

type AddFileTransactionValidator

type AddFileTransactionValidator struct{}

AddFileTransactionValidator for AddFileTransaction

func (*AddFileTransactionValidator) Validate

type DeleteFileTransactionValidator

type DeleteFileTransactionValidator struct{}

DeleteFileTransactionValidator for DeleteFileTransaction

func (*DeleteFileTransactionValidator) Validate

type StopMiningSignal

type StopMiningSignal struct {
	Stop          bool
	BlockReceived *block.Block
}

type TransactionValidator

type TransactionValidator interface {
	Validate(tx transaction.Transaction) bool
}

TransactionValidator interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL