blkgenor

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Copyright (c) 2018 The MATRIX Authors Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php

Index

Constants

This section is empty.

Variables

View Source
var (
	MinerResultError        = errors.New("MinerResult Error")
	ParaNull                = errors.New("Para is null  ")
	HaveNotOKResultError    = errors.New("have no satisfy miner result")
	HaveNoGenBlockError     = errors.New("have no gen block data")
	HashNoSignNotMatchError = errors.New("hash without sign not match")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	BlockChain() *core.BlockChain
	TxPool() *core.TxPoolManager //Y
	EventMux() *event.TypeMux
	SignHelper() *signhelper.SignHelper
	HD() *msgsend.HD
	ReElection() *reelection.ReElection
	FetcherNotify(hash common.Hash, number uint64, addr common.Address)
	OLConsensus() *olconsensus.TopNodeService
	Random() *baseinterface.Random
	ManBlkDeal() *blkmanage.ManBlkManage
}

type BlockGenor

type BlockGenor struct {
	// contains filtered or unexported fields
}

func New

func New(man Backend) (*BlockGenor, error)

func (*BlockGenor) Close

func (self *BlockGenor) Close()

type PowPool

type PowPool struct {
	// contains filtered or unexported fields
}

///////////////////////////////////////////////////////////////////////////////////////// 协程安全投挖矿结果池

func NewPowPool

func NewPowPool(logInfo string) *PowPool

func (*PowPool) AddMinerResult

func (self *PowPool) AddMinerResult(blockHash common.Hash, diff *big.Int, minerResult *mc.HD_MiningRspMsg) error

func (*PowPool) DelOneResult

func (self *PowPool) DelOneResult(blockHash common.Hash, diff *big.Int, from common.Address) error

func (*PowPool) GetMinerResults

func (self *PowPool) GetMinerResults(blockHash common.Hash, diff *big.Int) ([]*mc.HD_MiningRspMsg, error)

type Process

type Process struct {
	FullBlockReqCache *common.ReuseMsgController
	// contains filtered or unexported fields
}

func (*Process) AddBroadcastMinerResult

func (p *Process) AddBroadcastMinerResult(result *mc.HD_BroadcastMiningRspMsg)

func (*Process) AddConsensusBlock

func (p *Process) AddConsensusBlock(block *mc.BlockLocalVerifyOK)

func (*Process) AddInsertBlockInfo

func (p *Process) AddInsertBlockInfo(blockInsert *mc.HD_BlockInsertNotify)

func (*Process) AddMinerResult

func (p *Process) AddMinerResult(minerResult *mc.HD_MiningRspMsg)

func (*Process) Close

func (p *Process) Close()

func (*Process) ProcessFullBlockReq

func (p *Process) ProcessFullBlockReq(req *mc.HD_FullBlockReqMsg)

func (*Process) ProcessFullBlockRsp

func (p *Process) ProcessFullBlockRsp(rsp *mc.HD_FullBlockRspMsg)

func (*Process) ProcessRecoveryMsg

func (p *Process) ProcessRecoveryMsg(msg *mc.RecoveryStateMsg)

func (*Process) ReInit

func (p *Process) ReInit()

func (*Process) ReInitNextLeader

func (p *Process) ReInitNextLeader()

func (*Process) SetCurLeader

func (p *Process) SetCurLeader(leader common.Address, consensusTurn mc.ConsensusTurnInfo)

func (*Process) SetNextLeader

func (p *Process) SetNextLeader(preLeader common.Address, leader common.Address)

func (*Process) StartRunning

func (p *Process) StartRunning(role common.RoleType, bcInterval *mc.BCIntervalInfo)

type ProcessManage

type ProcessManage struct {
	// contains filtered or unexported fields
}

func NewProcessManage

func NewProcessManage(matrix Backend) *ProcessManage

func (*ProcessManage) GetCurNumber

func (pm *ProcessManage) GetCurNumber() uint64

func (*ProcessManage) GetCurrentProcess

func (pm *ProcessManage) GetCurrentProcess() *Process

func (*ProcessManage) GetProcess

func (pm *ProcessManage) GetProcess(number uint64) (*Process, error)

func (*ProcessManage) GetProcessAndPreProcess

func (pm *ProcessManage) GetProcessAndPreProcess(number uint64) (*Process, *Process, error)

func (*ProcessManage) SetCurNumber

func (pm *ProcessManage) SetCurNumber(number uint64, superSeq uint64)

type State

type State uint16
const (
	StateIdle State = iota
	StateBlockBroadcast
	StateHeaderGen
	StateMinerResultVerify
	StateBlockInsert
	StateEnd
)

func (State) String

func (s State) String() string

type VrfMsg

type VrfMsg struct {
	VrfValue []byte
	VrfProof []byte
	Hash     common.Hash
}

Jump to

Keyboard shortcuts

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