cap MaxNonceGap to 16

This commit is contained in:
vyzo 2020-09-02 00:12:43 +03:00
parent 7b76aa2078
commit f53d2e3a46

View File

@ -53,7 +53,7 @@ var minimumBaseFee = types.NewInt(uint64(build.MinimumBaseFee))
var MaxActorPendingMessages = 1000
var MaxNonceGap = uint64(runtime.NumCPU())
var MaxNonceGap = uint64(16)
var (
ErrMessageTooBig = errors.New("message too big")
@ -82,6 +82,13 @@ const (
localUpdates = "update"
)
func init() {
numcpus := uint64(runtime.NumCPU())
if numcpus < MaxNonceGap {
MaxNonceGap = numcpus
}
}
type MessagePool struct {
lk sync.Mutex