utxomanager

package
v0.0.0-...-019d704 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxLoopTime   = 100
	MaxReceiver   = 2
	MinUTXOAmount = 1e9 // 1 PRV
	PRVIDStr      = "0000000000000000000000000000000000000000000000000000000000000004"
)
View Source
const (
	TmpPrefix = "Tmp"
)

Variables

This section is empty.

Functions

func SplitUTXOs

func SplitUTXOs(privateKey string, paymentAddress string, minNumUTXOs int, utxoManager *UTXOManager) error

Types

type UTXO

type UTXO struct {
	Coin  coin.PlainCoin
	Index *big.Int
}

type UTXOManager

type UTXOManager struct {
	Unspent map[string][]UTXO            // public key: UTXO
	Caches  map[string]map[string][]UTXO // public key: txID: UTXO

	TmpIdx    int
	IncClient *incclient.IncClient
	// contains filtered or unexported fields
}

func NewUTXOManager

func NewUTXOManager(incClient *incclient.IncClient) *UTXOManager

func (*UTXOManager) CacheUTXOsByTxID

func (c *UTXOManager) CacheUTXOsByTxID(privateKey string, txID string, utxos []UTXO)

func (*UTXOManager) GetListUnspentUTXO

func (c *UTXOManager) GetListUnspentUTXO(privateKey string) ([]UTXO, error)

func (*UTXOManager) GetUTXOsByAmount

func (c *UTXOManager) GetUTXOsByAmount(privateKey string, amount uint64) ([]UTXO, string, error)

func (*UTXOManager) UncachedUTXOByTmpTxID

func (c *UTXOManager) UncachedUTXOByTmpTxID(privateKey string, tmpTxID string)

func (*UTXOManager) UpdateTxID

func (c *UTXOManager) UpdateTxID(privateKey string, tmpTxID string, txID string)

Jump to

Keyboard shortcuts

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