Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateLeader ¶
func ValidateLeader(slot int, nonce string, public string, vrfProof string, stakeDist *blockchain.StakeDistribution) bool
quick validation for supposed mined block that node received from network determines whether network will broadcast this block further or not
Types ¶
type Consensus ¶
type Consensus struct { ChanNetBlock <-chan data.Block ChanNetTransaction <-chan data.Transaction ChanConsBlock chan<- data.Block ChanConsTransaction chan<- data.Transaction Blockchain *blockchain.Blockchain TransPool *blockchain.TransPool PrivateKey ed25519.PrivateKey // contains filtered or unexported fields }
func New ¶
func New(c *communication.CommunNetwCons, stakeDist *blockchain.StakeDistribution, privateKey ed25519.PrivateKey) *Consensus
func (*Consensus) CreateBlock ¶
func (c *Consensus) CreateBlock()
func (*Consensus) HasEnoughMoney ¶
func (*Consensus) SendTransaction ¶
func (c *Consensus) SendTransaction(t data.Transaction)
validate without the sign
func (*Consensus) TransactionsForBlock ¶
func (c *Consensus) TransactionsForBlock() []data.Transaction
necessary as some transactions could be from same user and could potentially cause wrong valadation
Click to show internal directories.
Click to hide internal directories.