litecoin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXTRANONCE1_SIZE    = 4
	EXTRANONCE2_SIZE    = 4
	COINBASE_TX_VERSION = 2
)
View Source
const (
	GENESISNBITS = uint32(0x1d00ffff)
)

Variables

This section is empty.

Functions

func GetCoinBaseScript

func GetCoinBaseScript(wallet string) ([]byte, error)

func GetCoinBaseScriptByAddress

func GetCoinBaseScriptByAddress(address string) ([]byte, error)

func GetCoinBaseScriptByPubKey

func GetCoinBaseScriptByPubKey(pubKeyHex string) ([]byte, error)

func GetCoinBaseScriptHex

func GetCoinBaseScriptHex(wallet string) (string, error)

func GetDiffWork

func GetDiffWork(diff float64) (float64, error)

func GetGenesisTargetWork

func GetGenesisTargetWork() (float64, error)

func GetHashRateByDiff

func GetHashRateByDiff(diff float64, secs int64, unit string) (float64, error)

func GetHashRateByNBits

func GetHashRateByNBits(nBits uint32, secs int64, unit string) (float64, error)

func GetHashRateByWork

func GetHashRateByWork(work float64, secs int64, unit string) float64

func GetNBitsDiff

func GetNBitsDiff(nBits uint32) float64

func GetTargetDiff

func GetTargetDiff(target *big.Int) (float64, error)

func GetTargetWork

func GetTargetWork(target *big.Int) (float64, error)

func NBits2Target

func NBits2Target(nBits uint32) *big.Int

func PackNumber

func PackNumber(num int64) []byte

func PackString

func PackString(str string) ([]byte, error)

Types

type CoinBaseTransaction

type CoinBaseTransaction struct {
	BlockTime                uint32
	BlockHeight              uint32
	RewardValue              int64
	CBExtras                 string
	CBAuxFlag                []byte
	VinScript1               []byte
	VinScript2               []byte
	VoutScript               []byte
	CoinBaseTx1              []byte
	CoinBaseTx2              []byte
	DefaultWitnessCommitment []byte
}

func (*CoinBaseTransaction) Initialize

func (t *CoinBaseTransaction) Initialize(cbWallet string, bTime uint32, height uint32, value int64, flags string,
	cbExtras string, defaultWitnessCommitment string) error

func (*CoinBaseTransaction) RecoverToRawTransaction

func (t *CoinBaseTransaction) RecoverToRawTransaction(extraNonce1Hex string, extraNonce2Hex string) (transaction.Transaction, error)

type MasterNodeVout

type MasterNodeVout struct {
	Amount     int64
	VoutScript []byte
}

Jump to

Keyboard shortcuts

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