blockchain

package
v1.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: Apache-2.0 Imports: 9 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 uint64,
	blkReward, txReward types.Currency,
	height, numDeliveredTxs int64,
	staker crypto.Address,
	feeAccumulated types.Currency,
) error

func PenalizeConvicts

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

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

	weightValidator, weightDelegator uint64,
	penaltyRatioM, penaltyRatioL float64,
) error

Types

type Address

type Address = store.Address

type LazinessCounter

type LazinessCounter struct {
	Candidates LazyValidators `json:"lazy_validators"` // stored on store
	Height     int64          `json:"height"`

	Due   int64   `json:"due"`   // from state
	Size  int64   `json:"size"`  // from config
	Ratio float64 `json:"ratio"` // from config
	// contains filtered or unexported fields
}

func NewLazinessCounter

func NewLazinessCounter(store *store.Store, height, due, size int64, ratio float64) LazinessCounter

func (*LazinessCounter) Investigate

func (lc *LazinessCounter) Investigate(height int64, commitInfo abci.LastCommitInfo) ([]crypto.Address, int64)

func (*LazinessCounter) Set added in v1.4.1

func (lc *LazinessCounter) Set(size int64, ratio float64)

type LazyValidators

type LazyValidators = store.LazyValidators

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