spam

package
v0.68.0-prev1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTransactionsPerBlockLimitReached = errors.New("cannot generate proof-of-work - transaction per block limit reached")
	ErrBlockHeightTooHistoric           = errors.New("cannot generate proof-of-work - block data is too historic")
)
View Source
var (
	ErrPartyBanned       = errors.New("the network's spam rules has banned this key from submitting the transaction")
	ErrPartyBannedPoW    = errors.New("the network's spam rules has banned this key from submitting all transaction")
	ErrPartyWillBeBanned = errors.New("submitting this transaction will cause this key to be temporarily banned by the the network")
)

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler() *Handler

func (*Handler) CheckSubmission

func (s *Handler) CheckSubmission(req *walletpb.SubmitTransactionRequest, newStats *nodetypes.SpamStatistics) error

CheckSubmission return an error if we are banned from making this type of transaction or if submitting the transaction will result in a banning.

func (*Handler) GenerateProofOfWork

func (s *Handler) GenerateProofOfWork(pubKey string, st *nodetypes.SpamStatistics) (*commandspb.ProofOfWork, error)

Generate returns a proof-of-work with difficult that respects the history of transactions sent in against a particular block.

Jump to

Keyboard shortcuts

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