pow

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 16 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TargetTimePerBlock = int64(config.Parameters.ChainParam.TargetTimePerBlock / time.Second)
)
View Source
var TaskCh chan bool

Functions

This section is empty.

Types

type PowService

type PowService struct {
	PayToAddr string
	MsgBlock  msgBlock
	Mutex     sync.Mutex

	RollbackTransactionSubscriber events.Subscriber
	// contains filtered or unexported fields
}

func NewPowService

func NewPowService(localNode protocol.Noder) *PowService

func (*PowService) BlockPersistCompleted

func (pow *PowService) BlockPersistCompleted(v interface{})

func (*PowService) BroadcastBlock

func (pow *PowService) BroadcastBlock(MsgBlock *core.Block) error

func (*PowService) CollectTransactions

func (pow *PowService) CollectTransactions(MsgBlock *core.Block) int

func (*PowService) CreateCoinBaseTx

func (pow *PowService) CreateCoinBaseTx(nextBlockHeight uint32, addr string) (*core.Transaction, error)

func (*PowService) DiscreteMining

func (pow *PowService) DiscreteMining(n uint32) ([]*common.Uint256, error)

func (*PowService) GenerateBlock

func (pow *PowService) GenerateBlock(addr string) (*core.Block, error)

func (*PowService) GetTransactionCount

func (pow *PowService) GetTransactionCount() int

func (*PowService) Halt

func (pow *PowService) Halt()

func (*PowService) RollbackTransaction

func (pow *PowService) RollbackTransaction(v interface{})

func (*PowService) SolveBlock

func (pow *PowService) SolveBlock(MsgBlock *core.Block, ticker *time.Ticker) bool

func (*PowService) Start

func (pow *PowService) Start()

Jump to

Keyboard shortcuts

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