util

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DEBUG = 10
	INFO  = 20
	WARN  = 30
	ERROR = 40
	SHARE = 100
	BLOCK = 101

	Debug *PoolLogger
	Info  *PoolLogger
	Warn  *PoolLogger
	Error *PoolLogger

	ShareLog *PoolLogger
	BlockLog *PoolLogger
)
View Source
var Diff1 = StringToBig("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")
View Source
var Satoshi = math.BigPow(10, 0)
View Source
var Xmr = math.BigPow(10, 12)

Functions

func Ae64Decode

func Ae64Decode(str string, key []byte) ([]byte, error)

func Ae64Encode

func Ae64Encode(src []byte, key []byte) (string, error)

func FormatRatReward

func FormatRatReward(reward *big.Rat) string

func GetHashDifficulty

func GetHashDifficulty(hashBytes []byte) (*big.Int, bool)

func GetTargetHex

func GetTargetHex(diff int64) string

func InitLog

func InitLog(infoFile, errorFile, shareFile, blockFile string, setLevel int)

func MakeTimestamp

func MakeTimestamp() int64

func MustParseDuration

func MustParseDuration(s string) time.Duration

func SetRLimit

func SetRLimit(v uint64)

func StringToBig

func StringToBig(h string) *big.Int

Types

type PoolLogger

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

func (*PoolLogger) Fatal

func (l *PoolLogger) Fatal(v ...interface{})

func (*PoolLogger) Fatalf

func (l *PoolLogger) Fatalf(format string, v ...interface{})

func (*PoolLogger) Fatalln

func (l *PoolLogger) Fatalln(v ...interface{})

func (*PoolLogger) Panic

func (l *PoolLogger) Panic(v ...interface{})

func (*PoolLogger) Panicf

func (l *PoolLogger) Panicf(format string, v ...interface{})

func (*PoolLogger) Panicln

func (l *PoolLogger) Panicln(v ...interface{})

func (*PoolLogger) Print

func (l *PoolLogger) Print(v ...interface{})

func (*PoolLogger) Printf

func (l *PoolLogger) Printf(format string, v ...interface{})

func (*PoolLogger) Println

func (l *PoolLogger) Println(v ...interface{})

Jump to

Keyboard shortcuts

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