phantom

package
v0.0.0-...-5692789 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: ISC Imports: 4 Imported by: 0

README

phantom

ISC License

Overview

Package phantom implements the PHANTOM protocol for blockdag ordering and coloring.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OrderDAG

func OrderDAG(g *Graph, genesisNode *node, k int, blueSetCache *BlueSetCache) []*node

need to create a graph with a virtual node

Types

type BlueSetCache

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

func NewBlueSetCache

func NewBlueSetCache() *BlueSetCache

func (*BlueSetCache) GetBlueNodes

func (blueset *BlueSetCache) GetBlueNodes(n *node) []*node

type Graph

type Graph struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

GRAPH

func NewGraph

func NewGraph() *Graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(n1 *node, n2 *node) bool

func (*Graph) AddEdgeById

func (g *Graph) AddEdgeById(n1 string, n2 string) bool

func (*Graph) AddEdgesById

func (g *Graph) AddEdgesById(n1 string, parents []string) []bool

func (*Graph) AddNode

func (g *Graph) AddNode(n *node) bool

func (*Graph) AddNodeById

func (g *Graph) AddNodeById(id string) bool

func (*Graph) GetNodeById

func (g *Graph) GetNodeById(nodeId string) *node

func (*Graph) GetSize

func (g *Graph) GetSize() int

func (*Graph) GetTips

func (g *Graph) GetTips() []*node

func (*Graph) PrintGraph

func (g *Graph) PrintGraph() string

Jump to

Keyboard shortcuts

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