quota

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QuotaParamMainnet = NewQuotaParams("4.201037667e-24", "6.259408129e-10")
	QuotaParamTestnet = NewQuotaParams("4.200617563e-21", "6.409829346e-07")
)

Functions

func CalcBlockQuota

func CalcBlockQuota(db quotaDb, block *ledger.AccountBlock) (uint64, error)

func CalcCreateQuota

func CalcCreateQuota(fee *big.Int) uint64

func CalcPoWDifficulty added in v1.3.0

func CalcPoWDifficulty(quotaRequired uint64, q types.Quota) (*big.Int, error)

func CalcQuotaForBlock

func CalcQuotaForBlock(db quotaDb, addr types.Address, pledgeAmount *big.Int, difficulty *big.Int) (quotaTotal, quotaAddition uint64, err error)

func CanPoW added in v1.3.0

func CanPoW(db quotaDb, address types.Address) (bool, error)

func CheckQuota

func CheckQuota(db quotaDb, q types.Quota, addr types.Address) bool

Check whether current quota of a contract account is enough to receive a new block

func GetPledgeQuota

func GetPledgeQuota(db quotaDb, beneficial types.Address, pledgeAmount *big.Int) (types.Quota, error)

func InitQuotaConfig

func InitQuotaConfig(isTest, isTestParam bool)

Types

type NodeConfig

type NodeConfig struct {
	QuotaParams
	// contains filtered or unexported fields
}

type QuotaParams

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

func NewQuotaParams

func NewQuotaParams(strA, strB string) QuotaParams

Jump to

Keyboard shortcuts

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