Documentation ¶
Index ¶
- Constants
- Variables
- func CalcBlockQuota(db quotaDb, block *ledger.AccountBlock, sbHeight uint64) (uint64, error)
- func CalcCreateQuota(fee *big.Int) uint64
- func CalcPledgeAmountByUtps(utps float64) (*big.Int, error)
- func CalcPoWDifficulty(db quotaDb, quotaRequired uint64, q types.Quota, sbHeight uint64) (*big.Int, error)
- func CalcQc(db quotaDb, sbHeight uint64) (*big.Int, uint64, bool)
- func CalcQuotaForBlock(db quotaDb, addr types.Address, pledgeAmount *big.Int, difficulty *big.Int, ...) (quotaTotal, quotaAddition uint64, err error)
- func CalcSnapshotCurrentQuota(db quotaDb, beneficial types.Address, pledgeAmount *big.Int, sbHeight uint64) (uint64, error)
- func CanPoW(db quotaDb, address types.Address) bool
- func CheckQuota(db quotaDb, q types.Quota, addr types.Address) bool
- func GetPledgeQuota(db quotaDb, beneficial types.Address, pledgeAmount *big.Int, sbHeight uint64) (types.Quota, error)
- func InitQuotaConfig(isTest, isTestParam bool)
- type NodeConfig
- type QuotaParams
Constants ¶
View Source
const (
QuotaForUtps uint64 = 21000
)
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, sbHeight uint64) (uint64, error)
func CalcCreateQuota ¶
func CalcPoWDifficulty ¶ added in v1.3.0
func CalcQuotaForBlock ¶
func CheckQuota ¶
Check whether current quota of a contract account is enough to receive a new block
func GetPledgeQuota ¶
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
Click to show internal directories.
Click to hide internal directories.