otv

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0, BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnTangleVoting

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

OnTangleVoting is a pluggable implementation of tangle.ConsensusMechanism2. On tangle voting is a generalized form of Nakamoto consensus for the parallel-reality-based ledger state where the heaviest branch according to approval weight is liked by any given node.

func NewOnTangleVoting

func NewOnTangleVoting(branchDAG *ledgerstate.BranchDAG, weightFunc consensus.WeightFunc) *OnTangleVoting

NewOnTangleVoting is the constructor for OnTangleVoting.

func (*OnTangleVoting) LikedInstead

func (o *OnTangleVoting) LikedInstead(branchID ledgerstate.BranchID) (opinionTuple []consensus.OpinionTuple, err error)

LikedInstead determines what vote should be cast given the provided branchID.

func (*OnTangleVoting) Opinion

func (o *OnTangleVoting) Opinion(branchIDs ledgerstate.BranchIDs) (liked, disliked ledgerstate.BranchIDs, err error)

Opinion splits the given branch IDs by examining all the conflict sets for each branch and checking whether it is the branch with the highest approval weight across all its conflict sets of which it is a member.

Jump to

Keyboard shortcuts

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