import (
"fmt"
"math"
+ "runtime"
"sync"
"github.com/vapor/common"
"github.com/vapor/protocol/vm"
)
-const (
- validateWorkerNum = 32
-)
-
// validate transaction error
var (
ErrTxVersion = errors.New("invalid transaction version")
// ValidateTxs validates txs in async mode
func ValidateTxs(txs []*bc.Tx, block *bc.Block) []*ValidateTxResult {
txSize := len(txs)
+ validateWorkerNum := runtime.NumCPU()
//init the goroutine validate worker
var wg sync.WaitGroup
workCh := make(chan *validateTxWork, txSize)