blockchain

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DistributeIncentive

func DistributeIncentive(
	store *store.Store,
	logger log.Logger,

	weightValidator, weightDelegator float64,
	blkReward, txReward types.Currency,
	numDeliveredTxs int64,
	staker crypto.Address,
	feeAccumulated types.Currency,
) ([]abci.Event, error)

func PenalizeConvicts

func PenalizeConvicts(
	store *store.Store,
	logger log.Logger,

	evidences []abci.Evidence,
	lazyValidators []crypto.Address,

	weightValidator, weightDelegator float64,
	penaltyRatioM, penaltyRatioL float64,
) (bool, []abci.Event, error)

Types

type MissRuns added in v1.7.0

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

func NewMissRuns added in v1.7.0

func NewMissRuns(store *store.Store, db tmdb.DB, hibThreshold, hibPeriod, lazyWindow int64) *MissRuns

func (MissRuns) GetMissStat added in v1.7.0

func (m MissRuns) GetMissStat(rangeStart, rangeEnd int64) map[string]int64

func (MissRuns) UpdateMissRuns added in v1.7.0

func (m MissRuns) UpdateMissRuns(height int64, vals []crypto.Address) (doValUpdate bool, evs []abci.Event, err error)

type ReplayPreventer

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

func NewReplayPreventer

func NewReplayPreventer(
	store *store.Store,
	blockHeight int64,
	indexRange int64,
) ReplayPreventer

func (*ReplayPreventer) Append

func (rp *ReplayPreventer) Append(tx []byte, txHeight, blockHeight int64) error

Append() is called at DeliverTx()

func (*ReplayPreventer) Check

func (rp *ReplayPreventer) Check(tx []byte, txHeight, blockHeight int64) error

Check() is called at CheckTx()

func (*ReplayPreventer) Index

func (rp *ReplayPreventer) Index(blockHeight int64)

Index() is called at EndBlock()

func (*ReplayPreventer) Update

func (rp *ReplayPreventer) Update(blockHeight, indexRange int64)

Update() is called at BeginBlock()

type TxBucket

type TxBucket map[TxHash]bool

type TxHash

type TxHash [32]byte

Jump to

Keyboard shortcuts

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