conflictresolver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: Apache-2.0, BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConflictResolver

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

ConflictResolver is a generalized form of Nakamoto consensus for the parallel-reality-based ledger state where the heaviest conflict according to approval weight is liked by any given node.

func New

New is the constructor for ConflictResolver.

func (*ConflictResolver) AdjustOpinion

func (o *ConflictResolver) AdjustOpinion(conflictID utxo.TransactionID) (likedConflict utxo.TransactionID, dislikedConflicts utxo.TransactionIDs)

AdjustOpinion returns the reference that is necessary to correct our opinion on the given conflict. It recursively walk to the parent conflicts to find the upmost liked conflict.

func (*ConflictResolver) ConflictLiked

func (o *ConflictResolver) ConflictLiked(conflict *conflictdag.Conflict[utxo.TransactionID, utxo.OutputID]) (conflictLiked bool)

ConflictLiked returns whether the conflict is the winner across all conflict sets (it is in the liked reality).

func (*ConflictResolver) ForEachConnectedConflictingConflictInDescendingOrder

func (o *ConflictResolver) ForEachConnectedConflictingConflictInDescendingOrder(conflict *conflictdag.Conflict[utxo.TransactionID, utxo.OutputID], callback func(conflict *conflictdag.Conflict[utxo.TransactionID, utxo.OutputID]))

ForEachConnectedConflictingConflictInDescendingOrder iterates over all conflicts connected via conflict sets and sorts them by weight. It calls the callback for each of them in that order.

type WeightFunc

type WeightFunc func(conflictID utxo.TransactionID) (weight int64)

Jump to

Keyboard shortcuts

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