(ctx *cli.Context)
| 277 | } |
| 278 | |
| 279 | func initTxPool(ctx *cli.Context) (*proc.TXPoolServer, error) { |
| 280 | disablePreExec := ctx.GlobalBool(utils.GetFlagName(utils.TxpoolPreExecDisableFlag)) |
| 281 | bactor.DisableSyncVerifyTx = ctx.GlobalBool(utils.GetFlagName(utils.DisableSyncVerifyTxFlag)) |
| 282 | disableBroadcastNetTx := ctx.GlobalBool(utils.GetFlagName(utils.DisableBroadcastNetTxFlag)) |
| 283 | txPoolServer, err := txnpool.StartTxnPoolServer(disablePreExec, disableBroadcastNetTx) |
| 284 | if err != nil { |
| 285 | return nil, fmt.Errorf("Init txpool error: %s", err) |
| 286 | } |
| 287 | stlValidator, _ := stateless.NewValidator("stateless_validator") |
| 288 | stlValidator.Register(txPoolServer.GetPID(tc.VerifyRspActor)) |
| 289 | stlValidator2, _ := stateless.NewValidator("stateless_validator2") |
| 290 | stlValidator2.Register(txPoolServer.GetPID(tc.VerifyRspActor)) |
| 291 | stfValidator, _ := stateful.NewValidator("stateful_validator") |
| 292 | stfValidator.Register(txPoolServer.GetPID(tc.VerifyRspActor)) |
| 293 | |
| 294 | hserver.SetTxnPoolPid(txPoolServer.GetPID(tc.TxPoolActor)) |
| 295 | hserver.SetTxPid(txPoolServer.GetPID(tc.TxActor)) |
| 296 | |
| 297 | log.Infof("TxPool init success") |
| 298 | return txPoolServer, nil |
| 299 | } |
| 300 | |
| 301 | func initP2PNode(ctx *cli.Context, txpoolSvr *proc.TXPoolServer) (*p2pserver.P2PServer, *actor.PID, error) { |
| 302 | if config.DefConfig.Genesis.ConsensusType == config.CONSENSUS_TYPE_SOLO { |
no test coverage detected