spam

package
v0.68.0-prev2 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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)

GenerateProofOfWork 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