double_spend

package
v0.2.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachAllToDoubleSpendChecks

func AttachAllToDoubleSpendChecks(doubleSpendChecks []*DoubleSpendCheck) error

func AttachBlocksToSpendCheckSpends

func AttachBlocksToSpendCheckSpends(doubleSpendChecks []*DoubleSpendCheck) error

AttachBlocksToSpendCheckSpends TODO: Handle block hash already set, also include confirmation count

func AttachLockHashesToSpendChecks

func AttachLockHashesToSpendChecks(doubleSpendChecks []*DoubleSpendCheck) error

AttachLockHashesToSpendChecks assumes blocks attached before

func AttachSeensToSpendCheckSpends

func AttachSeensToSpendCheckSpends(doubleSpendChecks []*DoubleSpendCheck) error

Types

type DoubleSpendCheck

type DoubleSpendCheck struct {
	ParentTxHash  [32]byte
	ParentTxIndex uint32
	LockHash      []byte
	Spends        []*DoubleSpendCheckSpend
}

func (DoubleSpendCheck) GetWinnerSpend

func (c DoubleSpendCheck) GetWinnerSpend() (*DoubleSpendCheckSpend, error)

func (DoubleSpendCheck) IsWinnerSpend

func (c DoubleSpendCheck) IsWinnerSpend(spendCheck *DoubleSpendCheckSpend) (bool, error)

type DoubleSpendCheckSpend

type DoubleSpendCheckSpend struct {
	TxHash     [32]byte
	Index      uint32
	LockHashes [][]byte
	FirstSeen  time.Time
	BlockHash  []byte
}

Jump to

Keyboard shortcuts

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