Documentation
¶
Overview ¶
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
- Copyright (c) IBAX. All rights reserved.
- See LICENSE in the project root for license information. *--------------------------------------------------------------------------------------------
Index ¶
- Variables
- type BlockTimeCalculator
- type BlockTimeChecker
- type BlockTimeCounter
- func (btc *BlockTimeCounter) BlockForTimeExists(t time.Time, nodePosition int) (bool, error)
- func (btc *BlockTimeCounter) NodeTimeExists(t time.Time, nodePosition int) (bool, error)
- func (btc *BlockTimeCounter) RangeByTime(t time.Time) (start, end time.Time, err error)
- func (btc *BlockTimeCounter) TimeToGenerate(at time.Time, nodePosition int) (bool, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type BlockTimeCalculator ¶
type BlockTimeCalculator struct {
// contains filtered or unexported fields
}
BlockTimeCalculator calculating block generation time
func BuildBlockTimeCalculator ¶
func BuildBlockTimeCalculator(transaction *sqldb.DbTransaction) (BlockTimeCalculator, error)
func NewBlockTimeCalculator ¶
func (*BlockTimeCalculator) SetClock ¶
func (btc *BlockTimeCalculator) SetClock(clock utils.Clock) *BlockTimeCalculator
func (*BlockTimeCalculator) TimeToGenerate ¶
func (btc *BlockTimeCalculator) TimeToGenerate(nodePosition int64) (bool, error)
func (*BlockTimeCalculator) ValidateBlock ¶
type BlockTimeChecker ¶
type BlockTimeChecker interface { TimeToGenerate(position int64) (bool, error) BlockForTimeExists(t time.Time, nodePosition int) (bool, error) RangeByTime(at time.Time) (start, end time.Time, err error) }
BlockTimeChecker allow check queue to generate current block
type BlockTimeCounter ¶
type BlockTimeCounter struct {
// contains filtered or unexported fields
}
func NewBlockTimeCounter ¶
func NewBlockTimeCounter() *BlockTimeCounter
NewBlockTimeCounter return initialized BlockTimeCounter
func (*BlockTimeCounter) BlockForTimeExists ¶
BlockForTimeExists checks conformity between time and nodePosition changes functionality of ValidateBlock prevent blockTimeCalculator
func (*BlockTimeCounter) NodeTimeExists ¶
func (*BlockTimeCounter) RangeByTime ¶
RangeByTime returns start and end of interval by time
func (*BlockTimeCounter) TimeToGenerate ¶
TimeToGenerate returns true if the generation queue at time belongs to the specified node