Revision 58574b7372cc9dd224ef04aaa438578f72e69a77 authored by Jae Kwon on 09 November 2018, 23:45:50 UTC, committed by Jae Kwon on 09 November 2018, 23:51:56 UTC
1 parent 6e9aee5
Raw File
tx_filter.go
package state

import (
	"github.com/tendermint/tendermint/types"
)

// TxFilter returns a function to filter transactions. The function limits the
// size of a transaction to the maximum block's data size.
func TxFilter(state State) func(tx types.Tx) bool {
	maxDataBytes := types.MaxDataBytesUnknownEvidence(
		state.ConsensusParams.BlockSize.MaxBytes,
		state.Validators.Size(),
	)
	return func(tx types.Tx) bool { return int64(len(tx)) <= maxDataBytes }
}
back to top