blockchain

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCK_TYPE      = "block"
	CONNECTION_TYPE = "connects"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type OverlineBlockchain

type OverlineBlockchain struct {
	Config    OverlineBlockchainConfig
	Mu        sync.Mutex
	CheckupMu sync.Mutex

	Heads        map[string]bool
	HeadsToCheck map[string]uint64
	BlockGraph   *dagger.Graph
	DB           *database.OverlineDB

	IbdTransitionPeriodRelativeDepth float64
	// contains filtered or unexported fields
}

func (*OverlineBlockchain) AddBlock

func (obc *OverlineBlockchain) AddBlock(block *p2p_pb.BcBlock)

func (*OverlineBlockchain) AddBlockRange

func (obc *OverlineBlockchain) AddBlockRange(blocks *p2p_pb.BcBlocks)

func (*OverlineBlockchain) IsFollowingChain

func (obc *OverlineBlockchain) IsFollowingChain() bool

func (*OverlineBlockchain) SetFollowingChain

func (obc *OverlineBlockchain) SetFollowingChain()

func (*OverlineBlockchain) UnsetFollowingChain

func (obc *OverlineBlockchain) UnsetFollowingChain()

type OverlineBlockchainConfig

type OverlineBlockchainConfig struct {
	DisjointCheckupDepth int `json:"disjoint_checkup_depth"` // if there is a chain segment not connected to db, how long does it have to be to ask to go look for blocks to try to connect?
	DisplayDepth         int `json:"display_depth"`          // only show chains of this length or longer
}

func DefaultOverlineBlockchainConfig

func DefaultOverlineBlockchainConfig() OverlineBlockchainConfig

Jump to

Keyboard shortcuts

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