chainstate

package
v0.0.0-...-8d1acea Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UTXOSet

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

UTXOSet represents UTXO set

func NewUTXOSet

func NewUTXOSet(blockchain *blockchain.Blockchain) *UTXOSet

NewUTXOSet creates instance UTXOSet

func (*UTXOSet) Blockchain

func (utx *UTXOSet) Blockchain() *blockchain.Blockchain

func (*UTXOSet) CountTransactions

func (utx *UTXOSet) CountTransactions() int

CountTransactions returns the number of transactions in the UTXO set

func (*UTXOSet) FindSpendableOutputs

func (utx *UTXOSet) FindSpendableOutputs(pubkeyHash []byte, amount int) (int, map[string][]int)

FindSpendableOutputs finds and returns unspent outputs to reference in inputs

func (*UTXOSet) FindUTXO

func (utx *UTXOSet) FindUTXO(pubKeyHash []byte) []transaction.TXOutput

FindUTXO finds UTXO for a public key hash

func (*UTXOSet) Reindex

func (utx *UTXOSet) Reindex()

Reindex rebuilds the UTXO set

func (*UTXOSet) Update

func (utx *UTXOSet) Update(block *blockchain.Block)

Update updates the UTXO set with transactions from the Block The Block is considered to be the tip of a blockchain

Jump to

Keyboard shortcuts

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